Solving ANTLR Mutually left-recursive rules
the 'expr' rule in the ANTLR grammar below obviously mutually left-recursive. As a ANTLR newbie it's difficult to get my head around solving this. I've read "Resolving Non-LL(*) Conflicts" in the ANTLR reference book, but I still don't see the solution. Any pointers? LPAREN : ( '(' ) ; RPAREN : ( ')' ); AND : ( 'AND' | '&' | 'EN' ) ; OR : ( 'OR' | '|' | 'OF' ); NOT : ('-' | 'NOT' | 'NIET' ); WS : ( ' ' | '\t' | '\r' | '\n' ) {$channel=HIDDEN;} ; WORD : (~( ' ' | '\t' | '\r' | '\n' | '(' | ')' | '"' ))*; input : expr EOF; expr : (andexpr | orexpr | notexpr | atom); andexpr : expr AND expr;