Lines Matching refs:state
39 * Maps from rule index to starting state number.
46 * Maps from rule index to stop state number.
101 * Compute the set of valid tokens that can occur starting in state `state`.
103 * the rule surrounding `state`. In other words, the set will be
104 * restricted to tokens reachable staying within `state`'s rule.
106 public function nextTokensInContext(ATNState $state, ?RuleContext $context) : IntervalSet
108 return (new LL1Analyzer($this))->look($state, null, $context);
112 * Compute the set of valid tokens that can occur starting in `state` and
116 public function nextTokens(ATNState $state) : IntervalSet
118 if ($state->nextTokenWithinRule !== null) {
119 return $state->nextTokenWithinRule;
122 $state->nextTokenWithinRule = $this->nextTokensInContext($state, null);
123 $state->nextTokenWithinRule->setReadOnly(true);
125 return $state->nextTokenWithinRule;
128 public function addState(?ATNState $state) : void
130 if ($state === null) {
134 $state->atn = $this;
135 $state->stateNumber = \count($this->states);
137 $this->states[] = $state;
140 public function removeState(ATNState $state) : void
143 unset($this->states[$state->stateNumber]);
170 * Computes the set of input symbols which could follow ATN state number
174 * assumed true). If a path in the ATN exists from the starting state to the
180 * @param int $stateNumber The ATN state number
184 * follow the specified state in the specified context.
191 throw new \InvalidArgumentException('Invalid state number.');