Пример #1
0
        public bool ParseLibraries()
        {
            foreach (var library in Options.Libraries)
            {
                if (this.Symbols.Libraries.Any(l => l.FileName == library))
                {
                    continue;
                }

                var parser = new ClangParser();
                parser.LibraryParsed += OnFileParsed;

                using (var res = parser.ParseLibrary(library, Options))
                {
                    if (res.Kind != ParserResultKind.Success)
                    {
                        continue;
                    }

                    Symbols.Libraries.Add(ClangParser.ConvertLibrary(res.Library));

                    res.Library.Dispose();
                }
            }

            return(true);
        }
Пример #2
0
        public bool ParseLibraries()
        {
            ClangParser.LibraryParsed += OnFileParsed;
            foreach (Module module in Options.Modules)
            {
                using var linkerOptions = new LinkerOptions(Context.LinkerOptions);
                foreach (string libraryDir in module.LibraryDirs)
                {
                    linkerOptions.AddLibraryDirs(libraryDir);
                }

                foreach (string library in module.Libraries)
                {
                    if (!Context.Symbols.Libraries.Any(( NativeLibrary l ) => l.FileName == library))
                    {
                        linkerOptions.AddLibraries(library);
                    }
                }

                using ParserResult parserResult = ClangParser.ParseLibrary(linkerOptions);
                if (parserResult.Kind == ParserResultKind.Success)
                {
                    for (uint num = 0u; num < parserResult.LibrariesCount; num++)
                    {
                        Context.Symbols.Libraries.Add(ClangParser.ConvertLibrary(parserResult.GetLibraries(num)));
                    }
                }
            }

            ClangParser.LibraryParsed -= OnFileParsed;
            Context.Symbols.IndexSymbols();
            SortModulesByDependencies();
            return(true);
        }
Пример #3
0
        public bool ParseLibraries()
        {
            foreach (var library in Options.Libraries)
            {
                var parser = new ClangParser();
                parser.LibraryParsed += OnFileParsed;

                var res = parser.ParseLibrary(library, Options);

                if (res.Kind != ParserResultKind.Success)
                {
                    continue;
                }

                Symbols.Libraries.Add(ClangParser.ConvertLibrary(res.Library));
            }

            return(true);
        }
Пример #4
0
        public bool ParseLibraries()
        {
            ClangParser.LibraryParsed += OnFileParsed;
            foreach (var module in Options.Modules)
            {
                using (var linkerOptions = new LinkerOptions())
                {
                    foreach (var libraryDir in module.LibraryDirs)
                    {
                        linkerOptions.AddLibraryDirs(libraryDir);
                    }

                    foreach (string library in module.Libraries)
                    {
                        if (Context.Symbols.Libraries.Any(l => l.FileName == library))
                        {
                            continue;
                        }
                        linkerOptions.AddLibraries(library);
                    }

                    using (var res = ClangParser.ParseLibrary(linkerOptions))
                    {
                        if (res.Kind != ParserResultKind.Success)
                        {
                            continue;
                        }

                        for (uint i = 0; i < res.LibrariesCount; i++)
                        {
                            Context.Symbols.Libraries.Add(ClangParser.ConvertLibrary(res.GetLibraries(i)));
                        }
                    }
                }
            }
            ClangParser.LibraryParsed -= OnFileParsed;

            Context.Symbols.IndexSymbols();
            SortModulesByDependencies();

            return(true);
        }
Пример #5
0
        public bool ParseLibraries()
        {
            foreach (var module in Options.Modules)
            {
                foreach (var libraryDir in module.LibraryDirs)
                {
                    ParserOptions.AddLibraryDirs(libraryDir);
                }

                foreach (var library in module.Libraries)
                {
                    if (Context.Symbols.Libraries.Any(l => l.FileName == library))
                    {
                        continue;
                    }

                    var parser = new ClangParser();
                    parser.LibraryParsed += OnFileParsed;

                    using (var res = parser.ParseLibrary(library, ParserOptions))
                    {
                        if (res.Kind != ParserResultKind.Success)
                        {
                            continue;
                        }

                        Context.Symbols.Libraries.Add(ClangParser.ConvertLibrary(res.Library));

                        res.Library.Dispose();
                    }
                }
            }

            Context.Symbols.IndexSymbols();
            SortModulesByDependencies();

            return(true);
        }