assumes left unless you say otherwise:

e: e '.'^ ID
  | '-'^ e
  | e '^'<assoc=right>^ e
  | e '*'^ e
  | e ('+'^|'-'^) e
  | e ('='<assoc=right>^ |'+='<assoc=right>^) e
  | INT
  | ID
  ;

All operators at the same precedence level must have the same associativity;  
it's   nonoptimal to have to say it on each operator, but there is no existing 
syntax that would let me say "right associativity for this alternative".

some examples examples of the associativity

a^b^c           -> (^ a (^ b c))
a=b=c           -> (= a (= b c))
a=b=c+d.e       -> (= a (= b (+ c (. d e))))

Ter
PS: woot!


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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to