Determines if specified expression is an order method call

@param expr
@return
541075
public boolean isOrderExpression(GroovyExpression expr) {
        if (expr instanceof FunctionCallExpression) {
            FunctionCallExpression functionCallExpression = (FunctionCallExpression) expr;
            if (functionCallExpression.getFunctionName().equals(ORDER_METHOD)) {
                return true;
            }
        }
        return false;
    }
967696
protected boolean isParam(ExpressionNode expr)
  {
  	while(null != expr)
  	{
  		if(expr instanceof ElemTemplateElement)
  			break;
  		expr = expr.exprGetParent();
  	}
  	if(null != expr)
  	{
  		ElemTemplateElement ete = (ElemTemplateElement)expr;
  		while(null != ete)
  		{
  			int type = ete.getXSLToken();
  			switch(type)
  			{
  				case Constants.ELEMNAME_PARAMVARIABLE:
  					return true;
  				case Constants.ELEMNAME_TEMPLATE:
  				case Constants.ELEMNAME_STYLESHEET:
  					return false;
  			}
  			ete = ete.getParentElem();
  		}
  	}
  	return false;
  	
  }
45294
public Statement store(final Expression expr, Label firstVarInstruction) {
    return store(expr, Optional.of(firstVarInstruction));
  }
411585
private boolean validOperationExpression(Node expr) {
    String name = getCallName(expr);
    Keywords keyword = nameToKeyword(name);
    switch (keyword) {
      case COND:
        return validConditionalExpression(expr);
      case MAPUNION:
        return validMapunionExpression(expr);
      case MAPRECORD:
        return validMaprecordExpression(expr);
      case TYPEOFVAR:
        return validTypeOfVarExpression(expr);
      case INSTANCEOF:
        return validInstanceOfExpression(expr);
      case PRINTTYPE:
        return validPrintTypeExpression(expr);
      case PROPTYPE:
        return validPropTypeExpression(expr);
      default:
        throw new IllegalStateException("Invalid type transformation operation");
    }
  }
548013
public static boolean isConstructorCall(Expression expression, List<String> classNames) {
        return expression instanceof ConstructorCallExpression && classNames.contains(expression.getType().getName());
    }
770601
private Pattern getPattern(String expr)
    {
        Pattern pattern = patterns.get(expr);
        if(pattern == null)
        {
            pattern = Pattern.compile(expr);
            patterns.put(expr, pattern);
        }
        return pattern;
    }
89088
@SuppressWarnings("unchecked")
    public static <T> Expression<T> extract(Expression<T> expr) {
        if (expr != null) {
            final Class<?> clazz = expr.getClass();
            if (clazz == PathImpl.class || clazz == PredicateOperation.class || clazz == ConstantImpl.class) {
                return expr;
            } else {
                return (Expression<T>) expr.accept(ExtractorVisitor.DEFAULT, null);
            }
        } else {
            return null;
        }
    }
93002
public static boolean isExtractable(GroovyExpression expr) {

        HasForbiddenType hasForbiddenTypePredicate = new HasForbiddenType(FACTORY);

        //alias could conflict with alias in parent traversal
        hasForbiddenTypePredicate.addForbiddenType(TraversalStepType.SIDE_EFFECT);

        //inlining out(), in() steps will change the result of calls after the and/or()
        hasForbiddenTypePredicate.addForbiddenType(TraversalStepType.FLAT_MAP_TO_ELEMENTS);
        hasForbiddenTypePredicate.addForbiddenType(TraversalStepType.FLAT_MAP_TO_VALUES);
        hasForbiddenTypePredicate.addForbiddenType(TraversalStepType.BARRIER);
        hasForbiddenTypePredicate.addForbiddenType(TraversalStepType.MAP_TO_ELEMENT);
        hasForbiddenTypePredicate.addForbiddenType(TraversalStepType.MAP_TO_VALUE);

        //caller expects to be able to continue the traversal.  We can't end it
        hasForbiddenTypePredicate.addForbiddenType(TraversalStepType.END);


        //we can't inline child traversals
        hasForbiddenTypePredicate.addForbiddenType(TraversalStepType.SOURCE);
        hasForbiddenTypePredicate.addForbiddenType(TraversalStepType.START);
        hasForbiddenTypePredicate.addForbiddenType(TraversalStepType.SIDE_EFFECT);
        hasForbiddenTypePredicate.addForbiddenType(TraversalStepType.NONE);
        hasForbiddenTypePredicate.addForbiddenType(TraversalStepType.BRANCH);

        ExpressionFinder forbiddenExpressionFinder = new ExpressionFinder(hasForbiddenTypePredicate);
        GremlinQueryOptimizer.visitCallHierarchy(expr, forbiddenExpressionFinder);
        return ! forbiddenExpressionFinder.isExpressionFound();
    }
834487
private function isIgnoredExpressionType(Node\Expr $expr)
    {
        /**
         * We don't care about assignments, because:
         * 1. If the assigned expression ($expr->expr) is a yield expression, then:
         *  a. It had been added before moving to 7.x and is parenthesized (assigning
         *     yield expressions without parenthesis causes a syntax error in 5.x).
         *     And parenthesized yields have the same meaning in both 5.x and 7.x
         *  b. It had been added after moving to 7.x and should be left alone
         * 2. If the assigned expression is not a yield expression, then:
         *  a. It has a nested yield expression which will get caught by the enterNode method
         *  b. It has no nested yield expression and is not relevant to this visitor.
         */
        $isAssignment = $expr instanceof Node\Expr\Assign || $expr instanceof Node\Expr\AssignOp;
        $isClosureDeclaration = $expr instanceof Node\Expr\Closure;
        $isAnonymousClassInstantiation = $expr instanceof Node\Expr\New_
            && $expr->class instanceof Node\Stmt\Class_
            && !$expr->class->name;

        return $isAssignment
            || $isClosureDeclaration
            || $isAnonymousClassInstantiation
        ;
    }
663989
private static int order(Method method) {
        final Order order = findFirst(method, Order.class).orElse(null);
        return order != null ? order.value() : 0;
    }
560241
public Expr call(String method, Expr argument1) {
      return new Expr(
        expr + "." + method + "(" + argument1.toSwiftCode() + ")",
        false,
        containsThrow || argument1.containsThrow,
        false);
    }
1309438
protected Expression visitExpression(Expression expr) {
        if (expr == null) {
            return null;
        }

        Expression newExpr = (Expression)expr.accept(this);
        if (expr != newExpr) {
            Type newType = newExpr.getType();

            if (newType == null || !newType.equals(expr.getType())) {
                Iterator<Expression.Conversion> it =
                    expr.getConversionChain().iterator();
                while (it.hasNext()) {
                    Expression.Conversion conv = it.next();
                    newExpr.convertTo
                        (conv.getToType(), conv.isCastPreferred());
                }
            }
        }
        return newExpr;
    }
1041015
def p_idcall_expr(p):
      # This can be a function call or a string index
    p[0] = make_call(p[1], p.lineno(1), p[2])
    if p[0] is None:
        return

    if p[0].token in ('STRSLICE', 'VAR', 'STRING'):
        entry = SYMBOL_TABLE.access_call(p[1], p.lineno(1))
        entry.accessed = True
        return

    # TODO: Check that arrays really needs kind=function to be set
    # Both array accesses and functions are tagged as functions
    # functions also has the class_ attribute set to 'function'
    p[0].entry.set_kind(KIND.function, p.lineno(1))
    p[0].entry.accessed = True
699627
private static Node asDetachedExpression(Node expr) {
    switch (expr.getToken()) {
      case SPREAD:
        expr = IR.arraylit(expr.detach()).srcref(expr);
        break;
      default:
        break;
    }

    if (expr.getParent() != null) {
      expr.detach();
    }

    checkState(IR.mayBeExpression(expr), expr);
    return expr;
  }
115075
public static <T> Expression<T> list(Class<T> clazz, Expression<?>... exprs) {
        return list(clazz, ImmutableList.copyOf(exprs));
    }
293189
private boolean validInstanceOfExpression(Node expr) {
    // The expression must have two children:
    // - The instanceOf keyword
    // - A string
    if (!checkParameterCount(expr, Keywords.INSTANCEOF)) {
      return false;
    }
    if (!validTypeTransformationExpression(getCallArgument(expr, 0))) {
      warnInvalidInside(Keywords.INSTANCEOF.name, expr);
      return false;
    }
    return true;
  }
726458
@Override
    public List<AbstractExpression> bindingToIndexedExpression(AbstractExpression expr) {
        if (m_originalValue == null || ! m_originalValue.equals(expr)) {
            return null;
        }
        // This parameter's value was matched, so return this as one bound parameter.
        List<AbstractExpression> result = new ArrayList<AbstractExpression>();
        result.add(this);
        return result;
    }