ANTLRErrorListener.reportAmbiguity

This method is called by the parser when a full-context prediction results in an ambiguity.

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

<p>When {@code ambigAlts} is not null, it contains the set of potentially viable alternatives identified by the prediction algorithm. When {@code ambigAlts} is null, use {@link ATNConfigSet#getAlts} to obtain the represented alternatives from the {@code configs} argument.</p>

<p>When {@code exact} is {@code true}, <em>all</em> of the potentially viable alternatives are truly viable, i.e. this is reporting an exact ambiguity. When {@code exact} is {@code false}, <em>at least two</em> of the potentially viable alternatives are viable for the current input, but the prediction algorithm terminated as soon as it determined that at least the <em>minimum</em> potentially viable alternative is truly viable.</p>

<p>When the {@link PredictionMode#LL_EXACT_AMBIG_DETECTION} prediction mode is used, the parser is required to identify exact ambiguities so {@code exact} will always be {@code true}.</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 input where the ambiguity was identified @param exact {@code true} if the ambiguity is exactly known, otherwise {@code false}. This is always {@code true} when {@link PredictionMode#LL_EXACT_AMBIG_DETECTION} is used. @param ambigAlts the potentially ambiguous alternatives, or {@code null} to indicate that the potentially ambiguous alternatives are the complete set of represented alternatives in {@code configs} @param configs the ATN configuration set where the ambiguity was identified

interface ANTLRErrorListener
void
reportAmbiguity

Meta