DefaultErrorStrategy.singleTokenInsertion

This method implements the single-token insertion inline error recovery strategy. It is called by {@link #recoverInline} if the single-token deletion strategy fails to recover from the mismatched input. If this method returns {@code true}, {@code recognizer} will be in error recovery mode.

<p>This method determines whether or not single-token insertion is viable by checking if the {@code LA(1)} input symbol could be successfully matched if it were instead the {@code LA(2)} symbol. If this method returns {@code true}, the caller is responsible for creating and inserting a token with the correct type to produce this behavior.</p>

@param recognizer the parser instance @return {@code true} if single-token insertion is a viable recovery strategy for the current mismatched input, otherwise {@code false}

class DefaultErrorStrategy
protected
bool
singleTokenInsertion

Meta