public CppModule Run()

in SharpGen.Platform/CppParser.cs [149:200]


        public CppModule Run(CppModule groupSkeleton, StreamReader xmlReader)
        {
            _group = groupSkeleton;
            Logger.Message("Config files changed.");

            const string progressMessage = "Parsing C++ headers starts, please wait...";

            try
            {

                Logger.Progress(15, progressMessage);

                if (xmlReader != null)
                {
                    Parse(xmlReader);
                }

                Logger.Progress(30, progressMessage);
            }
            catch (Exception ex)
            {
                Logger.Error(null, "Unexpected error", ex);
            }
            finally
            {
                Logger.Message("Parsing headers is finished.");

                // Write back GCC-XML document on the disk
                try
                {
                    using var stream = File.Open(GccXmlFileName, FileMode.Create, FileAccess.Write);
                    GccXmlDoc?.Save(stream);
                }
                catch (Exception e)
                {
                    Logger.LogRawMessage(
                        LogLevel.Warning, LoggingCodes.ParserDiagnosticDumpIoError,
                        "Writing GCC-XML file [{0}] failed", e, GccXmlFileName
                    );
                }
            }

            // Track number of included macros for statistics
            foreach (var cppInclude in _group.Includes)
            {
                IncludeMacroCounts.TryGetValue(cppInclude.Name, out var count);
                count += cppInclude.Macros.Count();
                IncludeMacroCounts[cppInclude.Name] = count;
            }

            return _group;
        }