[antlr-interest] V2 -> V3 rules

g4 at novadsp.com g4 at novadsp.com
Mon Mar 7 06:32:55 PST 2011


I've checked the Migration Wiki and it's a little unclear on how handle 
the following. The general form is taken from bison.g:

V2:

rhs : rhs_alt
     { ## = #( [ALT, "alt"], #rhs ); }
     ( OR^ rhs_alt )*;

V3:

rhs : (a=rhs_alt -> $rhs ) (OR b=rhs)*
     ;

error(132) reference $rhs is ambiguous; rule rhs is enclosing rule and 
referenced in the production (assuming enclosing rule)

V3 - not even sure if this form is legal ...

rhs : rhs_alt
         { $$ = $([OR,"or"],$rhs); }
       (OR^ rhs_alt)*
     ;

error(117): missing attribute access on rule scope: rhs

Thx++

Jerry.





More information about the antlr-interest mailing list