[antlr-interest] reference tokens{} in other files

Johannes Luber jaluber at gmx.de
Thu Nov 1 13:59:27 PDT 2007


Michael LeBlanc wrote:
> Sorry.  To be more complete, I want to refer to DUMMY in another Java
> source file not built by ANTLR.  In earlier versions, ANTLR wrote an
> 'interface' file which other classes could 'implement' to inherit the
> names.  Now for grammar foo.g it writes foo.tokens only, AFAIK.  Yes, it
> writes them into fooParser.java as
>     public static final int DUMMY=28;
> which forces me (I think) to refer to it as
>     fooParser.DUMMY
> 
That's correct. It's not possible to change that, but adding fooParser
should be a minor inconvenience.

Johannes


More information about the antlr-interest mailing list