public function parse($code)
    {
        $parser = $this->parserFactory->create($this->parserType);

        try {
            $ast = $parser->parse($code);
        } catch (Error $error) {
            throw new ParseException($error->getMessage(), 0, $error);
        }

        $printer = new Printer($this->securityManager);
        return $printer->prettyPrintFile($ast);
    }