[antlr-interest] Syntactic predicate for additive Expression

e_mani9 e_mani9 at yahoo.co.in
Fri Apr 16 06:46:34 PDT 2004


hi,
  I had conflict between additive expression and unary expression, 
so i used syntactic predicate to fix it. Now the additive expression 
works with right associativity, i would like it to work with left 
associativiy.
My grammer is :

AddExpr : (MulExpr (ADD | SUB))=>
           MulExpr (ADD | SUB) AddExpr
           | MulExpr ;

MulExpr : UnaryExpr (( MUL | DIV) UnaryExpr)* ;

UnaryExpr : (ADD | SUB) UnaryExpr
            | PowerExpr ;

Can anybody suggest "how to fix the associativity" or a new grammer 
for additive expression.

-- mani




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list