[antlr-interest] unexpected token when AST rewrite is used

Terence Parr parrt at cs.usfca.edu
Fri Jun 13 01:06:57 PDT 2008


I'd suggest trying 3.1b1.
Ter
On Jun 13, 2008, at 9:58 AM, Bernardo Elayda wrote:

> Hi,
> Why does Antlr 3.0.1 complain that a token is unexpected for the  
> rule called B which has a single argument:
>
> a : b[0]+ -> ^(MYPROGRAM b[0]+)
>    ;
>
> I can only get Antlr to accept the above rule if I do this:
>
> a : b[0] -> ^(MYPROGRAM b+)
>
> Are rules with arguments not allowed as child nodes in an Antlr AST?
>
> tia,
> Bernardo Elayda
>



More information about the antlr-interest mailing list