I'm getting this famous error
rule has non-LL(*) decision due to recursive rule invocations
for following simple grammar.
expr
: INTEGER
| '(' expr '+' expr ')'
;
bool_expr
: '(' bool_expr 'and' bool_expr ')'
| '(' expr '<' expr ')'
;
INTEGER
: '0'..'9'+
;
WS
: (' ' | '\t' | ('\r')? '\n')+ {$channel = HIDDEN; }
;
I already went through following answers which were no help.
This Question : I don't want to combine the mathematical expressions and boolean expression into one, so I don't have to verify it via AST. I'm trying to keep these two expression separately.
This Question The Wikipedia is not helping me to understand this specific situation. And I don't think I can simplify this grammar than this.
This Question Here I think we have a different situation.
I can't understand what is the left recursion here. I don't see any A-->Ab|b
or something like that. Can anyone please help me to solve this.
Please note following.
- I don't have operator precedence, I always use parenthesis
- I don't want to combine two types of expressions
- If anyone interested, this works correctly with ANTLR4