public DocumentationComment Parse(ProjectDom dom, string fileName, string content)
        {
            var document        = new DocumentationComment(fileName);
            var compilationUnit = new PythonCompilationUnit(fileName);

            document.CompilationUnit = compilationUnit;

            if (String.IsNullOrEmpty(content))
            {
                return(document);
            }

            var scriptSource = pythonEngine.CreateScriptSourceFromString(content, SourceCodeKind.File);
            var context      = new CompilerContext(HostingHelpers.GetSourceUnit(scriptSource),
                                                   compilerOptions, ErrorSink.Default);
            var parser = IronPythonParserEngine.CreateParser(context, langOptions);

            IronPythonAst ast = null;

            try {
                ast = parser.ParseFile(false);
            } catch (SyntaxErrorException exc) {
                // We could likely improve the error message
                document.Errors.Add(new Error(exc.Line, exc.Column, exc.Message));
                return(document);
            }

            walker.Reset();
            ast.Walk(walker);

            compilationUnit.Module = walker.Module;
            compilationUnit.Build();

            return(document);
        }
        //
        // -----------------------------------------------------
        // Borrowed from ParsedDocument and overridden
        // -----------------------------------------------------
        //

        public override IEnumerable <FoldingRegion> GenerateFolds()
        {
            foreach (FoldingRegion fold in AdditionalFolds)
            {
                yield return(fold);
            }

            foreach (FoldingRegion fold in ConditionalRegions.ToFolds())
            {
                yield return(fold);
            }

            IEnumerable <FoldingRegion> commentFolds = Comments.ToPythonFolds();

            if (CompilationUnit != null && CompilationUnit.Types != null && CompilationUnit.Types.Count > 0)
            {
                commentFolds = commentFolds.FlagIfInsideMembers(CompilationUnit.Types, delegate(FoldingRegion f) {
                    f.Type = FoldType.CommentInsideMember;
                });
            }
            foreach (FoldingRegion fold in commentFolds)
            {
                yield return(fold);
            }

            if (CompilationUnit == null)
            {
                yield break;
            }

            FoldingRegion usingFold = CompilationUnit.Usings.ToFold();

            if (usingFold != null)
            {
                yield return(usingFold);
            }

            foreach (FoldingRegion fold in CompilationUnit.Types.ToFolds())
            {
                yield return(fold);
            }

            PythonCompilationUnit pyUnit = CompilationUnit as PythonCompilationUnit;

            foreach (IMember m in pyUnit.Members)
            {
                var fold = new FoldingRegion(m.Name, m.BodyRegion, FoldType.Member);
                yield return(fold);
            }
        }