I have two inputs
a - b
a += b
And I have a production with a choice
void AssignmentExpression() : {}
{
LOOKAHEAD(3) ConditionalExpression()
| LOOKAHEAD(3) UnaryExpression() AssignmentOperator() AssignmentExpression()
}
With this production input (1) works, but input (2) does not work.
If I swap the choice in the production so that it becomes
void AssignmentExpression() : {}
{
LOOKAHEAD(3) UnaryExpression() AssignmentOperator() AssignmentExpression()
| LOOKAHEAD(3) ConditionalExpression()
}
Then input (2) works, but input (1) does not work.
How do I fix this? Increasing the LOOKAHEAD parameter does not help.