* the left hand size must be computed twice, we have to replace any
* left-hand side expressions that could have side effects with
* temporaries, so that they are only run once.
*/
final int pushUsedLocals = localIndex;
JMultiExpression multi = new JMultiExpression(program,
x.getSourceInfo());
ReplaceSideEffectsInLvalue replacer = new ReplaceSideEffectsInLvalue(
multi);
JExpression newLhs = replacer.accept(x.getLhs());
localIndex = pushUsedLocals;
JNullLiteral litNull = program.getLiteralNull();
JBinaryOperation operation = new JBinaryOperation(program,
x.getSourceInfo(), newLhs.getType(), JBinaryOperator.DIV, newLhs,
x.getRhs());
JBinaryOperation asg = new JBinaryOperation(program, x.getSourceInfo(),
newLhs.getType(), JBinaryOperator.ASG, newLhs, operation);
JMultiExpression multiExpr = replacer.getMultiExpr();
if (multiExpr.exprs.isEmpty()) {
// just use the split assignment expression
ctx.replaceMe(asg);
} else {
// add the assignment as the last item in the multi