private static bool EvaluateOrOperator(object left, object right) { IExpression expression = new OrExpression(new ConstantExpression(left), new ConstantExpression(right)); return (bool)expression.Evaluate(null); }
private IExpression ParseBinaryLogicalExpressionLevelOne() { IExpression expression = this.ParseBinaryLogicalExpressionLevelTwo(); if (expression == null) return null; while (this.TryParse(TokenType.Operator, "||")) { Token oper = this.lexer.NextToken(); IExpression right = this.ParseBinaryLogicalExpressionLevelTwo(); expression = new OrExpression(expression, right); } return expression; }