Hi everyone,
I'm brand new to ANTLR. I didn't find any doubt similar.
Imagine a parser which the first rule is "prog", the output option is AST. I
created a tree walker to perform the tree evaluation but I need to evaluate
the same tree in a loop such as:
CommonTreeNodeStream nodes = new CommonTreeNodeStream(t);
LangWalker evaluator = new LangWalker(nodes);
for(int i = 0; i < 10000; i++)
evaluator.rule();
end
As I understood, ANTLR consumes the stream so after the first
evaluator.rule() there is nothing more to consume and the code above
generates a null pointer exception (am I correct?). Is there any direct way
to solve this without having to recreate the tree (i.e. putting the first
two lines inside the loop) on each iteraction?
Best regards,
Hugo.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address