Ejemplo n.º 1
0
 public Analysis(string[] Input)
 {
     CFG = new cfg(Input);
     FirstSetBuilder first = new FirstSetBuilder(CFG);
     this.FirstSets = first.FirstSets;
     this.Va = new Dictionary<int, char>() { };
     this.Vg = new Dictionary<int, char>() { };
     char empty = System.Configuration.ConfigurationManager.AppSettings["Empty"][0];
     char end = System.Configuration.ConfigurationManager.AppSettings["End"][0];
     int k = 0;
     for (int i = 0; i < CFG.Vt.Count; ++i)
     {
         char c = CFG.Vt.ElementAt(i);
         if (c != empty)
         {
             Va.Add(k++, c);
         }
     }
     Va.Add(k++, end);
     for (int i = 0; i < CFG.Vn.Count; ++i)
     {
         char c = CFG.Vn.ElementAt(i);
         Vg.Add(i, c);
     }
     TableBuilder tableBuilder = new TableBuilder(CFG, FirstSets);
     this.Table = tableBuilder.Table;
     this.ItemSetMap = tableBuilder.ItemSetMap;
     this._ItemSetMap = tableBuilder._ItemSetMap;
 }
Ejemplo n.º 2
0
        public Analysis(string[] Input)
        {
            CFG = new cfg(Input);
            FirstSetBuilder first = new FirstSetBuilder(CFG);

            this.FirstSets = first.FirstSets;
            this.Va        = new Dictionary <int, char>()
            {
            };
            this.Vg = new Dictionary <int, char>()
            {
            };
            char empty = System.Configuration.ConfigurationManager.AppSettings["Empty"][0];
            char end   = System.Configuration.ConfigurationManager.AppSettings["End"][0];
            int  k     = 0;

            for (int i = 0; i < CFG.Vt.Count; ++i)
            {
                char c = CFG.Vt.ElementAt(i);
                if (c != empty)
                {
                    Va.Add(k++, c);
                }
            }
            Va.Add(k++, end);
            for (int i = 0; i < CFG.Vn.Count; ++i)
            {
                char c = CFG.Vn.ElementAt(i);
                Vg.Add(i, c);
            }
            TableBuilder tableBuilder = new TableBuilder(CFG, FirstSets);

            this.Table       = tableBuilder.Table;
            this.ItemSetMap  = tableBuilder.ItemSetMap;
            this._ItemSetMap = tableBuilder._ItemSetMap;
        }