[antlr-interest] variable names starting with underscore

stefan stefan at amiq.ro
Tue May 17 05:11:12 PDT 2005


Hi!

       I have next piece of grammar:
.........................
rule_one
{ 
     String _st = null;
}
: #(RULE_ONE _st=other_rule)
;
....................

     During generation (using antlr-2.7.5) I get next error:

[antlr] TokenStreamException: unexpected char: '_'

    If I use 'st' instead of '_st' it works.

    Are underscores allowed at the begining of the variable name? Is this a 
(known) limitation/bug?

Thanks,
          Stefan.


More information about the antlr-interest mailing list