1 | <?php |
||
17 | abstract class MultistateLexer extends Lexer implements MultistateLexerInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var int |
||
21 | */ |
||
22 | protected const DEFAULT_STATE = 0x00; |
||
23 | |||
24 | /** |
||
25 | * @var array|int[] |
||
26 | */ |
||
27 | protected $states = []; |
||
28 | |||
29 | /** |
||
30 | * @var array|int[] |
||
31 | */ |
||
32 | protected $transitions = []; |
||
33 | |||
34 | /** |
||
35 | * @param string $token |
||
36 | * @param int $state |
||
37 | * @param int|null $nextState |
||
38 | * @return MultistateLexerInterface |
||
39 | */ |
||
40 | public function state(string $token, int $state, int $nextState = null): MultistateLexerInterface |
||
50 | |||
51 | /** |
||
52 | * @param string $token |
||
53 | * @return int |
||
54 | */ |
||
55 | protected function getTokenState(string $token): int |
||
59 | |||
60 | /** |
||
61 | * @param string $token |
||
62 | * @return int |
||
63 | */ |
||
64 | protected function getNextState(string $token): int |
||
68 | } |
||
69 |