Esempio n. 1
0
 // Methods
 public LRConflictItem(SymbolBuild Symbol)
 {
     this.Symbol   = Symbol;
     this.Conflict = LRConflict.None;
     this.Shifts   = new LRConfigSet();
     this.Reduces  = new LRConfigSet();
 }
Esempio n. 2
0
 public LRConflictItem(LRConflictItem Item, LRConflict Status)
 {
     this.Symbol   = Item.Symbol;
     this.Conflict = Status;
     this.Shifts   = Item.Shifts;
     this.Reduces  = Item.Reduces;
 }
Esempio n. 3
0
 public FAStateBuild(SymbolBuild Accept) : base(Accept)
 {
     this.NFAStates   = new NumberSet(new int[0]);
     this.AcceptList  = new FAAcceptList();
     this.PriorStates = new NumberSet(new int[0]);
     base.EdgeList    = new FAEdgeBuildList();
 }
Esempio n. 4
0
        // Methods
        private LRConflict ActionAdd(SymbolBuild TheSymbol, LRActionType Type, short Value = 0)
        {
            bool       flag2 = false;
            bool       flag  = false;
            LRConflict none  = LRConflict.None;

            for (short i = 0; ((i < base.Count) & !flag2) & !flag; i = (short)(i + 1))
            {
                LRAction action = base[i];
                if (action.Symbol.IsEqualTo(TheSymbol))
                {
                    if ((action.Type() == Type) & (action.Value() == Value))
                    {
                        flag = true;
                    }
                    else
                    {
                        none  = BuildLR.GetConflict(action.Type(), Type);
                        flag2 = true;
                    }
                }
            }
            if (!flag)
            {
                base.Add(new LRAction(TheSymbol, Type, Value));
            }
            return(none);
        }
Esempio n. 5
0
        public new LRConflict Add(LRAction Action)
        {
            LRAction    action = Action;
            SymbolBuild symbol = (SymbolBuild)action.Symbol;

            action.Symbol = symbol;
            return(this.ActionAdd(symbol, Action.Type(), Action.Value()));
        }
Esempio n. 6
0
 internal GroupBuild(string Name, SymbolBuild Container, SymbolBuild Start, SymbolBuild End, EndingMode Mode)
 {
     base.Name         = Name;
     base.Container    = Container;
     base.Start        = Start;
     base.End          = End;
     base.Ending       = Mode;
     this.IsBlock      = false;
     this.NestingNames = "None";
     base.Advance      = AdvanceMode.Character;
 }
Esempio n. 7
0
        public bool IsLessThan(SymbolBuild Symbol2)
        {
            short num  = this.SymbolKindValue(base.Type);
            short num2 = this.SymbolKindValue(Symbol2.Type);

            if (num == num2)
            {
                return(Operators.CompareString(base.Name.ToUpper(), Symbol2.Name.ToUpper(), false) < 0);
            }
            return(num < num2);
        }
Esempio n. 8
0
        internal short ItemIndexCategory(string Name, SymbolCategory Category)
        {
            int num = -1;

            for (int i = 0; (i < base.Count()) & (num == -1); i++)
            {
                SymbolBuild build = (SymbolBuild) base[i];
                if ((build.Name.ToUpper() == Name.ToUpper()) & (build.Category() == Category))
                {
                    num = i;
                }
            }
            return((short)num);
        }
Esempio n. 9
0
        internal short ItemIndex(string Name, SymbolType Type)
        {
            int num = -1;

            for (int i = 0; (i < base.Count()) & (num == -1); i++)
            {
                SymbolBuild build = (SymbolBuild) base[i];
                if ((build.Name.ToUpper() == Name.ToUpper()) & (build.Type == Type))
                {
                    num = i;
                }
            }
            return((short)num);
        }
Esempio n. 10
0
        public SymbolBuild AddUnique(SymbolBuild Item)
        {
            short num = this.ItemIndex(Item);

            if (num == -1)
            {
                num = (short)base.Add(Item);
            }
            else
            {
                SymbolBuild build2 = (SymbolBuild) base[num];
                if (build2.RegularExp == null)
                {
                    build2.RegularExp = Item.RegularExp;
                    build2.Type       = Item.Type;
                }
            }
            return((SymbolBuild) base[num]);
        }
Esempio n. 11
0
        public LRConflict ConflictForAction(SymbolBuild TheSymbol, LRActionType Type, short Value)
        {
            bool       flag = false;
            LRConflict none = LRConflict.None;

            for (short i = 0; (i < base.Count) & !flag; i = (short)(i + 1))
            {
                LRAction action = base[i];
                if (action.Symbol.IsEqualTo(TheSymbol))
                {
                    if ((action.Type() == Type) & (action.Value() == Value))
                    {
                        none = LRConflict.None;
                    }
                    else
                    {
                        none = BuildLR.GetConflict(action.Type(), Type);
                    }
                    flag = true;
                }
            }
            return(none);
        }
Esempio n. 12
0
 internal short ItemIndex(SymbolBuild Search)
 {
     return(this.ItemIndex(Search.Name, Search.Type));
 }
Esempio n. 13
0
 public int Add(SymbolBuild Item)
 {
     return(base.Add(Item));
 }