AmbiguityInfo class

This class represents profiling event information for an ambiguity. Ambiguities are decisions where a particular input resulted in an SLL conflict, followed by LL prediction also reaching a conflict state (indicating a true ambiguity in the grammar).

This event may be reported during SLL prediction in cases where the conflicting SLL configuration set provides sufficient information to determine that the SLL conflict is truly an ambiguity. For example, if none of the ATN configurations in the conflicting SLL configuration set have traversed a global follow transition (i.e. {@link ATNConfig#reachesIntoOuterContext} is 0 for all configurations), then the result of SLL prediction for that input is known to be equivalent to the result of LL prediction for that input.

In some cases, the minimum represented alternative in the conflicting LL configuration set is not equal to the minimum represented alternative in the conflicting SLL configuration set. Grammars and inputs which result in this scenario are unable to use {@link PredictionMode#SLL}, which in turn means they cannot use the two-stage parsing strategy to improve parsing performance for that input.

@see ParserATNSimulator#reportAmbiguity @see ANTLRErrorListener#reportAmbiguity

@since 4.3

Inheritance

Constructors

AmbiguityInfo(int decision, ATNConfigSet configs, BitSet? ambigAlts, TokenStream input, int startIndex, int stopIndex, bool fullCtx)
Constructs a new instance of the AmbiguityInfo class with the specified detailed ambiguity information.

Properties

ambigAlts ↔ BitSet?
The set of alternative numbers for this decision event that lead to a valid parse. */
getter/setter pair
configs ATNConfigSet?
The configuration set containing additional information relevant to the prediction state when the current event occurred, or null if no additional information is relevant or available.
finalinherited
decision int
The invoked decision number which this event is related to.
finalinherited
fullCtx bool
true if the current event occurred during LL prediction; otherwise, false if the input occurred during SLL prediction.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
input TokenStream
The input token stream which is being parsed.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startIndex int
The token index in the input stream at which the current prediction was originally invoked.
finalinherited
stopIndex int
The token index in the input stream at which the current event occurred.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited