Esempio n. 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);
        }
Esempio n. 2
0
        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;
        }