Not sure WHY you would want that buy it is just:

p+=primary (AND p+=primary)* -> ^(AND $p+)

Jim

On Jul 19, 2009, at 7:04 AM, hakan eryargi <hakan.erya...@gmail.com>  
wrote:

> hello,
>
> below is the main part of my grammar. it's ok but it creates an AST
> from expression
>
> a & b & c  -> (& (& a b) c) : an AND node with children c and another
> AND node with children a and b
>
> but i want: (& a b c) : an AND node with tree children
>
> how can i make that with a rewrite rule ?
>
> i've found following post in mail list but didnt helped me much :/
> http://markmail.org/message/ed3ncmfimu3xnczt
>
> program :
>    expression EOF!
>    ;
>
> expression
>    : primary ((AND^ primary)+ | (OR^ primary)+)?
>    ;
>
> primary    :
>    VARIABLE
>    | LPAREN! expression RPAREN!
>    ;
>
> thanks,
> hakan
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: 
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-interest@googlegroups.com
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to