[antlr-interest] rewrite rule element cardinality

Gavin Lambert antlr at mirality.co.nz
Tue Feb 23 12:21:55 PST 2010


At 08:40 24/02/2010, joestelmach at gmail.com wrote:
 >search
 >: c (SPACE option)+ -> ^(GROUP c option)+
 >;

Worth trying, just to see if it behaves differently:

search
   : c (SPACE o+=option)+ -> ^(GROUP c $o)+
   ;


Possible workaround:

search
   : a=c (coption[$a])+
   ;

coption[CommonTree c]
   : SPACE option -> ^(GROUP $c option)
   ;



More information about the antlr-interest mailing list