protected Expression reOrder(Expression left, Expression right, BinaryOperation.Op op) {
        if (right instanceof BinaryOperation) {
            BinaryOperation rightOp = (BinaryOperation) right;
            if (!rightOp.isSealed() && rightOp.getOp().getPriority() == op.getPriority()) {
                replaceLeft(rightOp, left, op);
                return right;
            }
        }
        return new BinaryOperation(op, left, right);
    }
protected Expression reOrder ( Expression left , Expression right , BinaryOperation . Op op ) { if ( right instanceof BinaryOperation ) { BinaryOperation rightOp = ( BinaryOperation ) right ; if ( ! rightOp . isSealed ( ) && rightOp . getOp ( ) . getPriority ( ) == op . getPriority ( ) ) { replaceLeft ( rightOp , left , op ) ; return right ; } } return new BinaryOperation ( op , left , right ) ; }
/*
Reorders the operands of the given operation in order to generate a "left handed" AST which performs evaluations
in natural order (from left to right).