JExpression addExpr   = new JAddExpression(null, indexExpr, new JIntLiteral(1)); JExpression maxUseExpr= new JIntLiteral(tupleData.getMaxUse(t) + 1); JExpression modExpr   = new JModuloExpression(null, addExpr, maxUseExpr); JExpression assignExpr= new JAssignmentExpression(null, indexExpr, modExpr); return new JExpressionStatement(null, assignExpr, null);
JExpression minusExpr = new JMinusExpression(null, indexExpr, new JIntLiteral(1));   JExpression decExpr   = new JAssignmentExpression(null, indexExpr, minusExpr); JStatement  decStmt   = new JExpressionStatement(null, decExpr, null);   JExpression condExpr   = new JRelationalExpression(null, OPE_LT, indexExpr, new JIntLiteral(0)); JExpression maxUseExpr = new JIntLiteral(tupleData.getMaxUse(t)); JExpression resetExpr  = new JAssignmentExpression(null, indexExpr, maxUseExpr); JStatement  resetStmt  = new JExpressionStatement(null, resetExpr, null); JStatement  emptyStmt  = new JEmptyStatement(null, null); JStatement ifStmt      = new JIfStatement(null,       condExpr,   resetStmt,  emptyStmt,  null);       body.addStatement(decStmt); body.addStatement(ifStmt);
    public JStatement makeIndexUpdateStatement(LinearComputationTuple t, RedundancyReplacerData tupleData) {	JExpression indexExpr = makeFieldAccessExpression(tupleData.getName(t)+INDEX_POSTFIX);	JExpression addExpr   = new JAddExpression(null, indexExpr, new JIntLiteral(1));	JExpression maxUseExpr= new JIntLiteral(tupleData.getMaxUse(t) + 1);	JExpression modExpr   = new JModuloExpression(null, addExpr, maxUseExpr);	JExpression assignExpr= new JAssignmentExpression(null, indexExpr, modExpr);	return new JExpressionStatement(null, assignExpr, null);    }