}//method

        public void AddItem(LRItem item)
        {
            if (AllItems.Contains(item))
            {
                return;
            }
            AllItems.Add(item);
            Cores.Add(item.Core);
            if (item.Core.IsFinal)
            {
                ReduceItems.Add(item);
            }
            else
            {
                ShiftItems.Add(item);
                ShiftTerms.Add(item.Core.Current);
            }
        }
        }//method

        public LRItem AddItem(LR0Item core)
        {
            var item = AllItems.FindByCore(core);

            if (item != null)
            {
                return(item);
            }
            item = new LRItem(State, core);
            AddItem(item);
            //If current term is non-terminal, expand it
            var currNt = core.Current as NonTerminal;

            if (currNt == null)
            {
                return(item);
            }
            foreach (var prod in currNt.Productions)
            {
                var expItem = AddItem(prod.LR0Items[0]);
                item.Expansions.Add(expItem);
            }
            return(item);
        }//method