new HashMap<JLocalVariable, JExpression>(),new HashMap());
new HashMap<JLocalVariable, JExpression>(), new HashMap<JLocalVariable, JLiteral>());
    public Object visitBlockStatement(JBlock oldBlock,            JavaStyleComment[] comments) {        //SIRPopExpression oldPrevPop = prevPop;        // non-null when combining a sequence of pop statements.        SIRPopExpression prevPop = null;                JBlock newBlock = (JBlock)super.visitBlockStatement(oldBlock,comments);                List /*<JStatement>*/ oldStatements = newBlock.getStatements();        List /*<JStatement>*/ simplifiedStatements = new LinkedList();        for (Iterator i = oldStatements.iterator(); i.hasNext();) {            Object o = i.next();	    // null statments (which may not exist, just following others here)	    // and EmptyStatements do not go into the list of returned 	    // statements.            if (o != null && !(o instanceof JEmptyStatement)) {	        // getting a pop statment, which may have been a sequence	        // of pop statements in newBlock which could have been 	        // sequence of pop statments in self.                if ((o instanceof JExpressionStatement)                        && ((JExpressionStatement) (o)).getExpression() instanceof SIRPopExpression) {                    // found a pop.                    SIRPopExpression popExpr = (SIRPopExpression) ((JExpressionStatement) o)                            .getExpression();                    if (prevPop != null && prevPop.getType().equals(popExpr.getType())) {                        // combine with immediately previous pop if any and elide                        prevPop.setNumPop(popExpr.getNumPop()                                + prevPop.getNumPop());                        continue;                    } else {                        // no immediately previous pop in block, but this                        // could be previous for the next statement.                        prevPop = popExpr;                        simplifiedStatements.add(o);                        continue;                    } // assert false : "execution does not get here";                } else {                     LoopIterInfo forLoopInfo = null;                    SIRPopExpression popExpr = null;                    // determine if for loop with constant number of iterations                    // the body of which if a single pop statment.  If so                    // forLoopInfo will be set non-null, else it will remain null.                    if (o instanceof JForStatement) {                        JForStatement forStmt = (JForStatement)o;                        JStatement body = forStmt.getBody();                        if ((body instanceof JExpressionStatement)                                && ((JExpressionStatement)body).getExpression() instanceof SIRPopExpression) {                            popExpr = (SIRPopExpression) ((JExpressionStatement)body).getExpression();                            forLoopInfo = LoopIterInfo.getLoopInfo(forStmt.getInit(),                                                                   forStmt.getCondition(),                                                                   forStmt.getIncrement(),                                                                   forStmt.getBody(),                                                                   new HashMap<JLocalVariable, JExpression>(),new HashMap());                        }                        // for loop that we are not going to process:                        // make sure body is a block, otherwise some code generators                        // (at least rstream) generate incorrect code.                        if (forLoopInfo == null && ! (body instanceof JBlock)) {                            JBlock block = new JBlock();                            block.addStatement(body);                            forStmt.setBody(block);                        }                    }                    if (forLoopInfo != null) {                        int popCount = popExpr.getNumPop() * LoopIterInfo.getNumIterations(forLoopInfo);                        if (popCount > 0) {   // don't do anything of for loop executes 0 times.                            if (prevPop != null && prevPop.getType().equals(popExpr.getType())) {                                prevPop.setNumPop(prevPop.getNumPop()+popCount);                            } else {                                popExpr.setNumPop(popCount);                                prevPop = popExpr;                                simplifiedStatements.add(new JExpressionStatement(popExpr));                            }                        }                    } else {                        prevPop = null;    // don't combine pops across this statement                        simplifiedStatements.add(o);                    }                }            }        }        // empty block becomes empty statement for surrounding block to elide        int newLen = simplifiedStatements.size();        if (newLen == 0) {            return new JEmptyStatement();        }        if (newLen == 1) {            // single statement            // so an outer block can see a pop statement if            // the block reduces to one.            return simplifiedStatements.get(0);        }         // Return processed block        return new JBlock(newBlock.getTokenReference(),                simplifiedStatements,newBlock.getComments());    }