I have been hacking away at my ANTLR4 grammar trying to eliminate all of its ambiguities, lexer rule error at a time. Nothing I seem to do fixes the problems. These lexer rules in particular that give me the same error are as follows:
Identifier: Letter (Letter | Digit | Und)+;
Keyword : Letter+;
Param: Number | Identifier;
Statement: Keyword Lpr Param+ Rpr;
Block: Lbc Statement+ Rbc;
As you might have noticed, one token they all have in common is Letter. This and other tokens are defined as:
fragment Digit: '0'..'9';
fragment Letter: ('A'..'Z');
Und: '_';
Lpr: '(';
Rpr: ')';
I can't find how this could cause an ambiguity, unless ANTLR doesn't allow for multiple definition with potentially identical outcomes.