[antlr-interest] Operator tree construction in rewrite syntax

Guntis Ozols guntiso at latnet.lv
Mon Apr 14 13:15:13 PDT 2008


> i apologize...i meant there to be a zero-or-more:
>
> sum: something (Plus^ something)*;

Right side stays the same, i.e. with '+',
because smth smth* is the same as smth+.

>
> Thanks
>
> -----Original Message-----
> From: Guntis Ozols <guntiso at latnet.lv>
> To: Marko Simovic <markobarko at gmail.com>
> Cc: antlr-interest <antlr-interest at antlr.org>
> Subject: Re: [antlr-interest] Operator tree construction in rewrite
> syntax
> Date: Mon, 14 Apr 2008 23:00:45 +0300
>
>
> > Quick question (i hope). What is the equivalent to the following using
> > the rewrite (->) syntax:
> >
> > sum: something (Plus^ something);
> >
> > Thanks,
> > Marko
>
> 1. try: something (Plus something) -> ^(Plus something+);
>
> 2. how about '*', did you mean: something (Plus^ something)*; ?
>
> 3. do not use ^ on both sides
>
> Guntis




More information about the antlr-interest mailing list