[antlr-interest] adding enum token types output for java target

Johannes Luber JALuber at gmx.de
Mon May 26 10:59:55 PDT 2008


> Howdy folks,
> 
> The C target gets a .h file as output to define tokens etc...  Brian  
> Goetz, Sun smarty pants, asked me about generating an enum from ANTLR  
> to make it easier for IDEs and other tools to use reflection to get  
> token types and other goodies.  It took me 2 minutes and a few  
> template lines to make this happen (i.e., no code generator changes).

You mean an enum for UP, DOWN, EOF, etc.? Why isn't there one already used in Java instead the int array? Why is the current solution not sufficient?

> Should I add this for 3.1?  Should it be added at all?

I'd say you can still add this feature (if you manage to convince me of its necessity). C# may be late because I get my notebook back in one or two weeks (hopefully), but you can release 3.1.1 in the case that 3.1 is published before I can update the other stuff.

Johannes
> 
> Note that we still need a textbased ID=34 type file for data  
> interchange with nonjava tools etc...
> 
> Given the late release stage, I could do for java and leave such a  
> change for other targets to 3.2, though it's trivial to add.
> 
> Votes?
> 
> Ter

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger


More information about the antlr-interest mailing list