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
		
		LALRRuleStateItem item = (LALRRuleStateItem) itm;
		boolean needsPropagation = false;
		List lookahead = null;

		for (int i = 0; i < syntax.size(); i++)	{
			Rule rule = syntax.getRule(i);
			
			if (rule.getNonterminal().equals(nonterm))	{
				LALRRuleStateItem rsi = (LALRRuleStateItem) createRuleStateItem(i, rule);
				
				// look if new item is already contained
				LALRRuleStateItem existing = (LALRRuleStateItem)entries.get(rsi);
				if (existing != null)	{
					rsi = existing;
				}
				else	{	// if not contained, add it
					entries.put(rsi, rsi);	// real list
					newItems.add(rsi);	// work list
				}
				
				if (lookahead == null)
					// calculate lookahead of originator and if it needs to propagate changes in
					// its lookahead to the new items (has nullable nonterms until end)
					needsPropagation = item.calculateLookahead(
							lookahead = new ArrayList(),
							nullable,
							firstSets);
				
				rsi.addLookahead(lookahead.iterator());	// merge lookaheads
				
				if (needsPropagation)	// if lookahead is visible from this item,
					item.addPropagate(rsi);	// add to propagate list
			}
		}
	}