Beispiel #1
0
 // Methods
 public void Add(SysLogItem Item)
 {
     if (!this.Locked)
     {
         this.m_Count = (short)(this.m_Count + 1);
         this.m_Array = (SysLogItem[])Utils.CopyArray((Array)this.m_Array, new SysLogItem[(this.m_Count - 1) + 1]);
         this.m_Array[this.m_Count - 1] = Item;
     }
 }
Beispiel #2
0
 public void Add(SysLogSection Section, SysLogAlert Alert, string Title)
 {
     if (!this.Locked)
     {
         SysLogItem item  = new SysLogItem();
         SysLogItem item2 = item;
         item2.Section = Section;
         item2.Alert   = Alert;
         item2.Title   = Title;
         item2         = null;
         this.Add(item);
     }
 }
Beispiel #3
0
 public void Add(string Title, string Description)
 {
     if (!this.Locked)
     {
         SysLogItem item  = new SysLogItem();
         SysLogItem item2 = item;
         item2.Section     = SysLogSection.Grammar;
         item2.Alert       = SysLogAlert.Warning;
         item2.Title       = Title;
         item2.Description = Description;
         item2             = null;
         this.Add(item);
     }
 }
Beispiel #4
0
 public void Add(SysLogSection Section, SysLogAlert Alert, string Title, string Description, string Index = "")
 {
     if (!this.Locked)
     {
         SysLogItem item  = new SysLogItem();
         SysLogItem item2 = item;
         item2.Section     = Section;
         item2.Alert       = Alert;
         item2.Title       = Title;
         item2.Description = Description;
         item2.Index       = Index;
         if ((item2.Description != "") & !item2.Description.EndsWith("."))
         {
             SysLogItem item3 = item2;
             item3.Description = item3.Description + ".";
         }
         item2 = null;
         this.Add(item);
     }
 }
Beispiel #5
0
        public static void Main()
        {
            bool flag = true;

            BuilderApp.FatalLoadError = false;
            Setup();
            Notify.OutputProgress = m_Verbose;
            BuilderApp.Setup();
            if (BuilderApp.FatalLoadError)
            {
                BuilderApp.Log.Add(SysLogSection.System, SysLogAlert.Critical, "There was a fatal internal error.");
                flag = false;
            }
            if (m_GrammarFile == "")
            {
                BuilderApp.Log.Add(SysLogSection.CommandLine, SysLogAlert.Critical, "You must specify a grammar file.");
                flag = false;
            }
            else if (!LoadGrammar())
            {
                BuilderApp.Log.Add(SysLogSection.CommandLine, SysLogAlert.Critical, "The grammar file could not be loaded.");
                flag = false;
            }
            if (flag)
            {
                TextReader metaGrammar = new StringReader(m_Grammar);
                BuilderApp.EnterGrammar(metaGrammar);
                if (BuilderApp.LoggedCriticalError())
                {
                    flag = false;
                }
            }
            if (flag)
            {
                BuilderApp.ComputeLALR();
                if (BuilderApp.LoggedCriticalError())
                {
                    flag = false;
                }
            }
            if (flag)
            {
                BuilderApp.ComputeDFA();
                if (BuilderApp.LoggedCriticalError())
                {
                    flag = false;
                }
            }
            if (flag)
            {
                BuilderApp.ComputeComplete();
            }
            if (flag)
            {
                BuilderApp.Log.Add(SysLogSection.System, SysLogAlert.Success, "The grammar was successfully analyzed and the table file was created.");
                string str = FileUtility.GetExtension(m_TableFile).ToLower();
                if (str == "xml")
                {
                    if (m_Version == 1)
                    {
                        BuilderApp.BuildTables.SaveXML1(m_TableFile);
                    }
                    else
                    {
                        BuilderApp.BuildTables.SaveXML5(m_TableFile);
                    }
                }
                else if (str == "cgt")
                {
                    BuilderApp.BuildTables.SaveVer1(m_TableFile);
                }
                else
                {
                    BuilderApp.BuildTables.SaveVer5(m_TableFile);
                }
            }
            BuilderApp.SaveLog(m_LogFile);
            if (m_Verbose)
            {
                int num2 = BuilderApp.Log.Count() - 1;
                for (int i = 0; i <= num2; i++)
                {
                    SysLogItem item = BuilderApp.Log[i];
                    if ((item.Alert == SysLogAlert.Critical) | (item.Alert == SysLogAlert.Warning))
                    {
                        Console.WriteLine(item.AlertName().ToUpper() + " : " + item.SectionName() + " : " + item.Title + " : " + item.Description);
                    }
                    item = null;
                }
                Console.WriteLine("Done");
            }
        }