private void whileStatement_rest() throws Exception
    {
        BasicBlock oldCurrent = currentBB;
        BasicBlock oldJoin = currentJoinBlock;
        BasicBlock loopHeader = new LoopHeader(oldCurrent);
        // the previous basic block will fall through to the header
        oldCurrent.setFallThrough(loopHeader);

        // set up the incomming basic block for the loop header
        loopHeader.setCurrentBranch(1);
        loopHeader.setIncomingBranch(oldCurrent);
        currentBB = loopHeader;
        Cmp comp = relation();

        BasicBlock loopBodyStart = new BasicBlock(loopHeader);
        BasicBlock nextBB = new BasicBlock(loopHeader);
        // the header will fall through to the loop body
        loopHeader.setFallThrough(loopBodyStart);

        currentJoinBlock = loopHeader;

        // add the branch instruction
        loopHeader.addInstruction(makeProperBranch(comp, nextBB));
        loopHeader.setCurrentBranch(2);
        if(scan.sym == Token.do_t) {
            scan.next();
            currentBB = loopBodyStart;
            env.enter();
            statSequence();
            // add branch to loop header
            currentBB.addInstruction(new Bra(loopHeader));
            // set nextBB to be laid out after the loop body
            currentBB.setNext(nextBB);
            env.exit();

            loopHeader.setIncomingBranch(currentBB);

            if(scan.sym == Token.od) {
                scan.next();
                currentBB = nextBB;
                currentJoinBlock = oldJoin;
		// move phis in the loop header out to the old join
		// block
		loopHeader.propagatePhis(env, currentJoinBlock);
            } else {
                throw new Exception("While statement: no 'od'");
            }
        } else {
            throw new Exception("While statement: no 'do'");
        }
    }