Check the type for a given arithmetic operator. Such an operator has the type
int, and all children should also produce values of type int.

@param expr
@return
761417
private SemanticType checkIntegerOperator(Expr.BinaryOperator expr, Environment environment) {
		checkOperand(Type.Int, expr.getFirstOperand(), environment);
		checkOperand(Type.Int, expr.getSecondOperand(), environment);
		return Type.Int;
	}
1351095
static Parser<Expression> compare(Parser<Expression> expr) {
    return Parsers.or(
        compare(expr, ">", Op.GT), compare(expr, ">=", Op.GE),
        compare(expr, "<", Op.LT), compare(expr, "<=", Op.LE),
        compare(expr, "=", Op.EQ), compare(expr, "<>", Op.NE),
        nullCheck(expr), like(expr), between(expr));
  }
404188
protected void diagnoseLineNumber(Expression expr)
  {
    ElemTemplateElement e = getElemFromExpression(expr);
    System.err.println("   " + e.getSystemId() + " Line " + e.getLineNumber());
  }
21827
@Override
    public <T extends Number> T numberValueExact(Class<T> numberType) {
        return ConvertNumberValue.ofExact(numberType, number);
    }
692259
private ExprKraken parseAddExpr()
  {
    ExprKraken left = parseMulExpr();

    while (true) {
      Token token = scanToken();

      switch (token) {
      case PLUS:
        left = new BinaryExpr(BinaryOp.ADD, left, parseSimpleTerm());
        break;
      case MINUS:
        left = new BinaryExpr(BinaryOp.SUB, left, parseSimpleTerm());
        break;

      default:
        _token = token;
        return left;
      }
    }
  }
1141830
private BigInteger evalAndExpression(AstNode exprAst) {
    AstNode operand = exprAst.getFirstChild();
    BigInteger result = evalToInt(operand);

    while ((operand = getNextOperand(operand)) != null) {
      result = result.and(evalToInt(operand));
    }

    return result;
  }
501552
private void checkOperand(Type type, Expr operand, Environment environment) {
		checkIsSubtype(type, checkExpression(operand, environment), environment, operand);
	}
239346
public List<AbstractExpression> bindingToIndexedExpression(
            AbstractExpression expr) {
        // Defer the result construction for as long as possible on the
        // assumption that this function mostly gets applied to eliminate
        // negative cases.
        if (m_type != expr.m_type) {
            // The only allowed difference in expression types is between a
            // parameter and its original constant value.
            // That's handled in the independent override.
            return null;
        }

        // From here, this is much like the straight equality check,
        // except that this function and "equals" must each call themselves
        // in their recursions.

        // Delegating to this factored-out component of the "equals"
        // implementation eases simultaneous refinement of both methods.
        if ( ! hasEqualAttributes(expr)) {
            return null;
        }
        // The derived classes have verified that any added attributes
        // are identical.

        // Check that the presence, or lack, of children is the same
        if ((expr.m_left == null) != (m_left == null)) {
            return null;
        }
        if ((expr.m_right == null) != (m_right == null)) {
            return null;
        }
        if ((expr.m_args == null) != (m_args == null)) {
            return null;
        }

        // Check that the children identify themselves as matching
        List<AbstractExpression> leftBindings = null;
        if (m_left != null) {
            leftBindings = m_left.bindingToIndexedExpression(expr.m_left);
            if (leftBindings == null) {
                return null;
            }
        }
        List<AbstractExpression> rightBindings = null;
        if (m_right != null) {
            rightBindings = m_right.bindingToIndexedExpression(expr.m_right);
            if (rightBindings == null) {
                return null;
            }
        }
        List<AbstractExpression> argBindings = null;
        if (m_args != null) {
            if (m_args.size() != expr.m_args.size()) {
                return null;
            }
            argBindings = new ArrayList<>();
            int ii = 0;
            // iterate the args lists in parallel, binding pairwise
            for (AbstractExpression rhs : expr.m_args) {
                AbstractExpression lhs = m_args.get(ii++);
                List<AbstractExpression> moreBindings =
                        lhs.bindingToIndexedExpression(rhs);
                if (moreBindings == null) { // fail on any non-match
                    return null;
                }
                argBindings.addAll(moreBindings);
            }
        }

        // It's a match, so gather up the details.
        // It's rare (if even possible) for the same bound parameter to get
        // listed twice, so don't worry about duplicate entries, here.
        // That should not cause any issue for the caller.
        List<AbstractExpression> result = new ArrayList<>();
        if (leftBindings != null) { // null here can only mean no left child
            result.addAll(leftBindings);
        }
        if (rightBindings != null) { // null here can only mean no right child
            result.addAll(rightBindings);
        }
        if (argBindings != null) { // null here can only mean no args
            result.addAll(argBindings);
        }
        return result;
    }
1208683
public static Object execExpr(ExprResolver exprResolver, String expression) {

        try {
            // 返回输出的内容
            return exprResolver.executeExpr(expression);

        } catch (Exception e) {

            // 输出日志
            if (logger.isDebugEnabled()) {
                logger.debug("Can't resolving expression: " + expression, e);
            }
        }

        return null;
    }
15494
public static <T extends Number> WindowOver<T> varSamp(Expression<T> expr) {
        return new WindowOver<T>(expr.getType(), SQLOps.VARSAMP, expr);
    }
1209487
private boolean validRawTypeOfTypeExpression(Node expr) {
    // The expression must have two children. The rawTypeOf keyword and the
    // parameter
    if (!checkParameterCount(expr, Keywords.RAWTYPEOF)) {
      return false;
    }
    // The parameter must be a valid type expression
    if (!validTypeTransformationExpression(getCallArgument(expr, 0))) {
      warnInvalidInside(Keywords.RAWTYPEOF.name, expr);
      return false;
    }
    return true;
  }
733594
@Requires("e != null")
  @Ensures("result != null")
  private Boolean isContractedType(TypeElement e) {
    Boolean result = Boolean.FALSE;

    /* The current element has contracts on its annotations. */
    result = hasContracts(e.getAnnotationMirrors());

    /* Checks superclass. */
    if (!result) {
      Element superclass =
          utils.typeUtils.asElement(e.getSuperclass());
      if (superclass != null) {
        /* Scans up in the syntax tree looking for contract annotations. */
        result = superclass.accept(this, null);
      }
    }

    /* Checks interfaces. */
    if (!result) {
      Collection<? extends TypeMirror> interfaces = e.getInterfaces();
      for (TypeMirror i : interfaces) {
        Element iface = utils.typeUtils.asElement(i);
        result = iface.accept(this, null);
        if (result) {
          break;
        }
      }
    }

    /* Scan the enclosed elements of this. */
    if (!result) {
      List<? extends Element> enclosed = e.getEnclosedElements();
      for (Element element : enclosed) {
        result = element.accept(this, null);
        if (result) {
          break;
        }
      }
    }

    return result;
  }
1286473
public static function isExpressionNumeric($expr)
	{
		// Trim the expression and remove parentheses that are not part of a function call. PCRE
		// does not support lookbehind assertions of variable length so we have to flip the string.
		// We exclude the XPath operator "div" (flipped into "vid") to avoid false positives
		$expr = strrev(preg_replace('(\\((?!\\s*(?!vid(?!\\w))\\w))', ' ', strrev($expr)));
		$expr = str_replace(')', ' ', $expr);
		if (preg_match('(^\\s*([$@][-\\w]++|-?\\.\\d++|-?\\d++(?:\\.\\d++)?)(?>\\s*(?>[-+*]|div)\\s*(?1))++\\s*$)', $expr))
		{
			return true;
		}

		return false;
	}
1174720
public static <A extends Number & Comparable<?>> NumberExpression<Double> exp(Expression<A> num) {
        return Expressions.numberOperation(Double.class, Ops.MathOps.EXP, num);
    }
658808
private boolean validUnionTypeExpression(Node expr) {
    // The expression must have at least three children: The union keyword and
    // two type expressions
    if (!checkParameterCount(expr, Keywords.UNION)) {
      return false;
    }
    int paramCount = getCallParamCount(expr);
    // Check if each of the members of the union is a valid type expression
    for (int i = 0; i < paramCount; i++) {
      if (!validTypeTransformationExpression(getCallArgument(expr, i))) {
        warnInvalidInside("union type", expr);
        return false;
      }
    }
    return true;
  }
160347
public static ExprString toExprString(Expression expr) {
	if (expr instanceof ExprString) return (ExprString) expr;
	if (expr instanceof Literal) return expr.getFactory().createLitString(((Literal) expr).getString(), expr.getStart(), expr.getEnd());
	return new CastString(expr);
    }
1076329
function where (expr, operator) {
    if (this.typecheck) t.typecheck('where', [expr, operator]);
    if ('string'===typeof expr) return 'where '+expr;
    return 'where ' + expr.join(' '+(operator||'and')+' ');
}