Lines Matching refs:token

12  * access to any previous token by index.
14 * This token stream ignores the value of {@see Token::getChannel()}. If your
15 * parser requires the token stream filter tokens to only those on a particular
17 * {@see Token::HIDDEN_CHANNEL}, use a filtering token stream such a
30 * A collection of all tokens fetched from the token source. The list is
39 * The index into {@see BufferedTokenStream::tokens()} of the current token
40 * (next token to {@see BufferedTokenStream::consume()}).
46 * the first token has not yet been fetched from the token source. For
55 * Indicates whether the {@see Token::EOF} token has been fetched from
117 // the last token in tokens is EOF. skip check if p indexes any
118 // fetched token except the last.
121 // no EOF token in tokens. skip check if p indexes a fetched token.
136 * Make sure index `i` in tokens has a token.
138 * @return bool `true` if a token is located at index `i`,
163 /** @var WritableToken $token */
164 $token = $this->tokenSource->nextToken();
165 $token->setTokenIndex(\count($this->tokens));
167 $this->tokens[] = $token;
169 if ($token->getType() === Token::EOF) {
198 $token = $this->LT($i);
200 return $token === null ? Token::INVALID_TYPE : $token->getType();
229 // return EOF token
230 // EOF must be last token
239 * the current stream position by adjusting the target token index of a seek
245 * that the seek target is always an on-channel token.
247 * @param int $i The target token index.
249 * @return int The adjusted target token index.
271 * Reset this token stream by setting its token source.
323 * Given a starting index, return the index of the next token on channel.
325 * token if there are no tokens on channel between `i` and EOF.
335 $token = $this->tokens[$i];
336 while ($token->getChannel() !== $channel) {
337 if ($token->getType() === Token::EOF) {
345 $token = $this->tokens[$i];
352 * Given a starting index, return the index of the previous token on channel.
356 * If `i` specifies an index at or after the EOF token, the EOF token
357 * index is returned. This is due to the fact that the EOF token is treated
370 * Collect all tokens on specified channel to the right of the current token
371 * up until we see a token on DEFAULT_TOKEN_CHANNEL or EOF. If channel is -1,
372 * find any non default channel token.
386 // if none onchannel to right, nextOnChannel=-1 so set to = last token
393 * Collect all tokens on specified channel to the left of the current token
394 * up until we see a token on DEFAULT_TOKEN_CHANNEL. If channel is -1, find
395 * any non default channel token.