[] */ private array $map; public function __construct(Machine $machine) { $this->machine = $machine; $this->map = []; } public function apply(Block $block): void { $words = $block->words; while ($word = array_shift($words)) { $method = "{$word}"; if (!method_exists($this, $method)) { continue; } $this->{$method}($block); break; } } public function G22(Block $block): void { $number = $block->valueOf('X'); $this->machine->SPMC->loadProgram($number); $this->machine->AMC = $this->machine->SPMC; } }