public static Expr binary(BinaryOperation op, OperationType type, Expr first, Expr second) { BinaryExpr expr = new BinaryExpr(); expr.setFirstOperand(first); expr.setSecondOperand(second); expr.setOperation(op); expr.setType(type); return expr; }
@Override protected Expr clone(Map<Expr, Expr> cache) { Expr known = cache.get(this); if (known != null) { return known; } BinaryExpr copy = new BinaryExpr(); cache.put(this, copy); copy.setFirstOperand(firstOperand != null ? firstOperand.clone(cache) : null); copy.setSecondOperand(secondOperand != null ? secondOperand.clone(cache) : null); copy.setOperation(operation); copy.setType(type); return copy; } }
case 0: { BinaryExpr expr = new BinaryExpr(); expr.setOperation(binaryOperations[input.readByte()]); byte valueType = input.readByte(); expr.setType(valueType > 0 ? OperationType.values()[valueType] : null);
if (b instanceof ConstantExpr && expr.getOperation() == BinaryOperation.SUBTRACT) { if (tryMakePositive((ConstantExpr) b)) { expr.setOperation(BinaryOperation.ADD);
public static Expr binary(BinaryOperation op, OperationType type, Expr first, Expr second) { BinaryExpr expr = new BinaryExpr(); expr.setFirstOperand(first); expr.setSecondOperand(second); expr.setOperation(op); expr.setType(type); return expr; }
@Override protected Expr clone(Map<Expr, Expr> cache) { Expr known = cache.get(this); if (known != null) { return known; } BinaryExpr copy = new BinaryExpr(); cache.put(this, copy); copy.setFirstOperand(firstOperand != null ? firstOperand.clone(cache) : null); copy.setSecondOperand(secondOperand != null ? secondOperand.clone(cache) : null); copy.setOperation(operation); copy.setType(type); return copy; } }
case 0: { BinaryExpr expr = new BinaryExpr(); expr.setOperation(binaryOperations[input.readByte()]); byte valueType = input.readByte(); expr.setType(valueType > 0 ? OperationType.values()[valueType] : null);
if (b instanceof ConstantExpr && expr.getOperation() == BinaryOperation.SUBTRACT) { if (tryMakePositive((ConstantExpr) b)) { expr.setOperation(BinaryOperation.ADD);