[antlr-interest] tree walking

Terence Parr parrt at cs.usfca.edu
Thu Jul 9 11:39:36 PDT 2009


Hi Andrew, I'm pretty sure it does. TDAR not LDP, that is.

expr : ^('+' expr expr) | INT ;

is what you want in the tree grammar.
Ter
On Jul 9, 2009, at 4:49 AM, Andrew Walker wrote:

> Hi!
> How in the tree grammar can I match the expression like this one:
> expr : (INT -> INT) ('+' i=INT -> ^('+' $expr $i) )* ;
> or this one:
> expr : INT ('+' ^ INT)* ;
>
> I've look through the book but it doesn't cover this part.
>
> Cheers,
> Andrew
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list