With ANTLR 4.6, snapshot of 11/23/2016.
I have two rules which are each left-recursive. I expanded several of the alternatives to expose the left recursion. ANTLR4 handles this, because the left recursion is explicit. However, the two rules are also mutually left-recursive.
How do I resolve the mutual left recursion AND do so so that the rules aren't a total mess? Right now I have nice comments showing what was expanded, and I moved that to primary2 and constant_primary2 which aren't involved in the mutual left recursion.
constant_primary :
constant_primary2
| primary '.' method_call_body
| constant_primary '\'' '(' constant_expr ')'
;
primary :
primary2
| primary '.' method_call_body
| constant_primary '\'' '(' expr ')'
;