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

Terence Parr parrt at cs.usfca.edu
Mon May 26 14:00:26 PDT 2008


On May 26, 2008, at 1:57 PM, 向雅 wrote:
> enum is 1.5. It would be nice, if you could still add that to the  
> templates within comments, so targets with a support for enums can  
> simply change the output.
>
> Actually, we could add an attribute to the output templates that  
> indicates the language level. Useful for not only Java but C# as  
> well, right? then we could do
>
> <if(1_5)>
> enum...
> <endif>
>
> Ter
>
> If 1.4 needed, maybe 2 build versions needed. One for 1.4, One for  
> 1.5.

I suppose the "right way" would be to have Java target mean 1.4 and  
below and them have Java5 target override a method in its template  
supergroup to add the enum.

Ter


More information about the antlr-interest mailing list