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[]parentsParent can be null only if full ctx mode and we make an array from#EMPTYand non-empty.int[]returnStatesSorted for merge, no duplicates; if present,PredictionContext.EMPTY_RETURN_STATEis always last.-
Fields inherited from class org.antlr.v4.runtime.atn.PredictionContext
cachedHashCode, EMPTY_RETURN_STATE, 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 booleanequals(Object o)PredictionContextgetParent(int index)intgetReturnState(int index)booleanisEmpty()This means only theEmptyPredictionContext.Instance(wildcard? not sure) context is in set.intsize()StringtoString()-
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 from#EMPTYand non-empty. We merge#EMPTYby using null parent and returnState ==PredictionContext.EMPTY_RETURN_STATE.
-
returnStates
public final int[] returnStates
Sorted for merge, no duplicates; if present,PredictionContext.EMPTY_RETURN_STATEis 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:PredictionContextThis means only theEmptyPredictionContext.Instance(wildcard? not sure) context is in set.- Overrides:
isEmptyin classPredictionContext
-
size
public int size()
- Specified by:
sizein classPredictionContext
-
getParent
public PredictionContext getParent(int index)
- Specified by:
getParentin classPredictionContext
-
getReturnState
public int getReturnState(int index)
- Specified by:
getReturnStatein classPredictionContext
-
equals
public boolean equals(Object o)
- Specified by:
equalsin classPredictionContext
-
-