diff --git a/lib/pddlparse/src/pddlparse/detail/parsing/Action.cpp b/lib/pddlparse/src/pddlparse/detail/parsing/Action.cpp index 8051ab9..af4e333 100644 --- a/lib/pddlparse/src/pddlparse/detail/parsing/Action.cpp +++ b/lib/pddlparse/src/pddlparse/detail/parsing/Action.cpp @@ -1,6 +1,7 @@ #include #include +#include #include #include #include @@ -86,7 +87,7 @@ void ActionParser::findSections(ast::Action &action) if (unique && sectionPosition != -1) { tokenizer.seek(value); - throw tokenize::TokenizerException(tokenizer.location(), "only one “:" + sectionName + "” section allowed"); + throw ParserException(tokenizer.location(), "only one “:" + sectionName + "” section allowed"); } sectionPosition = value; @@ -113,7 +114,7 @@ void ActionParser::findSections(ast::Action &action) const auto sectionIdentifier = tokenizer.getIdentifier(); tokenizer.seek(position); - throw tokenize::TokenizerException(tokenizer.location(), "unknown action section “" + sectionIdentifier + "”"); + throw ParserException(tokenizer.location(), "unknown action section “" + sectionIdentifier + "”"); } tokenizer.expect("("); diff --git a/lib/pddlparse/src/pddlparse/detail/parsing/Domain.cpp b/lib/pddlparse/src/pddlparse/detail/parsing/Domain.cpp index 9dc325b..e508efa 100644 --- a/lib/pddlparse/src/pddlparse/detail/parsing/Domain.cpp +++ b/lib/pddlparse/src/pddlparse/detail/parsing/Domain.cpp @@ -96,7 +96,7 @@ void DomainParser::findSections(ast::Domain &domain) if (unique && sectionPosition != -1) { tokenizer.seek(value); - throw tokenize::TokenizerException(tokenizer.location(), "only one “:" + sectionName + "” section allowed"); + throw ParserException(tokenizer.location(), "only one “:" + sectionName + "” section allowed"); } sectionPosition = value; @@ -146,7 +146,7 @@ void DomainParser::findSections(ast::Domain &domain) const auto sectionIdentifier = tokenizer.getIdentifier(); tokenizer.seek(position); - throw tokenize::TokenizerException(tokenizer.location(), "unknown domain section “" + sectionIdentifier + "”"); + throw ParserException(tokenizer.location(), "unknown domain section “" + sectionIdentifier + "”"); } // Skip section for now and parse it later diff --git a/lib/pddlparse/src/pddlparse/detail/parsing/Effect.cpp b/lib/pddlparse/src/pddlparse/detail/parsing/Effect.cpp index 73195a3..6b141cd 100644 --- a/lib/pddlparse/src/pddlparse/detail/parsing/Effect.cpp +++ b/lib/pddlparse/src/pddlparse/detail/parsing/Effect.cpp @@ -83,7 +83,7 @@ std::experimental::optional parseEffectBody(Context &context, ASTCo const auto expressionIdentifier = tokenizer.getIdentifier(); tokenizer.seek(position); - throw tokenize::TokenizerException(tokenizer.location(), "expression type “" + expressionIdentifier + "” unknown or not allowed in effect body"); + throw ParserException(tokenizer.location(), "expression type “" + expressionIdentifier + "” unknown or not allowed in effect body"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -144,7 +144,7 @@ std::experimental::optional parseConditionalEffectBody(C const auto expressionIdentifier = tokenizer.getIdentifier(); tokenizer.seek(position); - throw tokenize::TokenizerException(tokenizer.location(), "expression type “" + expressionIdentifier + "” unknown or not allowed in conditional effect body"); + throw ParserException(tokenizer.location(), "expression type “" + expressionIdentifier + "” unknown or not allowed in conditional effect body"); } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/lib/pddlparse/src/pddlparse/detail/parsing/InitialState.cpp b/lib/pddlparse/src/pddlparse/detail/parsing/InitialState.cpp index ebba5fe..362969e 100644 --- a/lib/pddlparse/src/pddlparse/detail/parsing/InitialState.cpp +++ b/lib/pddlparse/src/pddlparse/detail/parsing/InitialState.cpp @@ -1,8 +1,7 @@ #include #include -// TODO: remove -#include +#include namespace pddl { diff --git a/lib/pddlparse/src/pddlparse/detail/parsing/Precondition.cpp b/lib/pddlparse/src/pddlparse/detail/parsing/Precondition.cpp index ffcef75..53f07f0 100644 --- a/lib/pddlparse/src/pddlparse/detail/parsing/Precondition.cpp +++ b/lib/pddlparse/src/pddlparse/detail/parsing/Precondition.cpp @@ -99,7 +99,7 @@ std::experimental::optional parsePreconditionBody(Context &co const auto expressionIdentifier = tokenizer.getIdentifier(); tokenizer.seek(position); - throw tokenize::TokenizerException(tokenizer.location(), "expression type “" + expressionIdentifier + "” unknown or not allowed in precondition body"); + throw ParserException(tokenizer.location(), "expression type “" + expressionIdentifier + "” unknown or not allowed in precondition body"); } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/lib/pddlparse/src/pddlparse/detail/parsing/PrimitiveType.cpp b/lib/pddlparse/src/pddlparse/detail/parsing/PrimitiveType.cpp index a3c85a4..669ab08 100644 --- a/lib/pddlparse/src/pddlparse/detail/parsing/PrimitiveType.cpp +++ b/lib/pddlparse/src/pddlparse/detail/parsing/PrimitiveType.cpp @@ -24,7 +24,7 @@ ast::PrimitiveTypePointer parsePrimitiveType(Context &context, ast::Domain &doma auto typeName = tokenizer.getIdentifier(); if (typeName.empty()) - throw tokenize::TokenizerException(tokenizer.location(), "could not parse primitive type, expected identifier"); + throw ParserException(tokenizer.location(), "could not parse primitive type, expected identifier"); auto matchingType = std::find_if(types.begin(), types.end(), [&](auto &primitiveTypeDeclaration) diff --git a/lib/pddlparse/src/pddlparse/detail/parsing/Problem.cpp b/lib/pddlparse/src/pddlparse/detail/parsing/Problem.cpp index 6c186c2..21709df 100644 --- a/lib/pddlparse/src/pddlparse/detail/parsing/Problem.cpp +++ b/lib/pddlparse/src/pddlparse/detail/parsing/Problem.cpp @@ -93,7 +93,7 @@ void ProblemParser::findSections(ast::Problem &problem) if (unique && sectionPosition != -1) { tokenizer.seek(value); - throw tokenize::TokenizerException(tokenizer.location(), "only one “:" + sectionName + "” section allowed"); + throw ParserException(tokenizer.location(), "only one “:" + sectionName + "” section allowed"); } sectionPosition = value; @@ -137,7 +137,7 @@ void ProblemParser::findSections(ast::Problem &problem) const auto sectionIdentifier = tokenizer.getIdentifier(); tokenizer.seek(position); - throw tokenize::TokenizerException(tokenizer.location(), "unknown problem section “" + sectionIdentifier + "”"); + throw ParserException(tokenizer.location(), "unknown problem section “" + sectionIdentifier + "”"); } // Skip section for now and parse it later @@ -164,7 +164,7 @@ void ProblemParser::parseDomainSection(ast::Problem &problem) const auto domainName = tokenizer.getIdentifier(); if (problem.domain->name != domainName) - throw tokenize::TokenizerException(tokenizer.location(), "domains do not match (“" + problem.domain->name + "” and “" + domainName + "”)"); + throw ParserException(tokenizer.location(), "domains do not match (“" + problem.domain->name + "” and “" + domainName + "”)"); tokenizer.expect(")"); }