{@code (foo)} can be a parenthesized expression, or the prefix of a cast expression,
depending on whether there's an expression following.
764116
static final Parser<Expression> castOrExpression(Parser<Expression> expr) {
    Parser<Expression> explicitCast =
        Parsers.sequence(paren(TypeLiteralParser.TYPE_LITERAL), expr, CastExpression::new);
    return explicitCast.or(paren(expr));
  }
103443
function parseConditionalExpression() {
        var expr, previousAllowIn, consequent, alternate, startToken;

        startToken = lookahead;

        expr = inheritCoverGrammar(parseBinaryExpression);
        if (match('?')) {
            lex();
            previousAllowIn = state.allowIn;
            state.allowIn = true;
            consequent = isolateCoverGrammar(parseAssignmentExpression);
            state.allowIn = previousAllowIn;
            expect(':');
            alternate = isolateCoverGrammar(parseAssignmentExpression);

            expr = new WrappingNode(startToken).finishConditionalExpression(expr, consequent, alternate);
            isAssignmentTarget = isBindingElement = false;
        }

        return expr;
    }
423313
final public Expression ValuePrefix() throws ParseException {
  Expression ret;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case INTEGER_LITERAL:
    case FLOATING_POINT_LITERAL:
    case STRING_LITERAL:
    case TRUE:
    case FALSE:
    case NULL:
      ret = Literal();
      break;
    case LPAREN:
      jj_consume_token(LPAREN);
      ret = Expression();
      jj_consume_token(RPAREN);
      break;
    default:
      jj_la1[27] = jj_gen;
      if (jj_2_1(2147483647)) {
        ret = FunctionInvocation();
      } else {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case IDENTIFIER:
          ret = NamedValue();
          break;
        default:
          jj_la1[28] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    }
      {if (true) return ret;}
    throw new Error("Missing return statement in function");
  }
556592
private ParseTree parseAdditiveExpression() {
    SourcePosition start = getTreeStartLocation();
    ParseTree left = parseMultiplicativeExpression();
    while (peekAdditiveOperator()) {
      Token operator = nextToken();
      ParseTree right = parseMultiplicativeExpression();
      left = new BinaryOperatorTree(getTreeLocation(start), left, operator, right);
    }
    return left;
  }
578975
static boolean isExpression(String expression) {

        if (null == expression) {
            return false;
        }

        //check to see if attribute has an expression
        int start = expression.indexOf("#{");
        return start != -1 && expression.indexOf('}', start+2) != -1;
    }
885073
private CompositeExpression parseMoreExpressions(CompositeExpression expr) {
        if (tokens.positiveLookahead(AND)) {
            tokens.consume();
            expr = expr.and(parseSemVerExpression());
        } else if (tokens.positiveLookahead(OR)) {
            tokens.consume();
            expr = expr.or(parseSemVerExpression());
        }
        return expr;
    }
770152
function parseConditionalExpression() {
        var expr, previousAllowIn, consequent, alternate, startToken;

        startToken = lookahead;

        expr = parseBinaryExpression();
        if (match('?')) {
            lex();
            previousAllowIn = state.allowIn;
            state.allowIn = true;
            consequent = parseAssignmentExpression();
            state.allowIn = previousAllowIn;
            expect(':');
            alternate = parseAssignmentExpression();

            expr = new WrappingNode(startToken).finishConditionalExpression(expr, consequent, alternate);
        }

        return expr;
    }
48734
public static ParenthesizedExpression parenthesizeAndReplace(Expression expression) {
    ParenthesizedExpression newExpr = new ParenthesizedExpression();
    expression.replaceWith(newExpr);
    newExpr.setExpression(expression);
    return newExpr;
  }
122963
private TemplateExpression processJavaExpression(String expressionString) {
    Expression expression;
    try {
      expression = JavaParser.parseExpression(expressionString);
    } catch (ParseProblemException parseException) {
      logger.error("Couldn't parse Expression, make sure it is valid Java.",
          expressionString);
      throw parseException;
    }

    resolveTypesUsingImports(expression);
    resolveStaticMethodsUsingImports(expression);

    checkMethodNames(expression);

    // Find the parameters used by the expression
    List<VariableInfo> expressionParameters = new LinkedList<>();
    findExpressionParameters(expression, expressionParameters);

    // If there is a cast first, we use this as the type of our expression
    if (currentProp == null) {
      expression = getTypeFromCast(expression);
    }

    // Update the expression as it might have been changed
    expressionString = expression.toString();

    // Add the resulting expression to our result
    return result.addExpression(expressionString,
        currentExpressionReturnType,
        currentProp == null,
        expressionParameters);
  }
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;
    }
1030636
private void parseAdditiveExpr() throws TTXPathException {

        parseMultiplicativeExpr();

        String op = mToken.getContent();
        while (is(TokenType.PLUS, true) || is(TokenType.MINUS, true)) {

            // identify current operator kind
            // for (Operators op : Operators.values()) {
            // if (is(op.getOpName(), true)) {

            // parse second operand axis

            mPipeBuilder.addExpressionSingle();

            parseMultiplicativeExpr();

            mPipeBuilder.addOperatorExpression(getTransaction(), op);
            op = mToken.getContent();
        }
        // }
        // }
    }
755718
public final void instanceOfExpression() throws RecognitionException {
		int instanceOfExpression_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 117) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1166:5: ( relationalExpression ( 'instanceof' type )? )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1166:9: relationalExpression ( 'instanceof' type )?
			{
			pushFollow(FOLLOW_relationalExpression_in_instanceOfExpression5248);
			relationalExpression();
			state._fsp--;
			if (state.failed) return;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1166:30: ( 'instanceof' type )?
			int alt149=2;
			int LA149_0 = input.LA(1);
			if ( (LA149_0==91) ) {
				alt149=1;
			}
			switch (alt149) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1166:31: 'instanceof' type
					{
					match(input,91,FOLLOW_91_in_instanceOfExpression5251); if (state.failed) return;
					pushFollow(FOLLOW_type_in_instanceOfExpression5253);
					type();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 117, instanceOfExpression_StartIndex); }

		}
	}
13295
function (expression, types) {
        var args = types.split(" | "),
            i, len, found = false;

        for (i=0, len=args.length; i < len && !found && expression.hasNext(); i++) {
            found = this.isType(expression, args[i]);
        }

        return found;
    }
1228470
private boolean passesExpression(LoggingEvent event) {
    if (event != null) {
      if (expressionRule != null) {
        return (expressionRule.evaluate(event, null));
      }
    }
    return true;
  }
1250565
private AbstractExpression parseExpressionNode(VoltXMLElement exprNode) {
        String elementName = exprNode.name.toLowerCase();

        XMLElementExpressionParser parser = m_exprParsers.get(elementName);
        if (parser == null) {
            throw new PlanningErrorException("Unsupported expression node '" + elementName + "'");
        }
        AbstractExpression retval = parser.parse(this, exprNode);
        assert("asterisk".equals(elementName) || retval != null);
        return retval;
    }
1117845
def p_statement_notexpr(self, p):
        ''' 
        '''
        _LOGGER.debug("expresion -> ! expression")
        if p[2].type == TypedClass.BOOLEAN: 
            p[0] = TypedClass(not p[2].value, TypedClass.BOOLEAN)
        else:
            raise TypeError("operator invalid for this type")
246433
public static Expression logicalOr(List<? extends Expression> expressions) {
    return doShortCircuitingLogicalOperator(ImmutableList.copyOf(expressions), true);
  }