Exemple #1
0
        public virtual Ast.Expression VisitBinaryExpression(Ast.BinaryExpression expression)
        {
            this.Visit(expression.Left);
            this.Visit(expression.Right);

            return(expression);
        }
Exemple #2
0
        public override Ast.Expression VisitBinaryExpression(Ast.BinaryExpression expression)
        {
            this.Visit(expression.Left);
            writer.Write(GetBinaryOperator(expression.Operator));
            this.Visit(expression.Right);

            return(expression);
        }
            public override Ast.Expression VisitBinaryExpression(Ast.BinaryExpression expression)
            {
                this.Visit(expression.Left);

                var left = this.expression;

                this.Visit(expression.Right);

                var right = this.expression;

                this.expression = Expression.MakeBinary(ExpressionType.Equal, left, right);

                return(expression);
            }
Exemple #4
0
            public override void Visit(Ast.BinaryExpression node)
            {
                switch (node.Operator)
                {
                case BinaryOperator.ValueEquality:
                    PushComparison(node.Left, node.Right, ComparisonOperator.ValueEquality);
                    break;

                case BinaryOperator.ValueInequality:
                    PushComparison(node.Left, node.Right, ComparisonOperator.ValueEquality);
                    Negate();
                    break;

                case BinaryOperator.LessThan:
                    PushComparison(node.Left, node.Right, ComparisonOperator.Smaller);
                    break;

                case BinaryOperator.GreaterThan:
                    PushComparison(node.Left, node.Right, ComparisonOperator.Greater);
                    break;

                case BinaryOperator.GreaterThanOrEqual:
                    PushComparison(node.Left, node.Right, ComparisonOperator.Smaller);
                    Negate();
                    break;

                case BinaryOperator.LessThanOrEqual:
                    PushComparison(node.Left, node.Right, ComparisonOperator.Greater);
                    Negate();
                    break;

                case BinaryOperator.LogicalOr:
                    Push(new OrExpression(Convert(node.Left), Convert(node.Right)));
                    break;

                case BinaryOperator.LogicalAnd:
                    Push(new AndExpression(Convert(node.Left), Convert(node.Right)));
                    break;

                default:
                    UnsupportedExpression(node);
                    break;
                }
            }