[antlr-interest] some advice on tracking location in parser rules

William Tribbey will at tribbey.net
Fri Aug 13 08:48:15 PDT 2010


Hi Everyone,

As a newbie working through my first real antlr project I find myself
wondering what is the
better way to keep track where I have been as I make my way through the
parser rules.
I am using a Java.g file and when I wind up for instance, down in the
statement rule, I would
like to be able to figure out how I got there. I have seen examples in the
reference book that
use boolean flags and scopes to do this. Is there a better way? Return
values on the rules?

Thank you,

Will T.


More information about the antlr-interest mailing list