Beispiel #1
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);
        }
Beispiel #2
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);
        }