Package org.antlr.v4.runtime.atn
Class PredictionContextCache
java.lang.Object
org.antlr.v4.runtime.atn.PredictionContextCache
Used to cache
PredictionContext objects. Its used for the shared
context cash associated with contexts in DFA states. This cache
can be used for both lexers and parsers.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classprotected static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<PredictionContextCache.PredictionContextAndInt, PredictionContext> private final Map<PredictionContext, PredictionContext> private final booleanprivate final Map<PredictionContextCache.IdentityCommutativePredictionContextOperands, PredictionContext> static final PredictionContextCache -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAsCached(PredictionContext context) getChild(PredictionContext context, int invokingState)
-
Field Details
-
UNCACHED
-
contexts
-
childContexts
-
joinContexts
private final Map<PredictionContextCache.IdentityCommutativePredictionContextOperands,PredictionContext> joinContexts -
enableCache
private final boolean enableCache
-
-
Constructor Details
-
PredictionContextCache
public PredictionContextCache() -
PredictionContextCache
private PredictionContextCache(boolean enableCache)
-
-
Method Details
-
getAsCached
-
getChild
-
join
-