PredictionContext

TODO add class description

abstract
class PredictionContext {}

Constructors

this
this()
Undocumented in source.
this
this(size_t cachedHashCode)
Undocumented in source.

Members

Functions

calculateHashCode
size_t calculateHashCode(PredictionContext parent, int returnState)
Undocumented in source. Be warned that the author may not have intended to support it.
getParent
PredictionContext getParent(int index)
Undocumented in source.
getReturnState
int getReturnState(int index)
Undocumented in source.
hasEmptyPath
bool hasEmptyPath()
Undocumented in source. Be warned that the author may not have intended to support it.
isEmpty
bool isEmpty()

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

opEquals
bool opEquals(Object obj)

@uml @override

size
size_t size()
Undocumented in source.
toHash
size_t toHash()

@uml @safe @nothrow @override

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.

Static functions

calculateEmptyHashCode
size_t calculateEmptyHashCode()
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.
combineCommonParents
void combineCommonParents(PredictionContext[] parents)

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

fromRuleContext
PredictionContext fromRuleContext(ATN atn, RuleContext outerContext)
Undocumented in source. Be warned that the author may not have intended to support it.
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.
getCachedContext
PredictionContext getCachedContext(PredictionContext context, PredictionContextCache contextCache, PredictionContext[PredictionContext] visited)

ref visited ?

merge
PredictionContext merge(PredictionContext a, PredictionContext b, bool rootIsWildcard, DoubleKeyMap!(PredictionContext, PredictionContext, PredictionContext) mergeCache)
Undocumented in source.
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>

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}.

mergeSingletons
PredictionContext mergeSingletons(SingletonPredictionContext a, SingletonPredictionContext b, bool rootIsWildcard, DoubleKeyMap!(PredictionContext, PredictionContext, PredictionContext) mergeCache)

@uml Merge two {@link SingletonPredictionContext} instances.

toDOTString
string toDOTString(PredictionContext context)
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

EMPTY
EmptyPredictionContext EMPTY;

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

EMPTY_RETURN_STATE
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}.

globalNodeCount
int globalNodeCount;

@uml @shared

Variables

id
int id;
Undocumented in source.

Meta