Lines Matching refs:tokens
4 The lexer is responsible for providing tokens to the parser. Typical use of the library does not re…
5 …ith the lexer, as an appropriate lexer is created by `PhpParser\ParserFactory`. The tokens produced
15 … the `PhpToken` based representation introduced in PHP 8.0, rather than the array-based tokens from
22 …`T_NAME_RELATIVE` tokens, rather than the previous representation using a sequence of `T_STRING` a…
26 Second, the `PhpParser\Lexer` base class will convert `&` tokens into the PHP 8.1 representation of…
45 /** @var int Token ID, either T_* or ord($char) for single-character tokens. */
61 The lexer is normally invoked implicitly by the parser. In that case, the tokens for the last parse…
64 Nodes in the AST produced by the parser always corresponds to some range of tokens. The parser adds…
65 positioning attributes to allow mapping nodes back to lines, tokens or file offsets:
83 > tokens. However, the general idea behind the example still applies in other cases.
90 /** @param PhpParser\Token[] $tokens */
91 function isDeclaredUsingVar(array $tokens, PhpParser\Node\Stmt\Property $prop) {
93 return $tokens[$i]->id === T_VAR;
97 In order to make use of this function, you will have to provide the tokens from the lexer to your n…
102 private $tokens;
103 public function setTokens(array $tokens) {
104 $this->tokens = $tokens;
109 var_dump(isDeclaredUsingVar($this->tokens, $node));