private void processNewPhaseOperations(int currPhase) { recordPhaseOpsInAllOtherPhases(currPhase); LinkedList currentPhaseNewOps = newPhaseOperations[currPhase]; while (!currentPhaseNewOps.isEmpty()) { Object operation = currentPhaseNewOps.removeFirst(); // push this operation to master list and then process it. phaseOperations[currPhase].add(operation); doPhaseOperation(operation); // if this operation has brought in more phase ops for ast transforms, keep recording them // in master list of other phases and keep processing them for this phase. recordPhaseOpsInAllOtherPhases(currPhase); currentPhaseNewOps = newPhaseOperations[currPhase]; } }