示例#1
0
        private static bool EvaluateAndOperator(object left, object right)
        {
            IExpression expression = new AndExpression(new ConstantExpression(left), new ConstantExpression(right));

            return (bool)expression.Evaluate(null);
        }
示例#2
0
文件: Parser.cs 项目: ajlopez/AjSharp
        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;
        }