#include #include // TODO: remove #include #include namespace pddl { namespace detail { //////////////////////////////////////////////////////////////////////////////////////////////////// // // Action // //////////////////////////////////////////////////////////////////////////////////////////////////// void parseAndAddAction(Context &context, ast::Domain &domain) { auto &tokenizer = context.tokenizer; tokenizer.expect("("); tokenizer.expect(":"); tokenizer.expect("action"); auto action = std::make_unique(); action->name = tokenizer.getIdentifier(); tokenizer.expect(":parameters"); tokenizer.expect("("); // Read parameters action->parameters = parseVariableDeclarations(context, domain); tokenizer.expect(")"); // TODO: reimplement skipSection(tokenizer); /* // Parse preconditions and effects while (!tokenizer.testAndReturn(')')) { tokenizer.expect(":"); if (tokenizer.testIdentifierAndSkip("precondition")) // TODO: reimplement //action->precondition = parsePreconditionExpression(context, expressionContext); skipSection(tokenizer); else if (tokenizer.testIdentifierAndSkip("effect")) // TODO: reimplement //action->effect = parseEffectExpression(context, expressionContext); skipSection(tokenizer); tokenizer.skipWhiteSpace(); }*/ // Store new action domain.actions.emplace_back(std::move(action)); //tokenizer.expect(")"); } //////////////////////////////////////////////////////////////////////////////////////////////////// } }