1 | <?php |
||
31 | class ExtendedEmulativeLexer extends Emulative |
||
32 | { |
||
33 | /** |
||
34 | * Create a new Lexer instance with appropriate configuration options |
||
35 | * |
||
36 | * Whenever a new lexer instance is created that is meant to be passed to |
||
37 | * a `Pvra\Analyser` or consumed by a `Pvra\AnalyserAwareInterface` this method should be used. |
||
38 | * |
||
39 | * @return ExtendedEmulativeLexer|static |
||
40 | */ |
||
41 | 130 | public static function createDefaultInstance() |
|
46 | |||
47 | /** |
||
48 | * Override to the native getNextToken method |
||
49 | * |
||
50 | * This method override ensures that the original value of tokens that would be transformed is stored |
||
51 | * besides them in the result ast. Depending on the token type various attributes will be added to the token |
||
52 | * and produced ast. These modifications are required to ensure the correct behaviour of the binary number |
||
53 | * detection, the detection of booth flavors of the doc syntax, short array syntax and short echo tags. |
||
54 | * |
||
55 | * @param null|string $value Value of the token |
||
56 | * @param null|array $startAttributes |
||
57 | * @param null|array $endAttributes |
||
58 | * @return int Retrieved token id |
||
59 | * @see https://github.com/nikic/PHP-Parser/issues/26#issuecomment-6150035 Original implementation |
||
60 | */ |
||
61 | 128 | public function getNextToken(&$value = null, &$startAttributes = null, &$endAttributes = null) |
|
85 | } |
||
86 |