1 | <?php |
||
18 | class Factory |
||
19 | { |
||
20 | /** |
||
21 | * The factory should return any implementation supporting the PCRE lookahead syntax. |
||
22 | * |
||
23 | * @var int |
||
24 | */ |
||
25 | public const LOOKAHEAD = 0x02; |
||
26 | |||
27 | /** |
||
28 | * The factory should return any multistate implementation. |
||
29 | * |
||
30 | * @var int |
||
31 | */ |
||
32 | public const MULTISTATE = 0x04; |
||
33 | |||
34 | /** |
||
35 | * @param array $tokens |
||
36 | * @param array $skip |
||
37 | * @param int $flags |
||
38 | * @return LexerInterface|SimpleLexerInterface|MultistateLexerInterface |
||
39 | * @throws Exception\BadLexemeException |
||
40 | * @throws \InvalidArgumentException |
||
41 | */ |
||
42 | public static function create(array $tokens, array $skip = [], int $flags = self::LOOKAHEAD): LexerInterface |
||
58 | |||
59 | /** |
||
60 | * @param int $flags |
||
61 | * @return bool |
||
62 | */ |
||
63 | private static function isLookahead(int $flags): bool |
||
67 | |||
68 | /** |
||
69 | * @param int $flags |
||
70 | * @return bool |
||
71 | */ |
||
72 | private static function isMultistate(int $flags): bool |
||
76 | } |
||
77 |