- Sets proper ambiguity required during Parser::initialize.
This commit is contained in:
Paul Beckingham
2014-07-03 18:17:35 -04:00
parent a04df10d11
commit 468da9dcde

View File

@@ -83,16 +83,16 @@ void Parser::initialize (int argc, const char** argv)
if (! noSpaces (raw)) if (! noSpaces (raw))
branch->tag ("QUOTED"); branch->tag ("QUOTED");
std::vector <std::pair <std::string, Lexer::Type> > lexemes; std::string lexeme;
Lexer::token_split (lexemes, raw); Lexer::Type type;
Lexer lex (raw);
std::vector <std::pair <std::string, Lexer::Type> >::iterator lex; lex.ambiguity (false);
for (lex = lexemes.begin (); lex != lexemes.end (); ++lex) while (lex.token (lexeme, type))
{ {
Tree* sub = branch->addBranch (new Tree ("argSub")); Tree* sub = branch->addBranch (new Tree ("argSub"));
sub->attribute ("raw", lex->first); sub->attribute ("raw", lexeme);
if (lex->second == Lexer::typeOperator) if (type == Lexer::typeOperator)
sub->tag ("OP"); sub->tag ("OP");
// TODO More types needed. // TODO More types needed.