code: private Expression joinOperations(Expression result, String operation, Expression next) {
          if (!(result instanceof Operation)) {
              return new Operation(operation, result, next);
          }
          Operation farRight = (Operation) result;
          while (farRight.getRight() instanceof Operation) {
              farRight = (Operation) farRight.getRight();
          }
          if (!farRight.isProtect() && ("+".equals(farRight.getOperation()) || "-".equals(farRight.getOperation()))) {
              farRight.setRight(new Operation(operation, farRight.getRight(), next));
              return result;
          }
  
          return new Operation(operation, result, next);
      }
docs: /*
  Takes care of operator precedence by modifying the AST appropriately