| Expression ( "<>" | "=" ) Expression )
554611
final public Selector ComparisonPredicate() throws ParseException {
                                   Selector left, right; int op;
    left = Expression();
    op = ComparisonOperator();
    right = Expression();
    {if (true) return new OperatorImpl(op, left, right);}
    throw new Error("Missing return statement in function");
  }
778351
public static Expression contains(String expression, String substring) {
        return contains(x(expression), substring);
    }
353213
public final void inlineListExpression() throws RecognitionException {
		try {
			// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:605:5: ( LEFT_SQUARE ( expressionList )? RIGHT_SQUARE )
			// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:605:9: LEFT_SQUARE ( expressionList )? RIGHT_SQUARE
			{
			match(input,LEFT_SQUARE,FOLLOW_LEFT_SQUARE_in_inlineListExpression3531); if (state.failed) return;
			// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:605:21: ( expressionList )?
			int alt69=2;
			int LA69_0 = input.LA(1);
			if ( (LA69_0==BOOL||(LA69_0 >= DECIMAL && LA69_0 <= DIV)||LA69_0==DOT||LA69_0==FLOAT||LA69_0==HEX||(LA69_0 >= ID && LA69_0 <= INCR)||(LA69_0 >= LEFT_PAREN && LA69_0 <= LESS)||LA69_0==MINUS||LA69_0==NEGATION||LA69_0==NULL||LA69_0==PLUS||LA69_0==QUESTION_DIV||(LA69_0 >= STAR && LA69_0 <= TIME_INTERVAL)) ) {
				alt69=1;
			}
			switch (alt69) {
				case 1 :
					// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:605:21: expressionList
					{
					pushFollow(FOLLOW_expressionList_in_inlineListExpression3533);
					expressionList();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}

			match(input,RIGHT_SQUARE,FOLLOW_RIGHT_SQUARE_in_inlineListExpression3536); if (state.failed) return;
			}

		}

		catch (RecognitionException re) {
		    throw re;
		}

		finally {
			// do for sure before leaving
		}
	}
575670
@Override
  public void endVisit(ParenthesizedExpression node) {
    Expression expr = node.getExpression();
    if (expr instanceof ParenthesizedExpression) {
      Expression inner = ((ParenthesizedExpression) expr).getExpression();
      if (isEqualityExpression(inner)) {
        node.replaceWith(TreeUtil.remove(expr));
      }
    } else if (!(node.getParent() instanceof Expression) && isEqualityExpression(expr)) {
      node.replaceWith(TreeUtil.remove(expr));
    }
  }
1296739
public final void ternaryExpression() throws RecognitionException {
		ParserRuleReturnScope ts =null;
		ParserRuleReturnScope fs =null;

		 ternOp++; 
		try {
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:175:5: ( QUESTION ts= expression COLON fs= expression )
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:175:7: QUESTION ts= expression COLON fs= expression
			{
			match(input,QUESTION,FOLLOW_QUESTION_in_ternaryExpression854); if (state.failed) return;
			pushFollow(FOLLOW_expression_in_ternaryExpression858);
			ts=expression();
			state._fsp--;
			if (state.failed) return;
			match(input,COLON,FOLLOW_COLON_in_ternaryExpression860); if (state.failed) return;
			pushFollow(FOLLOW_expression_in_ternaryExpression864);
			fs=expression();
			state._fsp--;
			if (state.failed) return;
			}

		}

		catch (RecognitionException re) {
		    throw re;
		}

		finally {
			// do for sure before leaving
			 ternOp--; 
		}
	}
1293867
private Expression parseAtomList() {
        Expression exp = parseAtom();
        if (!tokenizer.current().isSymbol(",")) {
            return exp;
        }

        ValueList atomList = new ValueList(true);
        atomList.add(exp);
        while (tokenizer.current().isSymbol(",")) {
            tokenizer.consume();
            atomList.add(parseAtom());
        }

        return atomList;
    }
1089653
public static boolean isTrue(Expression expression) {
        if (expression == null) {
            return false;
        }
        if (expression instanceof PropertyExpression
                && classNodeImplementsType(((PropertyExpression) expression).getObjectExpression().getType(), Boolean.class)) {
            if (((PropertyExpression) expression).getProperty() instanceof ConstantExpression
                    && "TRUE".equals(((ConstantExpression) ((PropertyExpression) expression).getProperty()).getValue())) {
                return true;
            }
        }
        return ((expression instanceof ConstantExpression) && ((ConstantExpression) expression).isTrueExpression()) ||
                "Boolean.TRUE".equals(expression.getText());
    }
405521
protected void parse(String expression) {
        /* cleaning stacks */
        stackOperations.clear();
        stackRPN.clear();

        QScanner scanner = new QScanner(expression);

		/* loop for handling each token - shunting-yard algorithm */
        String stringToken,prevToken = null;
        while ( (stringToken=scanner.readNext()) != null) {
            if (isSeparator(stringToken)) {
                while (!stackOperations.empty()
                        && !isOpenBracket(stackOperations.lastElement())) {
                    stackRPN.push(stackOperations.pop());
                }
            } else if (isOpenBracket(stringToken)) {
                Object last = stackRPN.isEmpty() ? null : stackRPN.lastElement();
                if ( last instanceof VarPath && isFunction(((VarPath) last).field)) {
                    stackRPN.pop();
                    stackOperations.push( functions.get(((VarPath) last).field) );
                }
                stackOperations.push(stringToken);
            } else if (isCloseBracket(stringToken)) {
                while (!stackOperations.empty()
                        && !isOpenBracket(stackOperations.lastElement())) {
                    stackRPN.push(stackOperations.pop());
                }
                stackOperations.pop();
                if (!stackOperations.empty()
                        && stackOperations.lastElement() instanceof FuncOperand) {
                    stackRPN.push(stackOperations.pop());
                }
            } else if (isNumber(stringToken)) {
                if ( stringToken.indexOf('.')<0) {
                    Long i = Long.parseLong(stringToken);
                    stackRPN.push( new LongValue(i) );
                } else {
                    Double d = Double.parseDouble(stringToken);
                    stackRPN.push( new DoubleValue(d) );
                }
            } else if (operators.containsKey(stringToken)) {
                Operator op = operators.get(stringToken);
                // test for prefix op
                boolean prefix = false;
                if ( (stringToken.equals("+") || stringToken.equals("-")) &&
                         (prevToken == null ||
                       operators.containsKey(prevToken) ||
                       isOpenBracket(prevToken) ||
                       isSeparator(prevToken)
                     )
                   ) {
                    prefix = true;
                    stackRPN.push(new LongValue(0));
                }
                while (!stackOperations.empty() && ! prefix
                        && stackOperations.lastElement() instanceof Operator
                        && op.getPrecedence() <= ((Operator)stackOperations.lastElement()).getPrecedence() ) {
                    stackRPN.push(stackOperations.pop());
                }
                stackOperations.push(op);
            } else {
                if ( stringToken.startsWith("'") && stringToken.endsWith("'") ) {
                    stackRPN.push(new StringValue(stringToken.substring(1, stringToken.length() - 1)));
                } else if ( stringToken.startsWith("\"") && stringToken.endsWith("\"") ) {
                    stackRPN.push(new StringValue(stringToken.substring(1, stringToken.length() - 1)));
                } else //if ( stringToken.startsWith(VARIABLE+".") )
                {
                    stackRPN.push(new VarPath(stringToken,ctxRef));
                }
            }
            prevToken = stringToken;
        }
        while (!stackOperations.empty()) {
            stackRPN.push(stackOperations.pop());
        }

		/* reverse stack */
        Collections.reverse(stackRPN);
    }
30610
def p_expression_b_op(p):
    ''''''
    if p[2] == 'AND':
        p[0] = p[1] & p[3]
    elif p[2] == 'OR':
        p[0] = p[1] | p[3]
928938
function Expression(expr, config) {

	// Properties
	this.helper = null;
	this.context = null;
	this.escaped = null;
	this.args = null;
	this.callback = null;

	// Parse & config
	extend(this, Expression.parse(expr));
	extend(this, config);

	// Unless otherwise specified, blocks are not textOnly
	if ((typeof this.textOnly) === 'undefined') {
		this.textOnly = !this.isBlock;
	}
}
425175
function toExpression(node) {
  if (t.isExpressionStatement(node)) {
    node = node.expression;
  }

  if (t.isClass(node)) {
    node.type = "ClassExpression";
  } else if (t.isFunction(node)) {
    node.type = "FunctionExpression";
  }

  if (t.isExpression(node)) {
    return node;
  } else {
    throw new Error("cannot turn " + node.type + " to an expression");
  }
}
1063831
public void setExpression(AstNode expression) {
        assertNotNull(expression);
        expr = expression;
        expression.setParent(this);
        setLineno(expression.getLineno());
    }
1167460
public static boolean isExpressionContainsFunction(String expression) {
		
		// Si la chaine est vide : false
		if(expression == null || expression.trim().length() == 0) {
			
			// On retourne false
			return false;
		}
		
		// On split
		return isExpressionContainPattern(expression, FUNC_CHAIN_PATTERN);
	}
966536
function parseExpression() {
        var expr = parseAssignmentExpression();

        if (match(',')) {
            expr = {
                type: Syntax.SequenceExpression,
                expressions: [ expr ]
            };

            while (index < length) {
                if (!match(',')) {
                    break;
                }
                lex();
                expr.expressions.push(parseAssignmentExpression());
            }

        }
        return expr;
    }
891185
private static void checkNesting(final BooleanExpression expression,
			final List<BooleanExpression> visitedExpressions) {
		if (visitedExpressions.contains(expression)) {
			// Unfortunately, we can't give much more information - even calling toString() will overflow the stack.
			throw new SyntaxException("An expression can not contain itself.");
		}

		visitedExpressions.add(expression);

		if (expression instanceof GroupExpression) {
			GroupExpression group = (GroupExpression) expression;
			for (BooleanExpression operand : group.getOperands()) {
				checkNesting(operand, visitedExpressions);
			}
		}
	}
1071959
def p_expression_And(self, p):
        ''
        p[0] = And(p[1], p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
43018
function parseGroupExpression() {
        var expr, expressions, startToken, isValidArrowParameter = true;

        expect('(');

        if (match(')')) {
            lex();
            if (!match('=>')) {
                expect('=>');
            }
            return {
                type: PlaceHolders.ArrowParameterPlaceHolder,
                params: []
            };
        }

        startToken = lookahead;
        if (match('...')) {
            expr = parseRestElement();
            expect(')');
            if (!match('=>')) {
                expect('=>');
            }
            return {
                type: PlaceHolders.ArrowParameterPlaceHolder,
                params: [expr]
            };
        }

        if (match('(')) {
            isValidArrowParameter = false;
        }

        expr = parseAssignmentExpression();

        if (match(',')) {
            expressions = [expr];

            while (startIndex < length) {
                if (!match(',')) {
                    break;
                }
                lex();

                if (match('...')) {
                    if (!isValidArrowParameter) {
                        throwUnexpectedToken(lookahead);
                    }
                    expressions.push(parseRestElement());
                    expect(')');
                    if (!match('=>')) {
                        expect('=>');
                    }
                    return {
                        type: PlaceHolders.ArrowParameterPlaceHolder,
                        params: expressions
                    };
                } else if (match('(')) {
                    isValidArrowParameter = false;
                }

                expressions.push(parseAssignmentExpression());
            }

            expr = new WrappingNode(startToken).finishSequenceExpression(expressions);
        }


        expect(')');

        if (match('=>') && !isValidArrowParameter) {
            throwUnexpectedToken(lookahead);
        }

        return expr;
    }