public SymbolList SkipFirst()
        {
            SymbolList s = new SymbolList();

            s.AddRange(this.Skip(1));
            return(s);
        }
Пример #2
0
        public RuleProduction AddRule(int idSource, params Symbol[] destiny)
        {
            SymbolList sl = new SymbolList();

            sl.AddRange(destiny);
            return(AddRule(idSource, sl));
        }
        public SymbolList Replace(Symbol sym1, Symbol sym2)
        {
            SymbolList returns = new SymbolList();

            returns.AddRange(this.Select(s => s.Copy()));

            for (int i = 0; i < returns.Count; i++)
            {
                if (returns[i] == sym1)
                {
                    returns[i] = sym2.Copy();
                }
            }
            return(returns);
        }
        public SymbolList RemoveFirst(Symbol sym1)
        {
            SymbolList returns = new SymbolList();

            returns.AddRange(this.Select(s => s.Copy()));

            for (int i = 0; i < returns.Count; i++)
            {
                if (returns[i] == sym1)
                {
                    returns.RemoveAt(i);
                    return(returns);
                }
            }
            return(returns);
        }