| Total Complexity | 8 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 9 | class Dfa |
||
| 10 | { |
||
| 11 | private $stateMap; |
||
| 12 | |||
| 13 | private $symbolTable; |
||
| 14 | |||
| 15 | private $transitionMap; |
||
| 16 | |||
| 17 | public function getStateMap(): StateMap |
||
| 18 | { |
||
| 19 | if (!isset($this->stateMap)) { |
||
| 20 | $this->stateMap = new StateMap(); |
||
| 21 | } |
||
| 22 | |||
| 23 | return $this->stateMap; |
||
| 24 | } |
||
| 25 | |||
| 26 | public function getTransitionMap(): TransitionMap |
||
| 27 | { |
||
| 28 | if (!isset($this->transitionMap)) { |
||
| 29 | $this->transitionMap = new TransitionMap($this->getStateMap()); |
||
| 30 | } |
||
| 31 | |||
| 32 | return $this->transitionMap; |
||
| 33 | } |
||
| 34 | |||
| 35 | public function getSymbolTable(): SymbolTable |
||
| 36 | { |
||
| 37 | if (!isset($this->symbolTable)) { |
||
| 38 | $this->symbolTable = new SymbolTable(); |
||
| 39 | } |
||
| 40 | |||
| 41 | return $this->symbolTable; |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param SymbolTable $symbolTable |
||
| 46 | * @throws Exception |
||
| 47 | */ |
||
| 48 | public function setSymbolTable(SymbolTable $symbolTable): void |
||
| 54 | } |
||
| 55 | } |
||
| 56 |