public function parse($filename, ProjectDescriptorBuilder $builder)
    {
        if (class_exists('phpDocumentor\Event\Dispatcher')) {
            Dispatcher::getInstance()->dispatch(
                'parser.file.pre',
                PreFileEvent::createInstance($this)->setFile($filename)
            );
        }
        $this->log('Starting to parse file: ' . $filename);

        try {
            $file = $this->createFileReflector($builder, $filename);
            if (!$file) {
                $this->log('>> Skipped file ' . $filename . ' as no modifications were detected');
                return;
            }

            $file->process();
            $builder->buildFileUsingSourceData($file);
            $this->logErrorsForDescriptor($builder->getProjectDescriptor()->getFiles()->get($file->getFilename()));
        } catch (Exception $e) {
            $this->log(
                '  Unable to parse file "' . $filename . '", an error was detected: ' . $e->getMessage(),
                LogLevel::ALERT
            );
        }
    }