Parser
- Sets proper ambiguity required during Parser::initialize.
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user