reportNoViableAlternative method
This is called by {@link #reportError} when the exception is a NoViableAltException.
@see #reportError
@param recognizer the parser instance @param e the recognition exception
Implementation
void reportNoViableAlternative(Parser recognizer, NoViableAltException e) {
final tokens = recognizer.inputStream;
String input;
if (e.startToken.type == Token.EOF) {
input = '<EOF>';
} else {
input = tokens.getTextRange(e.startToken, e.offendingToken);
}
final msg = 'no viable alternative at input ' + escapeWSAndQuote(input);
recognizer.notifyErrorListeners(msg, e.offendingToken, e);
}