| 1 | <?php |
||
| 11 | class SymbolTable implements Countable |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var Variable[] |
||
| 15 | */ |
||
| 16 | protected $variables = []; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param Variable $variable |
||
| 20 | */ |
||
| 21 | public function add(Variable $variable) |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param string $name |
||
| 28 | * @return Variable|null |
||
| 29 | */ |
||
| 30 | public function get($name) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return int |
||
| 41 | */ |
||
| 42 | public function count() |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Clear symbol table |
||
| 49 | */ |
||
| 50 | public function clear() |
||
| 54 | } |
||
| 55 |