Lines Matching refs:state

43      * DFA did not have a previous accept state. In this case, we use the
190 $this->log[] = \sprintf('start state closure=%s', (string) $ds0->configs);
199 $s = $ds0; // s is current/from DFA state
207 // avoid looking up the DFA state again, which is expensive.
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
217 // we have a previously added DFA state, we could jump over to
221 // A character will take us back to an existing DFA state
235 // capturing the accept state so the input index, line, and char
236 // position accurately reflect the state of the interpreter at the
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
265 * `t`, or `null` if the target state for this edg
277 $this->log[] = \sprintf('reuse state %d edge to %d', $s->stateNumber, $target->stateNumber);
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
365 // than a config that already reached an accept state for the same rule
387 foreach ($cfg->state->getTransitions() as $trans) {
409 // than the one that just reached an accept state.
465 * state is reached. After the first accept state is reached by depth-first
469 * @return bool `true` if an accept state is reached, otherwise `false`.
485 if ($config->state instanceof States\RuleStopState) {
490 $this->recog->getRuleNames()[$config->state->ruleIndex],
505 $configs->add(new LexerATNConfig($config, $config->state, PredictionContext::empty()));
512 $newContext = $config->context->getParent($i);// "pop" return state
531 if (!$config->state->epsilonOnlyTransitions) {
537 foreach ($config->state->getTransitions() as $trans) {
584 // we cannot add a DFA state for this "reach" computation
595 // should create the start state for rule 'a' (to save start state
596 // competition), but should not create target of ID state. The
599 // test them, we cannot cash the DFA state target of ID.
680 * lexer state. This method should restore `input` and the simulator
681 * to the original state before returning (i.e. undo the actions made by
733 * execATN has the ability to resynchronize with the DFA state cache
738 * state, we can continue in pure DFA mode from there.
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
791 if ($config->state instanceof RuleStopState) {
806 $prediction = $this->atn->ruleToTokenType[$firstConfigWithRuleStopState->state->ruleIndex];