[antlr-interest] Problem with AST rewrite
Emond Papegaaij
e.papegaaij at student.utwente.nl
Sun Aug 6 00:36:31 PDT 2006
On Saturday 05 August 2006 11:38, Emond Papegaaij wrote:
> 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?
The problem seems to be a mismatch between the name of the list in the
declaration and the name of the list when used. The list is called 'list_5'
(from token 5), but the token is added to 'list_SEMI'.
Best regards,
Emond Papegaaij
More information about the antlr-interest
mailing list