[antlr-interest] Token sorting in C# target (3.1b2)

Johannes Luber jaluber at gmx.de
Tue Jul 22 05:55:37 PDT 2008


dermot_1 at astrodrive.com schrieb:
> Just working through the latest beta ... one thing that I would find 
> very useful if to have the tokens sorted in the generated files. For 
> example, I get this:
> 
>     public const int MOD = 143;
>     public const int LETTER = 198;
>     public const int CONST = 69;
> 
> it would make debugging a lot easier if the tokens were sorted 
> numerically like this:
> 
>     public const int MOD = 143;
>     public const int INC = 144;
>     public const int DEC = 145;
> 
> Currently, I have to do a search for (say) 144 to find out that it’s a 
> DEC token – and with several hundred tokens it can be time consuming. 
> This is most noticeable in debugging tree grammars where I typically 
> just have a list of tokens to stare at.
> 
> Note that in Antlr 2.7 the tokens were sorted numerically.
> 
> Dermot
> 

That's an ANTLR issue itself. The C# target has no way to influence 
this. Ter has to change this himself in the ANTLR tool.

Johannes


More information about the antlr-interest mailing list