public function read()
{
$files = $this->getFileNames();
$this->inArguments('-v', '--version') && (print $this->getVersionContent());
$this->inArguments('-h', '--help') && (print $this->getHelpContent());
array_walk($files, function ($file) {
if (!file_exists($file)) {
echo "File [{$file}] not found";
exit(1);
}
try {
$lexer = new Tokenizer(file_get_contents($file));
$parser = new TokenReader($lexer);
$parser->parse();
echo $parser->format();
} catch (SyntaxError $e) {
echo $e;
exit(1);
}
});
}