I've a grammar as follow:
expression : scalar
| vector;
scalar : <bunch of rules>
| vector[scalar] #VectorIndex
;
vector : <bunch of rules>
| scalar ('*' | '+' | '-') vector
;
Is there any possibility to remove indirect left recursion from this grammar? Replacing vector
with all its sub-rules will make the grammar too repetitive and messy.