Esempio n. 1
0
        public short IndexOf(Symbol Item)
        {
            short num  = 0;
            short num3 = 0;
            bool  flag = false;

            while (!flag & (num3 < base.Count))
            {
                if (Item.IsEqualTo(((LRAction) base[num]).Symbol))
                {
                    num  = num3;
                    flag = true;
                }
                num3 = (short)(num3 + 1);
            }
            if (flag)
            {
                return(num);
            }
            return(-1);
        }
Esempio n. 2
0
        private static LRStateBuild GotoSymbol(LRStateBuild State, SymbolBuild TheSymbol)
        {
            LRStateBuild build2 = new LRStateBuild();
            short        num2   = (short)(State.ConfigSet.Count() - 1);

            for (short i = 0; i <= num2; i = (short)(i + 1))
            {
                LRConfig config = State.ConfigSet[i];
                Symbol   symbol = config.NextSymbol(0);
                if ((symbol != null) && symbol.IsEqualTo(TheSymbol))
                {
                    LRConfig item = new LRConfig(config.Parent, config.Position + 1, config.LookaheadSet);
                    build2.ConfigSet.Add(item);
                }
            }
            if (build2.ConfigSet.Count() >= 1)
            {
                Closure(build2.ConfigSet);
            }
            return(build2);
        }