#include #include #include #include namespace pddl { namespace detail { //////////////////////////////////////////////////////////////////////////////////////////////////// // // Term // //////////////////////////////////////////////////////////////////////////////////////////////////// std::experimental::optional parseTerm(Context &context, ASTContext &astContext, VariableStack &variableStack) { auto &tokenizer = context.tokenizer; tokenizer.skipWhiteSpace(); // TODO: refactor auto variable = testParsingVariable(context, variableStack); if (variable) return std::move(variable.value()); // Parse argument if it is a constant auto constant = testParsingConstant(context, astContext); if (constant) return std::move(constant.value()); return std::experimental::nullopt; } //////////////////////////////////////////////////////////////////////////////////////////////////// } }