Lines Matching defs:DFA

14 use Antlr\Antlr4\Runtime\Dfa\DFA;
42 * Shared across DFA to ATN simulation in case the ATN fails and the
43 * DFA did not have a previous accept state. In this case, we use the
64 /** @var array<DFA> */
71 * Used during DFA/ATN exec to record the most recent accept configuration info.
78 * @param array<DFA> $decisionToDFA
181 $this->log[] = \sprintf('DFA after matchATN: %s', $this->decisionToDFA[$old_mode]->toLexerString());
199 $s = $ds0; // s is current/from DFA state
207 // avoid looking up the DFA state again, which is expensive.
208 // If the previous target was already part of the DFA, we might
211 // creating a DFA state. Once we know s!=null, we check to see if
212 // the DFA state has an edge already for t. If so, we can just reuse
214 // This is kind of like doing DFA simulation within the ATN
215 // simulation because DFA simulation is really just a way to avoid
217 // we have a previously added DFA state, we could jump over to
218 // the DFA simulator. But, that would mean popping back and forth
220 // This optimization makes a lot of sense for loops within DFA.
221 // A character will take us back to an existing DFA state
250 $s = $target; // flip; current DFA target becomes new src/from state
257 * Get an existing target state for an edge in the DFA. If the target state
261 * @param DFAState $s The current DFA state
264 * @return DFAState|null The existing target DFA state for the given input symbol
284 * Compute a target state for an edge in the DFA, and attempt to add the
285 * computed state and corresponding edge to the DFA.
288 * @param DFAState $s The current DFA state
291 * @return DFAState The computed target DFA state for the given input symbol
292 * `t`. If `t` does not lead to a valid DFA state, this
299 // if we don't find an existing DFA state
307 // cause a failover from DFA later.
315 // Add an edge from s to target DFA found/created for reach
325 throw new \RuntimeException('Unexpected null DFA State.');
584 // we cannot add a DFA state for this "reach" computation
585 // because the DFA would not test the predicate again in the
588 // fly all the time using the ATN not the DFA. This is slower but
590 // this predicate mechanism is not adding DFA states that see
599 // test them, we cannot cash the DFA state target of ID.
732 * DFA should be omitted. The target DFAState is still created since
733 * execATN has the ability to resynchronize with the DFA state cache
736 * TJP notes: next time through the DFA, we see a pred again and eval.
737 * If that gets us to a previously created (but dangling) DFA
738 * state, we can continue in pure DFA mode from there.
758 // Only track edges within the DFA bounds
775 * Add a new DFA state if there isn't one with this set of configurations
777 * an ATN rule stop state. Later, when traversing the DFA, we will know
828 public function getDFA(int $mode) : DFA