private AutomatonState FindExistingState(Symbol sym, List<ProductionItem> itemSet) { if (accessedBy.ContainsKey(sym)) foreach (AutomatonState state in accessedBy[sym]) if (ProductionItem.SameProductions(state.kernelItems, itemSet)) return state; return null; }