code: private void calculate() throws GrammarException {
  	addState(closure0.calc(new LR0Item(grammar.getProductions().get(0), 0)));
  	int currentSize;
  	do {
  	    currentSize = itemSetCollection.size();
  	    int currentItemSetCount = itemSetCollection.size();
  	    for (int stateId = 0; stateId < currentItemSetCount; stateId++) {
  		LR0ItemSet itemSet = itemSetCollection.get(stateId);
  		for (Construction grammarSymbol : itemSet
  			.getAllGrammarSymbols()) {
  		    LR0ItemSet gotoSet = goto0.calc(itemSet, grammarSymbol);
  		    if (gotoSet.getSize() > 0) {
  			addState(gotoSet);
  		    }
  		}
  	    }
  	} while (currentSize < itemSetCollection.size());
      }
docs: From Dragon Book:
  
  <pre>
  void items(G') {
  C = {CLOSURE({[S0 --> .S]})};
  repeat
  for ( jede Item-Menge I in C )
  for ( jedes Grammatiksymbol X )
  if ( GOTO( I, X) ist nicht leer und nicht in C )
  fuege GOTO(I, X) zu C hinzu;
  until es werden keine neuen Item-Mengen mehr in einer Runde zu C hinzugefuegt.
  }
  </pre>
  
  This method was extended to save also all transitions found and to handle
  ambiguous grammars.
  
  @throws GrammarException