I use ANTLR (3.2) to parse a fairly simple grammar. Unfortunately, I ran into a little problem. Follow the following rule:
exp : NUM | '(' expression OPERATOR expression ')' -> expression+ | '(' (MINUS | '!') expression ')' -> expression ;
The OPERATOR contains the same minus sign ('-') as for MINUS. Now ANTLR does not seem to cope with these two rules. If I delete one, everything will be fine.
Any ideas?
binary operator-keyword antlr
Christian
source share