Example #1
0
        public bool ParseCode()
        {
            foreach (var header in Options.Headers)
            {
                var source = Project.AddFile(header);
                source.Options = BuildParseOptions(source);
            }

#if !OLD_PARSER
            var parser = new ClangParser(new Parser.AST.ASTContext());
#else
            var parser = new ClangParser(ASTContext);
#endif

            parser.SourceParsed += OnSourceFileParsed;
            parser.ParseProject(Project, Options);

            TargetInfo = parser.GetTargetInfo(Options);

#if !OLD_PARSER
            ASTContext = ClangParser.ConvertASTContext(parser.ASTContext);
#endif

            return(true);
        }
Example #2
0
        public bool ParseCode()
        {
            var parser = new ClangParser(new Parser.AST.ASTContext());

            parser.SourcesParsed += OnSourceFileParsed;
            parser.ParseProject(Project, Options.UnityBuild);

            Context.TargetInfo = parser.GetTargetInfo(ParserOptions);
            Context.ASTContext = ClangParser.ConvertASTContext(parser.ASTContext);

            return(!hasParsingErrors);
        }
Example #3
0
        public bool ParseCode()
        {
            var parser = new ClangParser(new Parser.AST.ASTContext());

            parser.SourceParsed += OnSourceFileParsed;
            parser.ParseProject(Project);

            TargetInfo = parser.GetTargetInfo(Options);

            ASTContext = ClangParser.ConvertASTContext(parser.ASTContext);

            return(true);
        }
Example #4
0
        public bool ParseCode()
        {
            var parser = new ClangParser(new Parser.AST.ASTContext());

            parser.SourcesParsed += OnSourceFileParsed;
            parser.ParseProject(Project, Options.UnityBuild);

            foreach (var source in Project.Sources.Where(s => s.Options != null))
            {
                source.Options.Dispose();
            }

            Context.TargetInfo = parser.GetTargetInfo(ParserOptions);
            Context.ASTContext = ClangParser.ConvertASTContext(parser.ASTContext);

            return(!hasParsingErrors);
        }
Example #5
0
        public bool ParseCode()
        {
            var astContext = new Parser.AST.ASTContext();

            var parser = new ClangParser(astContext);

            parser.SourcesParsed += OnSourceFileParsed;

            var sourceFiles = Options.Modules.SelectMany(m => m.Headers);

            if (Options.UnityBuild)
            {
                var parserOptions = BuildParserOptions();
                var result        = parser.ParseSourceFiles(sourceFiles, parserOptions);
                result.Dispose();
            }
            else
            {
                var results = new List <ParserResult>();

                foreach (var sourceFile in sourceFiles)
                {
                    var parserOptions = BuildParserOptions(sourceFile);
                    results.Add(parser.ParseSourceFile(sourceFile, parserOptions));
                }

                foreach (var result in results)
                {
                    result.Dispose();
                }
            }

            Context.TargetInfo = parser.GetTargetInfo(ParserOptions);
            Context.ASTContext = ClangParser.ConvertASTContext(astContext);

            return(!hasParsingErrors);
        }
Example #6
0
        public bool ParseCode()
        {
            var parser = new ClangParser(new Parser.AST.ASTContext());

            parser.SourceParsed += OnSourceFileParsed;
            parser.ParseProject(Project);

            TargetInfo = parser.GetTargetInfo(Options);

            ASTContext = ClangParser.ConvertASTContext(parser.ASTContext);

            return true;
        }
Example #7
0
        public bool ParseCode()
        {
            var parser = new ClangParser(new Parser.AST.ASTContext());

            parser.SourcesParsed += OnSourceFileParsed;
            parser.ParseProject(Project, Options.UnityBuild);

            TargetInfo = parser.GetTargetInfo(Options);

            ASTContext = ClangParser.ConvertASTContext(parser.ASTContext);

            return !hasParsingErrors;
        }
Example #8
0
        public bool ParseCode()
        {
            foreach (var header in Options.Headers)
            {
                var source = Project.AddFile(header);
                source.Options = BuildParseOptions(source);
            }

            #if !OLD_PARSER
            var parser = new ClangParser(new Parser.AST.ASTContext());
            #else
            var parser = new ClangParser(ASTContext);
            #endif

            parser.SourceParsed += OnSourceFileParsed;
            parser.ParseProject(Project, Options);

            TargetInfo = parser.GetTargetInfo(Options);

            #if !OLD_PARSER
            ASTContext = ClangParser.ConvertASTContext(parser.ASTContext);
            #endif

            return true;
        }