Package org.antlr.v4.runtime.atn
Class ArrayPredictionContext
- java.lang.Object
-
- org.antlr.v4.runtime.atn.PredictionContext
-
- org.antlr.v4.runtime.atn.ArrayPredictionContext
-
public class ArrayPredictionContext extends PredictionContext
-
-
Field Summary
Fields Modifier and Type Field Description PredictionContext[]
parents
Parent can be null only if full ctx mode and we make an array fromPredictionContext.EMPTY
and non-empty.int[]
returnStates
Sorted for merge, no duplicates; if present,PredictionContext.EMPTY_RETURN_STATE
is always last.-
Fields inherited from class org.antlr.v4.runtime.atn.PredictionContext
cachedHashCode, EMPTY, EMPTY_RETURN_STATE, globalNodeCount, id
-
-
Constructor Summary
Constructors Constructor Description ArrayPredictionContext(PredictionContext[] parents, int[] returnStates)
ArrayPredictionContext(SingletonPredictionContext a)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
PredictionContext
getParent(int index)
int
getReturnState(int index)
boolean
isEmpty()
This means only thePredictionContext.EMPTY
(wildcard? not sure) context is in set.int
size()
String
toString()
-
Methods inherited from class org.antlr.v4.runtime.atn.PredictionContext
calculateEmptyHashCode, calculateHashCode, calculateHashCode, combineCommonParents, fromRuleContext, getAllContextNodes, getAllContextNodes_, getCachedContext, hasEmptyPath, hashCode, merge, mergeArrays, mergeRoot, mergeSingletons, toDOTString, toString, toStrings, toStrings
-
-
-
-
Field Detail
-
parents
public final PredictionContext[] parents
Parent can be null only if full ctx mode and we make an array fromPredictionContext.EMPTY
and non-empty. We mergePredictionContext.EMPTY
by using null parent and returnState ==PredictionContext.EMPTY_RETURN_STATE
.
-
returnStates
public final int[] returnStates
Sorted for merge, no duplicates; if present,PredictionContext.EMPTY_RETURN_STATE
is always last.
-
-
Constructor Detail
-
ArrayPredictionContext
public ArrayPredictionContext(SingletonPredictionContext a)
-
ArrayPredictionContext
public ArrayPredictionContext(PredictionContext[] parents, int[] returnStates)
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
Description copied from class:PredictionContext
This means only thePredictionContext.EMPTY
(wildcard? not sure) context is in set.- Overrides:
isEmpty
in classPredictionContext
-
size
public int size()
- Specified by:
size
in classPredictionContext
-
getParent
public PredictionContext getParent(int index)
- Specified by:
getParent
in classPredictionContext
-
getReturnState
public int getReturnState(int index)
- Specified by:
getReturnState
in classPredictionContext
-
equals
public boolean equals(Object o)
- Specified by:
equals
in classPredictionContext
-
-