protected void addRulesDerivingPendingNonTerminal(RuleStateItem itm, String nonterm, Syntax syntax, List newItems)	{
		// make the closure for one item:
		// if pointer before a nonterminal, add all rules that derive it
		
		LRRuleStateItem item = (LRRuleStateItem)itm;
		List lookahead = null;

		for (int i = 0; i < syntax.size(); i++)	{
			Rule rule = syntax.getRule(i);
			
			if (rule.getNonterminal().equals(nonterm))	{
				LRRuleStateItem rsi = (LRRuleStateItem) createRuleStateItem(i, rule);
				
				if (lookahead == null)	// calculate lookahead, all new items get the same lookahead
					item.calculateLookahead(
							lookahead = new ArrayList(),
							nullable,
							firstSets);
				
				rsi.addLookahead(lookahead.iterator());	// merge lookaheads
				
				// look if new item is already contained, add when not
				if (entries.containsKey(rsi) == false)	{
					entries.put(rsi, rsi);
					newItems.add(rsi);
				}
			}
		}
	}