if (!tryMIV.tryMIV((JDoLoopStatement)body)) { System.out.println("Could not generate MIV indices for " + getNode().contents);
if (!StrToRStream.GENERATE_MIVS || !tryMIV.tryMIV((JDoLoopStatement)body)) { if (StrToRStream.GENERATE_MIVS) System.out.println("Could not generate MIV indices for " + getNode().contents);
    public JStatement[] getWork(JBlock enclosingBlock, boolean isInit)     {	JBlock statements = new JBlock(null, new JStatement[0], null);	//don't generate code if this filter is not needed	if (!necessary)	    return statements.getStatementArray();		int mult = StrToRStream.getMult(getNode(), isInit);	//add the declaration for the pop buffer	JStatement popBufDecl = getPopBufDecl(isInit);	if (popBufDecl != null) {	    enclosingBlock.addStatementFirst(popBufDecl);	}			//now add the declaration of the pop index and the push index	GenerateCCode.addStmtArrayFirst(enclosingBlock, getIndexDecls(isInit));	//create the loop counter to restore the peeked items from 	//the last firings of the filter to the pop buffer	if (!isInit && peekBufferSize > 0) {	    //create the loop counter	    JVariableDefinition loopCounterRestore = 		GenerateCCode.newIntLocal(RESTORECOUNTER, myUniqueID, 0);	    //add the declaration of the loop counter	    enclosingBlock.addStatementFirst(new JVariableDeclarationStatement					     (null, loopCounterRestore, null));	    statements.addStatement(peekRestoreLoop(loopCounterRestore,						       isInit));	}		//now add the for loop for the work function executions in this	//schedule	if (StrToRStream.getMult(getNode(), isInit) > 0) {	    //clone work function 	    JMethodDeclaration work = filter.getWork();	    JBlock oldBody = new JBlock(null, work.getStatements(), null);	    	    JStatement body = (JBlock)ObjectDeepCloner.deepCopy(oldBody);	    	    //before we add the body make for loop	    //get a new local variable	    JVariableDefinition forIndex = GenerateCCode.newIntLocal(FORINDEXNAME,						       myUniqueID, 0);	    	    enclosingBlock.addStatementFirst(new JVariableDeclarationStatement					     (null, forIndex, null));	    	    	    body = GenerateCCode.makeDoLoop(body, forIndex, new JIntLiteral(mult));	    	    //see if can generate MIV buffer indices, if true, then the conversion 	    //was performed	    ConvertChannelExprsMIV tryMIV = new ConvertChannelExprsMIV(this, isInit);	    if (!tryMIV.tryMIV((JDoLoopStatement)body)) {		System.out.println("Could not generate MIV indices for " + getNode().contents);		body.accept(new ConvertChannelExprs(this, isInit));	    }	    	    statements.addStatement(body);	}	//create the loop to back up the unpop'ed items from the pop buffer	//and store them into the peek buffer	if (peekBufferSize > 0) {	    //create the loop counter	    JVariableDefinition loopCounterBackup = 		GenerateCCode.newIntLocal(BACKUPCOUNTER, myUniqueID, 0);	    //add the declaration of the counter	    enclosingBlock.addStatementFirst(new JVariableDeclarationStatement					     (null, loopCounterBackup, null));	    statements.addStatement(peekBackupLoop(loopCounterBackup,						      isInit));	}	return statements.getStatementArray();    }