Lines Matching defs:i

136      * Make sure index `i` in tokens has a token.
138 * @return bool `true` if a token is located at index `i`,
143 public function sync(int $i) : bool
145 $n = $i - \count($this->tokens) + 1; // how many more elements we need?
162 for ($i = 0; $i < $n; $i++) {
172 return $i + 1;
196 public function LA(int $i) : int
198 $token = $this->LT($i);
224 $i = $this->index + $k - 1;
226 $this->sync($i);
228 if ($i >= \count($this->tokens)) {
234 return $this->tokens[$i];
240 * operation. The default implementation simply returns `i`. If an
247 * @param int $i The target token index.
251 public function adjustSeekIndex(int $i) : int
253 return $i;
307 for ($i = $start; $i < $stop; $i++) {
308 $t = $this->tokens[$i];
324 * Return `i` if `tokens[i]` is on channel. Return the index of the EOF
325 * token if there are no tokens on channel between `i` and EOF.
327 protected function nextTokenOnChannel(int $i, int $channel) : int
329 $this->sync($i);
331 if ($i >= \count($this->tokens)) {
335 $token = $this->tokens[$i];
338 return $i;
341 $i++;
343 $this->sync($i);
345 $token = $this->tokens[$i];
348 return $i;
353 * Return `i` if `tokens[i]` is on channel. Return -1 if there are no tokens
354 * on channel between `i` and 0.
356 * If `i` specifies an index at or after the EOF token, the EOF token
360 protected function previousTokenOnChannel(int $i, int $channel) : int
362 while ($i >= 0 && $this->tokens[$i]->getChannel() !== $channel) {
363 $i--;
366 return $i;
426 for ($i = $left; $i < $right + 1; $i++) {
427 $t = $this->tokens[$i];
469 for ($i = $interval->start; $i <= $stop; $i++) {
470 $t = $this->tokens[$i];