Exemple #1
0
 public bool Add(Item theItem)
 {
     if (!itemSet.Contains(theItem))
     {
         itemSet.Add(theItem);
         return true;
     }
     else return false;
 }
Exemple #2
0
 public Lr0State(Item[] theItems)
 {
     itemSet = new List<Item>(theItems);
 }
Exemple #3
0
        public List<Item> GetGotoItems(Symbol theSymbol)
        {
            List<Item> ResultSet = new List<Item>();
            foreach (Item Production in itemSet)
            {
                if (!Production.isFinal())
                {
                    if (Production.getCurrentSymbol().Equals(theSymbol))
                    {
                        Item ItemToAdd = new Item(Production.Rule, Production.Position + 1);
                        ResultSet.Add(ItemToAdd);
                    }
                }
            }

            return ResultSet;
        }