| Total Complexity | 4 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class TranslationScheme implements TranslationSchemeInterface |
||
| 15 | { |
||
| 16 | private $tree; |
||
| 17 | |||
| 18 | private $symbolScheme; |
||
| 19 | |||
| 20 | private $productionScheme; |
||
| 21 | |||
| 22 | private $tokenScheme; |
||
| 23 | |||
| 24 | public function __construct(Tree $tree) |
||
| 25 | { |
||
| 26 | $this->tree = $tree; |
||
| 27 | $this->symbolScheme = new SymbolTranslationScheme($tree); |
||
| 28 | $this->productionScheme = new ProductionTranslationScheme($tree); |
||
| 29 | $this->tokenScheme = new TokenTranslationScheme(); |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param Production $production |
||
| 34 | * @param int $symbolIndex |
||
| 35 | * @throws Exception |
||
| 36 | */ |
||
| 37 | public function applySymbolActions(Production $production, int $symbolIndex): void |
||
| 38 | { |
||
| 39 | $this |
||
| 40 | ->symbolScheme |
||
| 41 | ->applyActions($production, $symbolIndex); |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param Production $production |
||
| 46 | * @throws Exception |
||
| 47 | */ |
||
| 48 | public function applyProductionActions(Production $production): void |
||
| 49 | { |
||
| 50 | $this |
||
| 51 | ->productionScheme |
||
| 52 | ->applyActions($production); |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param Symbol $symbol |
||
| 57 | * @param Token $token |
||
| 58 | * @throws Exception |
||
| 59 | */ |
||
| 60 | public function applyTokenActions(Symbol $symbol, Token $token): void |
||
| 65 | } |
||
| 66 | } |
||
| 67 |