ArrayPredictionContext

Array of prediction contexts

Constructors

this
this(SingletonPredictionContext a)
Undocumented in source.
this
this(PredictionContext[] parents, int[] returnStates)
Undocumented in source.

Members

Functions

getParent
PredictionContext getParent(int index)

@uml @override

getReturnState
int getReturnState(int index)

@uml @override

isEmpty
bool isEmpty()

@uml @override

opEquals
bool opEquals(Object o)

@uml @override

size
size_t size()

@uml @override

toString
string toString()

@uml @override

Variables

parents
PredictionContext[] parents;

Parent can be null only if full ctx mode and we make an array from {@link #EMPTY} and non-empty. We merge {@link #EMPTY} by using null parent and returnState == {@link #EMPTY_RETURN_STATE}.

returnStates
int[] returnStates;

Sorted for merge, no duplicates; if present, {@link #EMPTY_RETURN_STATE} is always last. @uml @final

Inherited Members

From PredictionContext

EMPTY
EmptyPredictionContext EMPTY;

Represents {@code $} in local context prediction, which means wildcard. {@code *+x = *}.

EMPTY_RETURN_STATE
enum int EMPTY_RETURN_STATE;

Represents {@code $} in an array in full context mode, when {@code $} doesn't mean wildcard: {@code $ + x = [$,x]}. Here, {@code $} = {@link #EMPTY_RETURN_STATE}.

INITIAL_HASH
enum int INITIAL_HASH;
Undocumented in source.
globalNodeCount
int globalNodeCount;

@uml @shared

id
int id;
Undocumented in source.
fromRuleContext
PredictionContext fromRuleContext(ATN atn, RuleContext outerContext)
Undocumented in source. Be warned that the author may not have intended to support it.
size
size_t size()
Undocumented in source.
getParent
PredictionContext getParent(int index)
Undocumented in source.
getReturnState
int getReturnState(int index)
Undocumented in source.
isEmpty
bool isEmpty()

@uml This means only the {@link #EMPTY} context is in set.

hasEmptyPath
bool hasEmptyPath()
Undocumented in source. Be warned that the author may not have intended to support it.
toHash
size_t toHash()

@uml @safe @nothrow @override

opEquals
bool opEquals(Object obj)

@uml @override

calculateEmptyHashCode
size_t calculateEmptyHashCode()
Undocumented in source. Be warned that the author may not have intended to support it.
calculateHashCode
size_t calculateHashCode(PredictionContext parent, int returnState)
Undocumented in source. Be warned that the author may not have intended to support it.
calculateHashCode
size_t calculateHashCode(PredictionContext[] parents, int[] returnStates)
Undocumented in source. Be warned that the author may not have intended to support it.
merge
PredictionContext merge(PredictionContext a, PredictionContext b, bool rootIsWildcard, DoubleKeyMap!(PredictionContext, PredictionContext, PredictionContext) mergeCache)
Undocumented in source.
mergeSingletons
PredictionContext mergeSingletons(SingletonPredictionContext a, SingletonPredictionContext b, bool rootIsWildcard, DoubleKeyMap!(PredictionContext, PredictionContext, PredictionContext) mergeCache)

@uml Merge two {@link SingletonPredictionContext} instances.

mergeRoot
PredictionContext mergeRoot(SingletonPredictionContext a, SingletonPredictionContext b, bool rootIsWildcard)

Handle case where at least one of {@code a} or {@code b} is {@link #EMPTY}. In the following diagrams, the symbol {@code $} is used to represent {@link #EMPTY}.

mergeArrays
PredictionContext mergeArrays(ArrayPredictionContext a, ArrayPredictionContext b, bool rootIsWildcard, DoubleKeyMap!(PredictionContext, PredictionContext, PredictionContext) mergeCache)

Merge two {@link ArrayPredictionContext} instances. * <p>Different tops, different parents.<br> <embed src="images/ArrayMerge_DiffTopDiffPar.svg" type="image/svg+xml"/></p>

combineCommonParents
void combineCommonParents(PredictionContext[] parents)

Make pass over all <em>M</em> {@code parents}; merge any {@code equals()} ones.

toDOTString
string toDOTString(PredictionContext context)
Undocumented in source. Be warned that the author may not have intended to support it.
getCachedContext
PredictionContext getCachedContext(PredictionContext context, PredictionContextCache contextCache, PredictionContext[PredictionContext] visited)

ref visited ?

getAllContextNodes
PredictionContext[] getAllContextNodes(PredictionContext context)

recursive version of Sam's getAllNodes()

getAllContextNodes_
void getAllContextNodes_(PredictionContext context, PredictionContext[] nodes, PredictionContext[PredictionContext] visited)
Undocumented in source. Be warned that the author may not have intended to support it.
toStrings
string[] toStrings(InterfaceRecognizer recognizer, int currentState)
Undocumented in source. Be warned that the author may not have intended to support it.
toStrings
string[] toStrings(InterfaceRecognizer recognizer, PredictionContext stop, int currentState)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta