[antlr-interest] Converting Tree operands ('^' '!') to rewrite rules ( '-> ^(...)')

Gavin Lambert antlr at mirality.co.nz
Fri Jul 11 03:06:30 PDT 2008


At 21:34 11/07/2008, Jens Boeykens wrote:
>Bounced on a problem:
>
>What should be the rewrite rule for this operand rule:
>rule   :    id ('+'^ id)*;

IIRC:

rule
   :  (a=id -> $a)
      ('+' b=id -> ^('+' $rule $b))*
   ;



More information about the antlr-interest mailing list