newNodeCount += path.size() - 1; outputBuffer.add(new BufferedOutputToken(null, path.get(0), startNode, pathEndNode)); outputBuffer.add(new BufferedOutputToken(token.state, token.term.toString(), startNode, inputEndNode)); int lastNode = outputBuffer.get(pathID).endNode; for(int i=1;i<path.size()-1;i++) { outputBuffer.add(new BufferedOutputToken(null, path.get(i), lastNode, lastNode+1)); lastNode++; outputBuffer.add(new BufferedOutputToken(null, path.get(path.size()-1), lastNode, endNode)); for(int i=1;i<matchInputLength-1;i++) { BufferedInputToken token = lookahead.get(lookaheadNextRead + i); outputBuffer.add(new BufferedOutputToken(token.state, token.term.toString(), lastNode, lastNode+1)); lastNode++; outputBuffer.add(new BufferedOutputToken(token.state, token.term.toString(), lastNode, endNode));