PHPCfg\Parser::parseAst PHP Method

parseAst() public method

public parseAst ( array $ast, string $fileName ) : Script
$ast array PHP-Parser AST
$fileName string
return Script
    public function parseAst($ast, $fileName)
    {
        $this->fileName = $fileName;
        $ast = $this->astTraverser->traverse($ast);
        $this->script = $script = new Script();
        $script->functions = [];
        $script->main = new Func('{main}', 0, null, null);
        $this->parseFunc($script->main, [], $ast, 1);
        // Reset script specific state
        $this->script = null;
        $this->currentNamespace = null;
        $this->currentClass = null;
        return $script;
    }
Parser