public Integer call(){
  try {
    EfficientTerminalSet sourceItemLookaheads=lookaheads.get(currentItem);
    CPGoToLink gotoLink=goToLinks.get(currentItem);
    if (gotoLink != null) {
      LALR1CPState targetState=gotoLink.getTargetState();
      LALR1CPItem targetItem=targetState.getItemWithLookaheadByLR0Item(gotoLink.getTargetItem());
synchronized (lookaheads) {
        EfficientTerminalSet before=lookaheads.get(targetItem);
        EfficientTerminalSet after=before.plusAll(sourceItemLookaheads);
        if (!before.equals(after)) {
          lookaheads.put(targetItem,after);
          threadPool.submit(new WorkerTaskCPLinks(targetItem,threadPool,taskCountLock));
        }
      }
    }
    for (    LR0Item closureLink : currentItem.getClosureLinks()) {
      LALR1CPState targetState=itemStates.get(currentItem);
      LALR1CPItem targetItem=targetState.getItemWithLookaheadByLR0Item(closureLink);
synchronized (lookaheads) {
        EfficientTerminalSet before=lookaheads.get(targetItem);
        EfficientTerminalSet after=before.plusAll(sourceItemLookaheads);
        after=after.plusAll(targetItem.getLookaheads());
        if (!before.equals(after)) {
          lookaheads.put(targetItem,after);
          threadPool.submit(new WorkerTaskCPLinks(targetItem,threadPool,taskCountLock));
        }
      }
    }
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
  decrementTaskCount();
  return 0;
}

public Integer call ( ) { try { EfficientTerminalSet sourceItemLookaheads = lookaheads . get ( currentItem ) ; CPGoToLink gotoLink = goToLinks . get ( currentItem ) ; if ( gotoLink != null ) { LALR1CPState targetState = gotoLink . getTargetState ( ) ; LALR1CPItem targetItem = targetState . getItemWithLookaheadByLR0Item ( gotoLink . getTargetItem ( ) ) ; synchronized ( lookaheads ) { EfficientTerminalSet before = lookaheads . get ( targetItem ) ; EfficientTerminalSet after = before . plusAll ( sourceItemLookaheads ) ; if ( ! before . equals ( after ) ) { lookaheads . put ( targetItem , after ) ; threadPool . submit ( new WorkerTaskCPLinks ( targetItem , threadPool , taskCountLock ) ) ; } } } for ( LR0Item closureLink : currentItem . getClosureLinks ( ) ) { LALR1CPState targetState = itemStates . get ( currentItem ) ; LALR1CPItem targetItem = targetState . getItemWithLookaheadByLR0Item ( closureLink ) ; synchronized ( lookaheads ) { EfficientTerminalSet before = lookaheads . get ( targetItem ) ; EfficientTerminalSet after = before . plusAll ( sourceItemLookaheads ) ; after = after . plusAll ( targetItem . getLookaheads ( ) ) ; if ( ! before . equals ( after ) ) { lookaheads . put ( targetItem , after ) ; threadPool . submit ( new WorkerTaskCPLinks ( targetItem , threadPool , taskCountLock ) ) ; } } } } catch ( Throwable e ) { e . printStackTrace ( ) ; } decrementTaskCount ( ) ; return 0 ; }
handles one state ; creates new tasks by following context propagation links .
