1 | <?php |
||
16 | class SymbolTable { |
||
17 | /** |
||
18 | * @var Symbol[] |
||
19 | */ |
||
20 | protected $symbols = array(); |
||
21 | |||
22 | /** |
||
23 | * Generator over the symbols the SymbolTable knows. |
||
24 | * |
||
25 | * @return Generator |
||
26 | */ |
||
27 | 37 | public function symbols() { |
|
32 | |||
33 | /** |
||
34 | * Add a symbol to the table. |
||
35 | * |
||
36 | * @param string $regexp |
||
37 | * @param int $binding_power |
||
38 | * @throws \InvalidArgumentException if %$regexp% is not a regexp |
||
39 | * @throws \LogicException if there already is a symbol with that $regexp. |
||
40 | * @return Symbol |
||
41 | */ |
||
42 | 39 | public function add_symbol($regexp, $binding_power = 0) { |
|
50 | } |
||
51 | |||
52 |