[antlr-interest] Tree grammar for 'zero or more' rewrite

Terence Parr parrt at cs.usfca.edu
Wed Jul 11 16:00:21 PDT 2007


On Jul 11, 2007, at 3:44 PM, Ted Villalba wrote:

> Hi,
>
> I'm trying to write the tree grammar that will recognize the output  
> from the following rewrite rule:
>
> value   : (terms-> ^(TERMS terms)) ((WS)+ operator (WS)+ v=value ->  
> ^(operator $value ^(VALUE $v)))*

Can you draw the empty, one term, then two term case for me?

The tree seems a bit weird to me.  I think i can simplify the grammar  
for me if you show me your intentions.

Ter



More information about the antlr-interest mailing list