[antlr-interest] Problem with AST rewrite

Sean Walton swalton at cs.utah.edu
Sat Aug 5 07:14:55 PDT 2006


Emond Papegaaij wrote:
> Hello,
>
> The attached grammar produces incorrect code (v3b3), which gives the following 
> compile error:
>   TPLLogic.java:203: cannot find symbol
>   symbol  : variable list_SEMI
>   location: class TPLLogic
>                       list_SEMI.add(SEMI6);
>                       ^
>
> It seems to be caused by the usage of ';' in the first rule, while the second 
> rule uses 'SEMI'. Is it allowed to mix these two in a single grammar?
>
> Best regards,
> Emond Papegaaij
>   
A quick (inexperienced) stab is the rule "symbol" needs a semicolon.  
So, 'symbol' flows into 'location' as a single rule.
-Sean Walton


More information about the antlr-interest mailing list