public abstract class PredictionContext extends Object implements Iterable<SingletonPredictionContext>, Comparable<PredictionContext>
| Modifier and Type | Field and Description |
|---|---|
int |
cachedHashCode |
static EmptyPredictionContext |
EMPTY
Represents $ in local ctx prediction, which means wildcard.
|
static int |
EMPTY_RETURN_STATE
Represents $ in an array in full ctx mode, when $ doesn't mean wildcard:
$ + x = [$,x].
|
static int |
globalNodeCount |
int |
id |
| Modifier | Constructor and Description |
|---|---|
protected |
PredictionContext(int cachedHashCode) |
public static final EmptyPredictionContext EMPTY
public static final int EMPTY_RETURN_STATE
public static int globalNodeCount
public final int id
public final int cachedHashCode
public static PredictionContext fromRuleContext(@NotNull ATN atn, RuleContext outerContext)
public abstract Iterator<SingletonPredictionContext> iterator()
iterator in interface Iterable<SingletonPredictionContext>public abstract int size()
public abstract PredictionContext getParent(int index)
public abstract int getReturnState(int index)
public boolean isEmpty()
public boolean hasEmptyPath()
public int compareTo(PredictionContext o)
compareTo in interface Comparable<PredictionContext>protected static int calculateHashCode(int parentHashCode,
int returnStateHashCode)
public static PredictionContext merge(PredictionContext a, PredictionContext b, boolean rootIsWildcard, DoubleKeyMap<PredictionContext,PredictionContext,PredictionContext> mergeCache)
public static PredictionContext mergeSingletons(SingletonPredictionContext a, SingletonPredictionContext b, boolean rootIsWildcard, DoubleKeyMap<PredictionContext,PredictionContext,PredictionContext> mergeCache)
public static PredictionContext mergeRoot(SingletonPredictionContext a, SingletonPredictionContext b, boolean rootIsWildcard)
public static PredictionContext mergeArrays(ArrayPredictionContext a, ArrayPredictionContext b, boolean rootIsWildcard, DoubleKeyMap<PredictionContext,PredictionContext,PredictionContext> mergeCache)
protected static void combineCommonParents(PredictionContext[] parents)
public static String toDOTString(PredictionContext context)
public static PredictionContext getCachedContext(@NotNull PredictionContext context, @NotNull PredictionContextCache contextCache, @NotNull IdentityHashMap<PredictionContext,PredictionContext> visited)
public static List<PredictionContext> getAllContextNodes(PredictionContext context)
public static void getAllContextNodes_(PredictionContext context, List<PredictionContext> nodes, Map<PredictionContext,PredictionContext> visited)
public String toString(@Nullable Recognizer<?,?> recog)
public String toString(@Nullable Recognizer<?,?> recog, RuleContext stop)
public String[] toStrings(Recognizer<?,?> recognizer, int currentState)
public String[] toStrings(Recognizer<?,?> recognizer, PredictionContext stop, int currentState)
Copyright © 2012. All Rights Reserved.