Every solution I found on SO was "switch to ANTLR4" which isn't really an option because I am using antlr4ruby
(which is ANTLR3, the 4 is meant as "for").
I want to build a rule for property access, it should match something like this:
variable
variable.property
variable.prop.prop
etc.
here's what I have:
variable: NAME -> ^(VARIABLE NAME) | variable DOT NAME -> ^(ACCESS variable NAME);
(VARIABLE
and ACCESS
are parser tokens for use later, NAME
is a kind of string).
This is obviously left-recursive, but I have no idea how to fix this.