@Override
	protected void addTransition(ItemPair from, Transition t1, Transition t2, ItemPair to) {
		if (to != null) {
			//final int d = to.getDistanceToEnd();

			// order: reduce (3), shift (2), derive (1)
			int d = 2; // shift
			if (t1 != null) {
				if (t1.getType() == Reduce.class) {
					d = 3;
				} else if (t1.getType() == Derive.class) {
					d = 1;
				}
			} else {
				if (t2.getType() == Reduce.class) {
					d = 3;
				} else if (t2.getType() == Derive.class) {
					d = 1;
				}
			}
			
			transArray[d].add(to.items);
			transArray[d].add(to.flags);
			
			if (d > maxD) {
				maxD = d;
			}
			if (d < minD) {
				minD = d;
			}
			++nrTrans;
			++nrTransitions;
		}
	}