ANTLRErrorListener.reportContextSensitivity

This method is called by the parser when a full-context prediction has a unique result.

<p>Each full-context prediction which does not result in a syntax error will call either {@link #reportContextSensitivity} or {@link #reportAmbiguity}.</p>

<p>For prediction implementations that only evaluate full-context predictions when an SLL conflict is found (including the default {@link ParserATNSimulator} implementation), this method reports cases where SLL conflicts were resolved to unique full-context predictions, i.e. the decision was context-sensitive. This report does not necessarily indicate a problem, and it may appear even in completely unambiguous grammars.</p>

<p>{@code configs} may have more than one represented alternative if the full-context prediction algorithm does not evaluate predicates before beginning the full-context prediction. In all cases, the final prediction is passed as the {@code prediction} argument.</p>

<p>Note that the definition of "context sensitivity" in this method differs from the concept in {@link DecisionInfo#contextSensitivities}. This method reports all instances where an SLL conflict occurred but LL parsing produced a unique result, whether or not that unique result matches the minimum alternative in the SLL conflicting set.</p>

<p>This method is not used by lexers.</p>

@param recognizer the parser instance @param dfa the DFA for the current decision @param startIndex the input index where the decision started @param stopIndex the input index where the context sensitivity was finally determined @param prediction the unambiguous result of the full-context prediction @param configs the ATN configuration set where the unambiguous prediction was determined

interface ANTLRErrorListener
void
reportContextSensitivity

Meta