Lines Matching defs:precedence

37      * `true` if this DFA is for a precedence decision; otherwise, `false`.
64 * Gets whether this DFA is a precedence DFA. Precedence DFAs use a special
68 * precedence values.
70 * @return bool `true` if this is a precedence DFA; otherwise, `false`.
80 * Get the start state for a specific precedence value.
82 * @param int $precedence The current precedence.
85 * precedence, or `null` if no start state exists
86 * for the specified precedence.
88 * @throws \InvalidArgumentException If this is not a precedence DFA.
90 public function getPrecedenceStartState(int $precedence) : ?DFAState
93 throw new \InvalidArgumentException('Only precedence DFAs may contain a precedence start state.');
97 throw new \RuntimeException('s0.edges cannot be null for a precedence DFA.');
100 if ($precedence < 0 || $precedence >= \count($this->s0->edges)) {
104 return $this->s0->edges[$precedence] ?? null;
108 * Set the start state for a specific precedence value.
110 * @param int $precedence The current precedence.
112 * specified precedence.
114 * @throws \InvalidArgumentException If this is not a precedence DFA.
116 public function setPrecedenceStartState(int $precedence, DFAState $startState) : void
119 throw new \InvalidArgumentException('Only precedence DFAs may contain a precedence start state.');
122 if ($precedence < 0) {
130 if ($precedence >= $this->s0->edges->count()) {
131 $this->s0->edges->setSize($precedence + 1);
135 // precedence DFA, s0 will be initialized once and not updated again
136 // s0.edges is never null for a precedence DFA
137 $this->s0->edges[$precedence] = $startState;