- 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))
branch->tag ("QUOTED");
std::vector <std::pair <std::string, Lexer::Type> > lexemes;
Lexer::token_split (lexemes, raw);
std::vector <std::pair <std::string, Lexer::Type> >::iterator lex;
for (lex = lexemes.begin (); lex != lexemes.end (); ++lex)
std::string lexeme;
Lexer::Type type;
Lexer lex (raw);
lex.ambiguity (false);
while (lex.token (lexeme, type))
{
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");
// TODO More types needed.