I've tried looking for answers to my solution but I can't seem to wrap my head around the generalized solutions. It doesn't help that I can't figure out which of my elements map to capital letters and which are supposed to be represented by small letters.
This is part of my grammar in Antlr:
expression
: literal
| unaryExpression
| binaryExpression
| priorityExpression
| invocation
;
binaryExpression: expression binaryOperator expression;
binaryOperator
: ADD
| SUBTRACT
| DIVIDE
| CONCAT
| EQUALS
| NOT_EQUALS
| LESS_THAN
| GREATER_THAN
| MULTIPLY
;
How would I go about removing the recursion in binaryExpression
?