Class AtnManager.AtnWrapper
java.lang.Object
org.apache.groovy.parser.antlr4.internal.atnmanager.AtnManager.AtnWrapper
- Enclosing class:
- AtnManager
One ATN and the counters that decide when to retire it.
The manager holds the wrapper in a
SoftReference. Replacement
publishes another wrapper; this instance and its ATN are left as they are
so parses already using them can finish.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.antlr.v4.runtime.atn.ATNReturns this wrapper's ATN.
-
Constructor Details
-
AtnWrapper
public AtnWrapper(org.antlr.v4.runtime.atn.ATN atn) Retainsatn. The parse counter starts at zero and the retirement flag starts clear.- Parameters:
atn- the ATN whose decision DFAs this wrapper owns
-
-
Method Details
-
checkAndReplace
public org.antlr.v4.runtime.atn.ATN checkAndReplace()Returns this wrapper's ATN. When dropping is off, that is all this does. When the parse-counter threshold is positive, the counter is incremented and a multiple of the threshold retires this wrapper before the size check. When the DFA-state ceiling is enabled and the summedstates.size()of the decision DFAs is over it, one thread retires this wrapper; the flag is not cleared, so a later call does not retire it again. Retirement publishes a new wrapper for a laterAtnManager.getATN(). This call still returnsatn.- Returns:
- this wrapper's ATN
-