Example #1
0
        private static LookaheadSymbolSet TotalLookahead(LRConfig Config)
        {
            bool flag;
            LookaheadSymbolSet set = new LookaheadSymbolSet();

            for (int i = 0; (i < Config.CheckaheadCount()) & !flag; i++)
            {
                short offset = (short)i;
                i = offset;
                SymbolBuild       build  = Config.Checkahead(offset);
                ConfigTrackSource source = (ConfigTrackSource)Conversions.ToInteger(Interaction.IIf(build.Type == SymbolType.Nonterminal, ConfigTrackSource.First, ConfigTrackSource.Config));
                int num4 = build.First.Count() - 1;
                for (int j = 0; j <= num4; j++)
                {
                    LookaheadSymbol item = new LookaheadSymbol(build.First[j]);
                    if (item.Parent.Type != SymbolType.Nonterminal)
                    {
                        item.Configs.Add(new ConfigTrack(Config, source));
                        set.Add(item);
                    }
                }
                flag = !build.Nullable;
            }
            if (!flag)
            {
                set.UnionWith(Config.LookaheadSet);
            }
            return(set);
        }
Example #2
0
        public DictionarySet.MemberResult Union(DictionarySet.IMember Obj)
        {
            LookaheadSymbol symbol = (LookaheadSymbol)Obj;

            return(new DictionarySet.MemberResult(new LookaheadSymbol
            {
                Parent = this.Parent,
                Configs = new ConfigTrackSet(this.Configs, symbol.Configs)
            }));
        }
Example #3
0
 public LookaheadSymbol(LookaheadSymbol Look)
 {
     this.Parent  = Look.Parent;
     this.Configs = new ConfigTrackSet();
     this.Configs.Copy(Look.Configs);
 }