Class ReachComputation

java.lang.Object
org.antlr.v4.runtime.atn.ReachComputation

final class ReachComputation extends Object
Package-private reach / target-state engine for adaptive LL(*) prediction.

Owns the retained reach and intermediate ATNConfigSets plus the ReachConfigSource view used by a single ParserATNSimulator.computeTargetState(org.antlr.v4.runtime.dfa.DFA, org.antlr.v4.runtime.dfa.DFAState, org.antlr.v4.runtime.ParserRuleContext, int, boolean, org.antlr.v4.runtime.atn.PredictionContextCache) invocation. Extracted so ParserATNSimulator stays focused on adaptivePredict / DFA orchestration while allocation and release policy for edge computation live in one place.

Ownership: one instance per ParserATNSimulator. A simulator is used by one parser thread at a time during prediction, so retained scratch is not shared across threads. Each computeTargetState(org.antlr.v4.runtime.dfa.DFA, org.antlr.v4.runtime.dfa.DFAState, org.antlr.v4.runtime.ParserRuleContext, int, boolean, org.antlr.v4.runtime.atn.PredictionContextCache) binds scratch inside try/finally and always releases after the edge is cloned into the DFA.

Not part of any public or protected API.