[antlr-interest] [v3] parser rules are final

Monty Zukowski monty at codetransform.com
Fri Jun 8 06:48:08 PDT 2007


On 6/8/07, Sven Efftinge <sven at efftinge.de> wrote:
...Something about saving location information...
> 1st question:
> Is there a better way to do that generically? (without thirdparty AOP stuff)

Check the documentation further, or check for an example with a custom
token or custom AST.  With ANTLR 2 you used to be able to create your
own Token type and store whatever information you needed in there.
There was some particular method called to actually create the token,
which you could override.  That token is passed to the AST constructor
so that the AST could get whatever it needed out of the token.  There
must be a similar strategy at play in ANTLR 3.

Monty


More information about the antlr-interest mailing list