Searched refs:lexer (Results 1 – 14 of 14) sorted by relevance
/PHP-Parser/test/PhpParser/ |
H A D | LexerTest.php | 22 $lexer = $this->getLexer(); 23 $lexer->tokenize($code, $errorHandler); 51 $lexer = $this->getLexer(); 52 $lexer->tokenize("<?php readonly /*"); 59 $lexer = $this->getLexer(); 60 $tokens = $lexer->tokenize($code); 116 $lexer = $this->getLexer(); 117 $this->assertEquals($expectedTokens, $lexer->tokenize($code));
|
H A D | ParserTestAbstract.php | 12 abstract protected function getParser(Lexer $lexer); argument 36 $lexer = new Lexer(); 49 $parser = $this->getParser($lexer); 113 $lexer = new InvalidTokenLexer(); 114 $parser = $this->getParser($lexer); 193 $lexer = new Lexer(); 194 $parser = $this->getParser($lexer);
|
/PHP-Parser/lib/PhpParser/ |
H A D | ParserFactory.php | 16 $lexer = new Lexer(); 18 $lexer = new Lexer\Emulative($version); 21 return new Php8($lexer, $version); 23 return new Php7($lexer, $version);
|
H A D | ParserAbstract.php | 41 protected Lexer $lexer; variable in PhpParser\\ParserAbstract 149 * @param Lexer $lexer A lexer 156 public function __construct(Lexer $lexer, ?PhpVersion $phpVersion = null) { argument 157 $this->lexer = $lexer; 184 $this->tokens = $this->lexer->tokenize($code, $this->errorHandler);
|
/PHP-Parser/test/PhpParser/Lexer/ |
H A D | EmulativeTest.php | 23 $lexer = $this->getLexer(); 29 ], $lexer->tokenize($code)); 36 $lexer = $this->getLexer(); 43 ], $lexer->tokenize($code)); 50 $lexer = $this->getLexer(); 58 ], $lexer->tokenize($code)); 65 $lexer = $this->getLexer(); 74 ], $lexer->tokenize($code)); 81 $lexer = $this->getLexer(); 136 $lexer = $this->getLexer(); [all …]
|
/PHP-Parser/test/PhpParser/Parser/ |
H A D | Php7Test.php | 10 protected function getParser(Lexer $lexer) { argument 11 return new Php7($lexer);
|
H A D | Php8Test.php | 10 protected function getParser(Lexer $lexer) { argument 11 return new Php8($lexer);
|
/PHP-Parser/tools/fuzzing/ |
H A D | target.php | 24 $lexer = new PhpParser\Lexer(); variable 25 $parser = new PhpParser\Parser\Php7($lexer); 103 $fuzzer->setTarget(function(string $input) use($lexer, $parser, $prettyPrinter, $nodeDumper, $visit… 107 $visitor->setTokens($lexer->getTokens()); 119 $visitor->setTokens($lexer->getTokens());
|
/PHP-Parser/ |
H A D | UPGRADE-3.0.md | 9 if you used the error recovery mode or have a custom lexer implementation. 45 $lexer = ...; 46 $parser = (new ParserFactory)->create(ParserFactor::ONLY_PHP7, $lexer, [ 62 $lexer = ...; 63 $parser = (new ParserFactory)->create(ParserFactor::ONLY_PHP7, $lexer); 88 $lexer = ...; 89 $parser7 = new Parser\Php7($lexer); 90 $parser5 = new Parser\Php5($lexer); 106 #### Error handling in the lexer 118 If you use a custom lexer with overridden `startLexing()` method, it needs to be changed to accept [all …]
|
H A D | UPGRADE-2.0.md | 40 To use a custom lexer, pass it as the second argument to the `create()` method: 44 $lexer = new MyLexer; 45 $parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP7, $lexer);
|
H A D | UPGRADE-5.0.md | 491 ### Changes to the lexer 493 The lexer API is reduced to a single `Lexer::tokenize()` method, which returns an array of tokens. … 495 …g start and end attributes for nodes has been moved from the lexer to the parser. The lexer no lon… 497 …ll create an appropriate instance, and no additional configuration of the lexer is necessary. To u… 502 $lexer = new Lexer\Emulative([ 510 $parser = new Parser\Php7($lexer); 512 $oldTokens = $lexer->getTokens();
|
H A D | CHANGELOG.md | 142 * Attribute handling has been moved from the lexer to the parser, and is no longer configurable. 190 * Fix error reporting in emulative lexer without explicitly specified error handler. 350 used in PHP 8.1. This happens unconditionally, regardless of whether the emulative lexer is used. 403 * Removed no longer necessary `error_clear_last()` call in lexer, which may interfere with fatal 482 * Added `phpVersion` option to the emulative lexer, which allows controlling the target version to 649 * Flexible heredoc/nowdoc strings require special support from the lexer. Because this is not 989 * Added support for recovery from lexer errors. 991 * Added precise location information for lexer errors. 1007 * The emulative lexer now directly postprocesses tokens, instead of using `~__EMU__~` sequences. 1008 This changes the protected API of the lexer.
|
/PHP-Parser/doc/component/ |
H A D | Lexer.markdown | 4 The lexer is responsible for providing tokens to the parser. Typical use of the library does not re… 5 interaction with the lexer, as an appropriate lexer is created by `PhpParser\ParserFactory`. The to… 6 by the lexer can then be retrieved using `PhpParser\Parser::getTokens()`. 13 parsing newer code. For that reason, the lexer performs additional "emulation" in three layers: 30 Finally, `PhpParser\Lexer\Emulative` performs other, optional emulations. This lexer is parameteriz… 61 The lexer is normally invoked implicitly by the parser. In that case, the tokens for the last parse… 97 In order to make use of this function, you will have to provide the tokens from the lexer to your n…
|
/PHP-Parser/doc/ |
H A D | 2_Usage_of_basic_components.markdown | 49 The `createXYZ()` methods optionally accept an array of lexer options. Some use cases that require 50 customized lexer options are discussed in the [lexer documentation](component/Lexer.markdown).
|
Completed in 22 milliseconds