Home
last modified time | relevance | path

Searched refs:lexer (Results 1 – 14 of 14) sorted by relevance

/PHP-Parser/test/PhpParser/
H A DLexerTest.php22 $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 DParserTestAbstract.php12 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 DParserFactory.php16 $lexer = new Lexer();
18 $lexer = new Lexer\Emulative($version);
21 return new Php8($lexer, $version);
23 return new Php7($lexer, $version);
H A DParserAbstract.php41 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 DEmulativeTest.php23 $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 DPhp7Test.php10 protected function getParser(Lexer $lexer) { argument
11 return new Php7($lexer);
H A DPhp8Test.php10 protected function getParser(Lexer $lexer) { argument
11 return new Php8($lexer);
/PHP-Parser/tools/fuzzing/
H A Dtarget.php24 $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 DUPGRADE-3.0.md9 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 DUPGRADE-2.0.md40 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 DUPGRADE-5.0.md491 ### 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 DCHANGELOG.md142 * 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 DLexer.markdown4 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 D2_Usage_of_basic_components.markdown49 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