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