public bool Add(Item theItem) { if (!itemSet.Contains(theItem)) { itemSet.Add(theItem); return true; } else return false; }
public Lr0State(Item[] theItems) { itemSet = new List<Item>(theItems); }
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; }