PredictionContext class abstract

Implementers

Constructors

PredictionContext(int cachedHashCode)

Properties

cachedHashCode int
Stores the computed hash code of this PredictionContext. The hash code is computed in parts to match the following reference algorithm.
final
hashCode int
The hash code for this object.
no setteroverride
id int
getter/setter pair
isEmpty bool
This means only the {@link #EMPTY} (wildcard? not sure) context is in set.
no setter
length int
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getParent(int index) PredictionContext?
getReturnState(int index) int
hasEmptyPath() bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
toStrings(Recognizer<ATNSimulator>? recognizer, PredictionContext stop, int currentState) List<String>

Operators

operator ==(Object obj) bool
The equality operator.
override

Static Properties

EMPTY_RETURN_STATE int
Represents {@code $} in an array in full context mode, when {@code $} doesn't mean wildcard: {@code $ + x = $,x}. Here, {@code $} = {@link #EMPTY_RETURN_STATE}.
final
globalNodeCount int
getter/setter pair
INITIAL_HASH int
final

Static Methods

calculateEmptyHashCode() int
calculateHashCode(List<PredictionContext?> parents, List<int> returnStates) int
combineCommonParents(List<PredictionContext?> parents) → void
Make pass over all M parents; merge any {@code equals()} ones.
fromRuleContext(ATN atn, RuleContext? outerContext) PredictionContext
Convert a RuleContext tree to a PredictionContext graph. Return {@link #EMPTY} if outerContext is empty or null.
getAllContextNodes(PredictionContext context) List<PredictionContext>
getAllContextNodes_(PredictionContext? context, List<PredictionContext> nodes, Map<PredictionContext, PredictionContext> visited) → void
getCachedContext(PredictionContext context, PredictionContextCache contextCache, Map<PredictionContext, PredictionContext> visited) PredictionContext
merge(PredictionContext a, PredictionContext b, bool rootIsWildcard, Map<Pair<PredictionContext, PredictionContext>, PredictionContext>? mergeCache) PredictionContext
mergeArrays(ArrayPredictionContext a, ArrayPredictionContext b, bool rootIsWildcard, Map<Pair<PredictionContext, PredictionContext>, PredictionContext>? mergeCache) PredictionContext
Merge two ArrayPredictionContext instances.
mergeRoot(SingletonPredictionContext a, SingletonPredictionContext b, bool rootIsWildcard) PredictionContext?
Handle case where at least one of a or b is {@link #EMPTY}. In the following diagrams, the symbol {@code $} is used to represent {@link #EMPTY}.
mergeSingletons(SingletonPredictionContext a, SingletonPredictionContext b, bool rootIsWildcard, Map<Pair<PredictionContext, PredictionContext>, PredictionContext>? mergeCache) PredictionContext
Merge two SingletonPredictionContext instances.
toDOTString(PredictionContext? context) String