static function generateParserFromGrammar(
        string $grammarFilePath,
        string $parserName="MyParser",
        string $namespace="",
        Output $output=null,
        string $pathToHeaderComment="")
    {
        $parser = new MetaGrammarParser();

        $ast = !empty($grammarFilePath) ?
            $parser->parseFile($grammarFilePath) :
            $parser->parseStdin();

        if ($ast !== false) {

            $generator = new CodeGenerator($parserName, $namespace);
            $generator->setHeaderCommentFile($pathToHeaderComment);
            $generator->generate($ast, $output);

            return [true, ""];

        } else {

            return [false, $parser->error()];

        }
    }