[antlr-interest] Wrong generated code (Version 3.01b)
Terence Parr
parrt at cs.usfca.edu
Wed Jun 28 09:12:44 PDT 2006
That is a bug. I will look at it as soon as I can get into the office.
Thanks for the report!
Ter
On Jun 28, 2006, at 1:42 AM, Jose Ventura wrote:
> Over all, I want to thank for Terence for new version of antlr
>
> I apologize if this is a founded bug.
>
> With the following grammar
> grammar a;
> options {output=AST;}
> tokens {PARMS;}
>
> modulo
> : 'modulo' ID ('(' parms+ ')')? -> ^('modulo' ID ^(PARMS parms+)?)
> ;
> parms : '#'|ID;
> ID : ('a'..'z' | 'A'..'Z')*;
> WS : (' ' | '\t' | '\n' | '\r')+ {channel=99;} ;
>
> The compiler result is
>
> a.java:150: cannot find symbol
> symbol : variable n_1
> location: class a
> if ( n_1 > 1 ) throw new RuntimeException(" list
> has > 1 elements");
> ^
> a.java :151: cannot find symbol
> symbol : variable n_1
> location: class a
> if ( n_1==1 ) {
> ^
>
> Any help is very much welcome
> Thanks
More information about the antlr-interest
mailing list