public Integer call(){
  try {
    printDebugMessages();
    currentState=kernel2closure.get(stateKernel);
    Set<Symbol> shiftedSymbols=new HashSet<Symbol>();
    for (    LALR1CPItem item : currentState.getItems()) {
      itemStates.put(item,currentState);
      if (item.isShiftable()) {
        Symbol symbol=item.getNextSymbol();
        if (symbol == EndOfInputStream) {
          lr0Edges.add(createAcceptEdge(stateKernel,symbol));
        }
 else         if (shiftedSymbols.add(symbol)) {
          Tuple2<LALR1CPState,List<CPGoToLink>> s=currentState.goToCP(symbol);
          LALR1CPState shiftedStateKernel=s.get1();
          List<CPGoToLink> shiftedStateCPLinks=s.get2();
          LALR1CPState equalStateLALR1CP;
          LALR1CPState gotoLinkTargetState;
synchronized (kernel2closure) {
            equalStateLALR1CP=kernel2closure.get(shiftedStateKernel);
            gotoLinkTargetState=equalStateLALR1CP;
            if (equalStateLALR1CP == null) {
              LALR1CPState shiftedState=shiftedStateKernel.closure(grammarInfo);
              kernel2closure.put(shiftedStateKernel,shiftedState);
              threadPool.submit(new WorkerTaskLALR1(shiftedStateKernel,threadPool,taskCountLock));
              gotoLinkTargetState=shiftedState;
            }
          }
          for (          CPGoToLink link : shiftedStateCPLinks) {
            LALR1CPItem todoItem=link.getSource();
            if (goToLinks.put(todoItem,link.withTargetState(gotoLinkTargetState)) != null) {
              throw new RuntimeException("Double gotoLink!");
            }
          }
          lr0Edges.add(new Edge(stateKernel,symbol,shiftedStateKernel,item.getLR0Item()));
        }
      }
    }
    decrementTaskCount();
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
  return 0;
}

public Integer call ( ) { try { printDebugMessages ( ) ; currentState = kernel2closure . get ( stateKernel ) ; Set < Symbol > shiftedSymbols = new HashSet < Symbol > ( ) ; for ( LALR1CPItem item : currentState . getItems ( ) ) { itemStates . put ( item , currentState ) ; if ( item . isShiftable ( ) ) { Symbol symbol = item . getNextSymbol ( ) ; if ( symbol == EndOfInputStream ) { lr0Edges . add ( createAcceptEdge ( stateKernel , symbol ) ) ; } else if ( shiftedSymbols . add ( symbol ) ) { Tuple2 < LALR1CPState , List < CPGoToLink > > s = currentState . goToCP ( symbol ) ; LALR1CPState shiftedStateKernel = s . get1 ( ) ; List < CPGoToLink > shiftedStateCPLinks = s . get2 ( ) ; LALR1CPState equalStateLALR1CP ; LALR1CPState gotoLinkTargetState ; synchronized ( kernel2closure ) { equalStateLALR1CP = kernel2closure . get ( shiftedStateKernel ) ; gotoLinkTargetState = equalStateLALR1CP ; if ( equalStateLALR1CP == null ) { LALR1CPState shiftedState = shiftedStateKernel . closure ( grammarInfo ) ; kernel2closure . put ( shiftedStateKernel , shiftedState ) ; threadPool . submit ( new WorkerTaskLALR1 ( shiftedStateKernel , threadPool , taskCountLock ) ) ; gotoLinkTargetState = shiftedState ; } } for ( CPGoToLink link : shiftedStateCPLinks ) { LALR1CPItem todoItem = link . getSource ( ) ; if ( goToLinks . put ( todoItem , link . withTargetState ( gotoLinkTargetState ) ) != null ) { throw new RuntimeException ( "Double gotoLink!" ) ; } } lr0Edges . add ( new Edge ( stateKernel , symbol , shiftedStateKernel , item . getLR0Item ( ) ) ) ; } } } decrementTaskCount ( ) ; } catch ( Throwable e ) { e . printStackTrace ( ) ; } return 0 ; }
handles one state ; creates new tasks by shifting .
