public Map<NonTerminal,Set<LinkedList<Production>>> getInjectionChains() {
		// inverted!!
		// for instance: <A, {B->A, C->A}> 
		Set<LinkedList<Production>> chains = new ShareableHashSet<LinkedList<Production>>();
		for (Production p : productions) {
			if (p.isInjection()) {
				LinkedList<Production> l = new LinkedList<Production>(p);
				chains.add(l);
			}
		}

		Set<LinkedList<Production>> todo = chains;
		do {
			Set<LinkedList<Production>> newChains = new ShareableHashSet<LinkedList<Production>>();
			for (LinkedList<Production> l : todo) {
				continueInjectionChain(l, newChains);
			}
			chains.addAll(newChains);
			todo = newChains;			
		} while (todo.size() > 0);

		// inverted
		// for instance: <A, [B->C, A->B]>
		Map<NonTerminal, Set<LinkedList<Production>>> m = new ShareableHashMap<NonTerminal, Set<LinkedList<Production>>>();
		for (LinkedList<Production> l : chains) {
			while (l.next != null) l=l.next;
			NonTerminal n = l.elem.lhs;
			Set<LinkedList<Production>> s = m.get(n);
			if (s == null) {
				s = new ShareableHashSet<LinkedList<Production>>();
				m.put(n, s);
			}
			s.add(l);
		}

		return m;
	}