public function run() { $commandFactory = new CommandFactory($this->input, $this->output, $this->memory, $this->program, $this->loop); while ($command = $this->program->getValue()) { if ($command === 0) { break; } $commandClass = $commandFactory->getCommand($command); if ($commandClass instanceof Command) { $commandClass->execute(); } $this->program->incrementPointer(); } $this->response->prepareResponse($this->input, $this->output, $this->memory, $this->program); $this->response->processResponse(); }
public function execute() { $this->output->setValue($this->memory->getValue()); $this->output->incrementPointer(); }