DefaultErrorStrategy.reportUnwantedToken

This method is called to report a syntax error which requires the removal of a token from the input stream. At the time this method is called, the erroneous symbol is current {@code LT(1)} symbol and has not yet been removed from the input stream. When this method returns, {@code recognizer} is in error recovery mode.

<p>This method is called when {@link #singleTokenDeletion} identifies single-token deletion as a viable recovery strategy for a mismatched input error.</p>

<p>The default implementation simply returns if the handler is already in error recovery mode. Otherwise, it calls {@link #beginErrorCondition} to enter error recovery mode, followed by calling {@link Parser#notifyErrorListeners}.</p>

@param recognizer the parser instance

class DefaultErrorStrategy
protected
void
reportUnwantedToken

Meta