Class ReachConfigSource

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

final class ReachConfigSource extends Object
Random-access view of ATN configurations for 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.

Starts as a zero-allocation view over the source ATNConfigSet. When full-context prediction must rewrite every config with an appended return state, the view materializes a mutable list once and all subsequent reads go through that list. Callers iterate with size() / get(int) only — no dual-null checks in the reach loop.

PERF: A single instance is retained on ReachComputation (one per ParserATNSimulator) and rebound via reset(ATNConfigSet)/release() around each edge so the view object and the full-context rewrite ArrayList keep capacity across predictions. SLL paths never touch the list.

Package-private: owned by the ATN prediction hot path.