reportInputMismatch method

void reportInputMismatch(
  1. Parser recognizer,
  2. InputMismatchException e
)

This is called by {@link #reportError} when the exception is an InputMismatchException.

@see #reportError

@param recognizer the parser instance @param e the recognition exception

Implementation

void reportInputMismatch(Parser recognizer, InputMismatchException e) {
  final msg = 'mismatched input ' +
      getTokenErrorDisplay(e.offendingToken) +
      ' expecting ' +
      e.expectedTokens!.toString(vocabulary: recognizer.vocabulary);
  recognizer.notifyErrorListeners(msg, e.offendingToken, e);
}