protected function execute(InputInterface $input, OutputInterface $output) { $this->output = $output; $name = $input->getArgument('name'); $ext = pathinfo($name, PATHINFO_EXTENSION); if ($ext == "") { $name .= ".edf"; } $src = file_get_contents($name); $parser = new Parser(); $codeModel = $parser->parse($src); if ($input->getOption("const")) { $this->output->write("\n"); $this->showConstants($codeModel); } if ($input->getOption("type")) { $this->output->write("\n"); $this->showTypes($codeModel); } if ($input->getOption("entity")) { $this->output->write("\n"); $this->showEntities($codeModel); } if ($input->getOption("sql")) { $this->output->write("\n"); $this->toSql($codeModel); } if ($input->getOption("php")) { $this->output->write("\n"); $this->toPhp($codeModel); } }
/** * @return CodeModelInterface */ private function parse($source) { $parser = new Parser(); $codeModel = $parser->parse($source); return $codeModel; }