JVariableDefinition j = new JVariableDefinition(type, "j"); JStatement push = new JExpressionStatement(new SIRPushExpression(new SIRPeekExpression(new JLocalVariableExpression(j), type)));
JVariableDefinition j = new JVariableDefinition(CStdType.Integer, "j"); JStatement push = new JExpressionStatement(new SIRPushExpression(new SIRPeekExpression(new JLocalVariableExpression(j), type), type));
    static SIRFilter buildExpander(int N, int k, CType type) {        // Make core code to do replicating.  Here's what we're going for:        // for (int i=0; i<N; i++) {        //   j = 0;         //   for (; j<k; j++) {        //     push(peek(j));        //   }        // }        // pop(N*k);        // -------------        // push(peek(j));        JVariableDefinition j = new JVariableDefinition(type, "j");        JStatement push = new JExpressionStatement(new SIRPushExpression(new SIRPeekExpression(new JLocalVariableExpression(j), type)));        // for (int j=0; j<k; j++) { push(peek(j)); }        JStatement innerLoop = Utils.makeForLoop(push, new JIntLiteral(k), j);        // { j=0; innerLoop; }        JBlock innerBlock = new JBlock(new JStatement[] { new JExpressionStatement(new JAssignmentExpression(new JLocalVariableExpression(j), new JIntLiteral(0))),                                                           innerLoop });        // for (int i=0; i<N; i++) { innerBlock }        JStatement outerLoop = Utils.makeForLoop(innerBlock, N);        // now build the block of statements...        JBlock body = new JBlock();        body.addStatement(outerLoop);        // follow it up with a pop statement        body.addStatement(new JExpressionStatement(new SIRPopExpression(type, k)));        // -------------        // Make work and init functions        JMethodDeclaration work = new JMethodDeclaration(CStdType.Void,                                                         "work",                                                         JFormalParameter.EMPTY,                                                         body);        JMethodDeclaration init = SIRStream.makeEmptyInit();        // Make filter        SIRFilter result = new SIRFilter(null,                                          "AutoGeneratedExpander",                                          JFieldDeclaration.EMPTY(),                                          new JMethodDeclaration[] { init, work },                                         new JIntLiteral(k), // peek                                         new JIntLiteral(k), // pop                                         new JIntLiteral(k*N), // push                                         work, type, type);        result.setInit(init);        return result;    }