public void calculateGotos(int state,BitSet gotos)
	{
		LR0ItemSet I = itemSets.get(state);
		
		// For any item [A ::= a (*) X b] in I:
		for(int i = 0;i < I.size();i++)
		{
			if(I.getPosition(i) < spec.pr.getRHSLength(I.getProduction(i)))
			{
				int X = spec.pr.getRHSSym(I.getProduction(i),I.getPosition(i));
				if(X == spec.getEOFTerminal()) continue;
				if(!transitionLabels.get(state).get(X)) gotoItems.get(state)[X] = new BitSet();
				// Let delta(I,X) = J;
				transitionLabels.get(state).set(X);
				// designate [A ::= a X (*) b] as a seed item for state J.
				gotoItems.get(state)[X].set(i);
			}
		}
		
		// For each transition X:
		for(int X = transitionLabels.get(state).nextSetBit(0);X >= 0;X = transitionLabels.get(state).nextSetBit(X+1))
		{
			// Build the set of seed items for state J = delta(I,X) based on the designations
			// made in the previous loop.
			int[] jItems = new int[2*gotoItems.get(state)[X].cardinality()];
			for(int i = 0,item = gotoItems.get(state)[X].nextSetBit(0);item >= 0;i++,item = gotoItems.get(state)[X].nextSetBit(item+1))
			{
				jItems[2*i] = I.getProduction(item);
				jItems[2*i+1] = I.getPosition(item) + 1;
			}
			// Get the closure for the seed item set -- whether a new state or one
			// already existing.
			int J = closure(new LR0ItemSet(jItems));
			// Put the I-to-J transition in the delta table.
			transitions.get(state)[X] = J;
			// If a new state was created, add it to the set of new itemSets next to be processed.
			if(J == itemSets.size() - 1) gotos.set(J);
		}
	}