| 1 | <?php |
||
| 20 | final class Factory |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * Creates a new lexer instance |
||
| 24 | * |
||
| 25 | * ```php |
||
| 26 | * $lexer = Railt\Lexer\Factory::create(); |
||
| 27 | * ``` |
||
| 28 | * |
||
| 29 | * This method always returns an instance implementing `LexerInterface` interface, |
||
| 30 | * the actual lexer implementation is an implementation detail. |
||
| 31 | * |
||
| 32 | * This method should usually only be called once at the beginning of the program. |
||
| 33 | * |
||
| 34 | * @param array $tokens |
||
| 35 | * @param array $skip |
||
| 36 | * @return LexerInterface |
||
| 37 | * @throws Exception\BadLexemeException |
||
| 38 | */ |
||
| 39 | public static function create(array $tokens = [], array $skip = []): LexerInterface |
||
| 48 | } |
||
| 49 |