48 {
50 ScriptGrammar grammar(first);
51 success_ = qi::phrase_parse(iter, last, grammar, boost::spirit::qi::space);
55 LocationInfo(boost::spirit::get_line(iter), boost::spirit::get_column(first, iter),
56 boost::spirit::get_line(iter), boost::spirit::get_column(first, iter));
58 if (grammar.hasError) {
61 boost::spirit::get_line(grammar.errorPos), boost::spirit::get_column(first, grammar.errorPos),
62 boost::spirit::get_line(grammar.errorPos), boost::spirit::get_column(first, grammar.errorPos));
65 auto currentLine = boost::spirit::get_current_line(grammar.errorBegin, grammar.errorPos, grammar.errorEnd);
67 }
68 } else {
69 QL_REQUIRE(grammar.evalStack.size() == 1,
70 "ScriptParser: unexpected eval stack size (" << grammar.evalStack.size() << "), should be 1");
71 ast_ = grammar.evalStack.top();
72 QL_REQUIRE(
ast_,
"ScriptParser: ast is null");
73 }
74}
boost::spirit::line_pos_iterator< std::string::const_iterator > ScriptGrammarIterator
std::string to_string(const LocationInfo &l)
LocationInfo stoppedParsingAt
LocationInfo expectedWhere
std::string remainingInput
std::string scriptCurrentLine
std::string scriptContext