Ejemplo n.º 1
0
        protected override void DoAction(int action)
        {
            Expression expression;

            switch (action)
            {
            case 2:
            {
                Expression            valueStack = this.value_stack.array[this.value_stack.top - 1].expression;
                ParameterExpression[] parameterExpressionArray = new ParameterExpression[] { this.messageParameter, this.parametersParameter };
                this.expressionTree = Expression.Lambda <Func <BrokeredMessage, IDictionary <string, object>, bool?> >(valueStack, parameterExpressionArray);
                return;
            }

            case 3:
            {
                Expression valueStack1 = this.value_stack.array[this.value_stack.top - 3].expression;
                Expression expression1 = this.value_stack.array[this.value_stack.top - 1].expression;
                this.yyval.expression = ExpressionBuilder.AndAlso(valueStack1, expression1);
                return;
            }

            case 4:
            {
                Expression valueStack2 = this.value_stack.array[this.value_stack.top - 3].expression;
                Expression expression2 = this.value_stack.array[this.value_stack.top - 1].expression;
                this.yyval.expression = ExpressionBuilder.OrElse(valueStack2, expression2);
                return;
            }

            case 5:
            {
                Expression valueStack3 = this.value_stack.array[this.value_stack.top - 1].expression;
                this.yyval.expression = ExpressionBuilder.IsFalse(valueStack3);
                return;
            }

            case 6:
            {
                Expression expression3 = this.value_stack.array[this.value_stack.top - 2].expression;
                this.yyval.expression = expression3;
                return;
            }

            case 7:
            {
                Expression valueStack4 = this.value_stack.array[this.value_stack.top - 2].expression;
                this.yyval.expression = ExpressionBuilder.Exists(valueStack4);
                return;
            }

            case 8:
            {
                Expression expression4 = this.value_stack.array[this.value_stack.top - 3].expression;
                this.yyval.expression = ExpressionBuilder.IsNull(expression4);
                return;
            }

            case 9:
            {
                Expression valueStack5 = this.value_stack.array[this.value_stack.top - 4].expression;
                this.yyval.expression = ExpressionBuilder.IsNotNull(valueStack5);
                return;
            }

            case 10:
            {
                DelayExpression delayExpression = this.value_stack.array[this.value_stack.top - 4].delay;
                Expression      expression5     = this.value_stack.array[this.value_stack.top - 2].expression;
                Expression      valueStack6     = this.value_stack.array[this.value_stack.top - 1].expression;
                this.yyval.expression = ExpressionBuilder.Like(delayExpression.GetExpression(), expression5, valueStack6);
                return;
            }

            case 11:
            {
                DelayExpression delayExpression1 = this.value_stack.array[this.value_stack.top - 5].delay;
                Expression      expression6      = this.value_stack.array[this.value_stack.top - 2].expression;
                Expression      valueStack7      = this.value_stack.array[this.value_stack.top - 1].expression;
                this.yyval.expression = ExpressionBuilder.NotLike(delayExpression1.GetExpression(), expression6, valueStack7);
                return;
            }

            case 12:
            {
                DelayExpression   delayExpression2 = this.value_stack.array[this.value_stack.top - 5].delay;
                List <Expression> expressions      = this.value_stack.array[this.value_stack.top - 2].expressions;
                this.yyval.expression = ExpressionBuilder.In(delayExpression2.GetExpression(), expressions);
                return;
            }

            case 13:
            {
                DelayExpression   delayExpression3 = this.value_stack.array[this.value_stack.top - 6].delay;
                List <Expression> expressions1     = this.value_stack.array[this.value_stack.top - 2].expressions;
                this.yyval.expression = ExpressionBuilder.NotIn(delayExpression3.GetExpression(), expressions1);
                return;
            }

            case 14:
            {
                DelayExpression delayExpression4 = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression delayExpression5 = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.expression = ExpressionBuilder.Equal(delayExpression4.GetExpression(), delayExpression5.GetExpression());
                return;
            }

            case 15:
            {
                DelayExpression delayExpression6 = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression delayExpression7 = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.expression = ExpressionBuilder.NotEqual(delayExpression6.GetExpression(), delayExpression7.GetExpression());
                return;
            }

            case 16:
            {
                DelayExpression valueStack8      = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression delayExpression8 = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.expression = ExpressionBuilder.LessThan(valueStack8.GetExpression(), delayExpression8.GetExpression());
                return;
            }

            case 17:
            {
                DelayExpression valueStack9      = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression delayExpression9 = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.expression = ExpressionBuilder.LessThanOrEqual(valueStack9.GetExpression(), delayExpression9.GetExpression());
                return;
            }

            case 18:
            {
                DelayExpression valueStack10      = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression delayExpression10 = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.expression = ExpressionBuilder.GreaterThan(valueStack10.GetExpression(), delayExpression10.GetExpression());
                return;
            }

            case 19:
            {
                DelayExpression valueStack11      = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression delayExpression11 = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.expression = ExpressionBuilder.GreaterThanOrEqual(valueStack11.GetExpression(), delayExpression11.GetExpression());
                return;
            }

            case 20:
            {
                LexLocation locationStack = this.location_stack.array[this.location_stack.top - 1];
                string      str           = this.value_stack.array[this.value_stack.top - 1].@value;
                this.yyval.delay = DelayExpression.NumericConstant(locationStack, str, TypeCode.Int64);
                return;
            }

            case 21:
            {
                LexLocation lexLocation = this.location_stack.array[this.location_stack.top - 1];
                string      str1        = this.value_stack.array[this.value_stack.top - 1].@value;
                this.yyval.delay = DelayExpression.NumericConstant(lexLocation, str1, TypeCode.Decimal);
                return;
            }

            case 22:
            {
                LexLocation locationStack1 = this.location_stack.array[this.location_stack.top - 1];
                string      str2           = this.value_stack.array[this.value_stack.top - 1].@value;
                this.yyval.delay = DelayExpression.NumericConstant(locationStack1, str2, TypeCode.Double);
                return;
            }

            case 23:
            {
                this.yyval.delay = DelayExpression.Expression(Expression.Constant(true, typeof(bool)));
                return;
            }

            case 24:
            {
                this.yyval.delay = DelayExpression.Expression(Expression.Constant(false, typeof(bool)));
                return;
            }

            case 25:
            {
                string str3 = this.value_stack.array[this.value_stack.top - 1].@value;
                this.yyval.delay = DelayExpression.Expression(Expression.Constant(str3));
                return;
            }

            case 26:
            {
                this.yyval.delay = DelayExpression.Expression(Expression.Constant(null));
                return;
            }

            case 27:
            {
                string str4 = this.value_stack.array[this.value_stack.top - 1].@value;
                this.yyval.qname = new QualifiedPropertyName(PropertyScope.User, str4);
                return;
            }

            case 28:
            {
                string str5 = this.value_stack.array[this.value_stack.top - 3].@value;
                string str6 = this.value_stack.array[this.value_stack.top - 1].@value;
                if (string.Equals(str5, "sys", StringComparison.OrdinalIgnoreCase))
                {
                    this.yyval.qname = new QualifiedPropertyName(PropertyScope.System, str6);
                    return;
                }
                if (string.Equals(str5, "user", StringComparison.OrdinalIgnoreCase))
                {
                    this.yyval.qname = new QualifiedPropertyName(PropertyScope.User, str6);
                    return;
                }
                this.scanner.yyerror(SRClient.FilterScopeNotSupported(str5), new object[0]);
                return;
            }

            case 29:
            {
                this.yyval.@value = this.value_stack.array[this.value_stack.top - 1].@value;
                return;
            }

            case 30:
            {
                this.yyval.@value = this.value_stack.array[this.value_stack.top - 1].@value;
                return;
            }

            case 31:
            {
                QualifiedPropertyName qualifiedPropertyName = this.value_stack.array[this.value_stack.top - 1].qname;
                this.yyval.expression = new GetPropertyExpression(this.messageParameter, qualifiedPropertyName);
                return;
            }

            case 32:
            {
                this.yyval.delay = this.value_stack.array[this.value_stack.top - 1].delay;
                return;
            }

            case 33:
            {
                this.yyval.delay = DelayExpression.Expression(this.value_stack.array[this.value_stack.top - 1].expression);
                return;
            }

            case 34:
            {
                this.yyval.delay = DelayExpression.Expression(this.value_stack.array[this.value_stack.top - 1].expression);
                return;
            }

            case 35:
            {
                this.yyval.delay = DelayExpression.Expression(this.value_stack.array[this.value_stack.top - 1].expression);
                return;
            }

            case 36:
            {
                DelayExpression valueStack12      = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression delayExpression12 = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.delay = DelayExpression.Expression(ExpressionBuilder.AddChecked(valueStack12.GetExpression(), delayExpression12.GetExpression()));
                return;
            }

            case 37:
            {
                DelayExpression valueStack13      = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression delayExpression13 = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.delay = DelayExpression.Expression(ExpressionBuilder.SubtractChecked(valueStack13.GetExpression(), delayExpression13.GetExpression()));
                return;
            }

            case 38:
            {
                DelayExpression valueStack14      = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression delayExpression14 = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.delay = DelayExpression.Expression(ExpressionBuilder.MultiplyChecked(valueStack14.GetExpression(), delayExpression14.GetExpression()));
                return;
            }

            case 39:
            {
                DelayExpression valueStack15      = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression delayExpression15 = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.delay = DelayExpression.Expression(ExpressionBuilder.Divide(valueStack15.GetExpression(), delayExpression15.GetExpression()));
                return;
            }

            case 40:
            {
                DelayExpression valueStack16      = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression delayExpression16 = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.delay = DelayExpression.Expression(ExpressionBuilder.Modulo(valueStack16.GetExpression(), delayExpression16.GetExpression()));
                return;
            }

            case 41:
            {
                DelayExpression valueStack17 = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.delay = DelayExpression.Expression(valueStack17.GetExpression());
                return;
            }

            case 42:
            {
                DelayExpression delayExpression17 = this.value_stack.array[this.value_stack.top - 1].delay;
                if (!delayExpression17.TryGetConstantNumericLiteral(ExpressionType.NegateChecked, out expression))
                {
                    expression = ExpressionBuilder.NegateChecked(delayExpression17.GetExpression());
                }
                this.yyval.delay = DelayExpression.Expression(expression);
                return;
            }

            case 43:
            {
                DelayExpression valueStack18 = this.value_stack.array[this.value_stack.top - 2].delay;
                this.yyval.delay = DelayExpression.Expression(valueStack18.GetExpression());
                return;
            }

            case 44:
            {
                string str7 = this.value_stack.array[this.value_stack.top - 1].@value;
                this.requiredParameters.Add(str7);
                this.yyval.expression = ExpressionBuilder.GetParameter(this.parametersParameter, str7);
                return;
            }

            case 45:
            {
                string            str8         = this.value_stack.array[this.value_stack.top - 4].@value;
                List <Expression> expressions2 = this.value_stack.array[this.value_stack.top - 2].expressions;
                this.yyval.expression = ExpressionBuilder.MakeFunction(this.messageParameter, str8, expressions2);
                return;
            }

            case 46:
            {
                this.yyval.expressions = new List <Expression>();
                return;
            }

            case 47:
            {
                Expression        expression7  = this.value_stack.array[this.value_stack.top - 1].delay.GetExpression();
                List <Expression> expressions3 = new List <Expression>()
                {
                    ExpressionBuilder.ConvertToObject(expression7)
                };
                this.yyval.expressions = expressions3;
                return;
            }

            case 48:
            {
                List <Expression> expressions4 = this.value_stack.array[this.value_stack.top - 3].expressions;
                Expression        expression8  = this.value_stack.array[this.value_stack.top - 1].delay.GetExpression();
                expressions4.Add(ExpressionBuilder.ConvertToObject(expression8));
                this.yyval.expressions = expressions4;
                return;
            }

            case 49:
            {
                this.yyval.expression = this.value_stack.array[this.value_stack.top - 1].delay.GetExpression();
                return;
            }

            case 50:
            {
                this.yyval.expression = Expression.Constant(null);
                return;
            }

            case 51:
            {
                this.yyval.expression = this.value_stack.array[this.value_stack.top - 1].delay.GetExpression();
                return;
            }

            case 52:
            {
                DelayExpression   delayExpression18 = this.value_stack.array[this.value_stack.top - 1].delay;
                List <Expression> expressions5      = new List <Expression>()
                {
                    ExpressionBuilder.ConvertToObject(delayExpression18.GetExpression())
                };
                this.yyval.expressions = expressions5;
                return;
            }

            case 53:
            {
                List <Expression> expressions6 = this.value_stack.array[this.value_stack.top - 3].expressions;
                DelayExpression   valueStack19 = this.value_stack.array[this.value_stack.top - 1].delay;
                expressions6.Add(ExpressionBuilder.ConvertToObject(valueStack19.GetExpression()));
                this.yyval.expressions = expressions6;
                return;
            }

            default:
            {
                return;
            }
            }
        }
Ejemplo n.º 2
0
        protected override void DoAction(int action)
        {
            Expression expression;

            switch (action)
            {
            case 2:
            {
                this.expressionList = this.value_stack.array[this.value_stack.top - 1].expressions;
                return;
            }

            case 3:
            {
                List <Expression> expressions = new List <Expression>()
                {
                    this.value_stack.array[this.value_stack.top - 1].expression
                };
                this.yyval.expressions = expressions;
                return;
            }

            case 4:
            {
                List <Expression> valueStack = this.value_stack.array[this.value_stack.top - 2].expressions;
                valueStack.Add(this.value_stack.array[this.value_stack.top - 1].expression);
                this.yyval.expressions = valueStack;
                return;
            }

            case 5:
            {
                this.yyval.expression = this.value_stack.array[this.value_stack.top - 2].expression;
                return;
            }

            case 6:
            {
                this.yyval.expression = this.value_stack.array[this.value_stack.top - 1].expression;
                return;
            }

            case 7:
            {
                this.yyval.expression = this.value_stack.array[this.value_stack.top - 1].expression;
                return;
            }

            case 8:
            case 9:
            {
                return;
            }

            case 10:
            {
                QualifiedPropertyName qualifiedPropertyName = this.value_stack.array[this.value_stack.top - 3].qname;
                DelayExpression       delayExpression       = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.expression = new SetPropertyExpression(this.messageParameter, qualifiedPropertyName, ExpressionBuilder.ConvertToObject(delayExpression.GetExpression()));
                return;
            }

            case 11:
            {
                QualifiedPropertyName valueStack1 = this.value_stack.array[this.value_stack.top - 1].qname;
                this.yyval.expression = new RemovePropertyExpression(this.messageParameter, valueStack1);
                return;
            }

            case 12:
            {
                this.yyval.delay = this.value_stack.array[this.value_stack.top - 1].delay;
                return;
            }

            case 13:
            {
                this.yyval.delay = DelayExpression.Expression(this.value_stack.array[this.value_stack.top - 1].expression);
                return;
            }

            case 14:
            {
                this.yyval.delay = DelayExpression.Expression(this.value_stack.array[this.value_stack.top - 1].expression);
                return;
            }

            case 15:
            {
                this.yyval.delay = DelayExpression.Expression(this.value_stack.array[this.value_stack.top - 1].expression);
                return;
            }

            case 16:
            {
                DelayExpression delayExpression1 = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression valueStack2      = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.delay = DelayExpression.Expression(ExpressionBuilder.AddChecked(delayExpression1.GetExpression(), valueStack2.GetExpression()));
                return;
            }

            case 17:
            {
                DelayExpression delayExpression2 = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression valueStack3      = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.delay = DelayExpression.Expression(ExpressionBuilder.SubtractChecked(delayExpression2.GetExpression(), valueStack3.GetExpression()));
                return;
            }

            case 18:
            {
                DelayExpression delayExpression3 = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression valueStack4      = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.delay = DelayExpression.Expression(ExpressionBuilder.MultiplyChecked(delayExpression3.GetExpression(), valueStack4.GetExpression()));
                return;
            }

            case 19:
            {
                DelayExpression delayExpression4 = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression valueStack5      = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.delay = DelayExpression.Expression(ExpressionBuilder.Divide(delayExpression4.GetExpression(), valueStack5.GetExpression()));
                return;
            }

            case 20:
            {
                DelayExpression delayExpression5 = this.value_stack.array[this.value_stack.top - 3].delay;
                DelayExpression valueStack6      = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.delay = DelayExpression.Expression(ExpressionBuilder.Modulo(delayExpression5.GetExpression(), valueStack6.GetExpression()));
                return;
            }

            case 21:
            {
                DelayExpression delayExpression6 = this.value_stack.array[this.value_stack.top - 1].delay;
                this.yyval.delay = DelayExpression.Expression(delayExpression6.GetExpression());
                return;
            }

            case 22:
            {
                DelayExpression valueStack7 = this.value_stack.array[this.value_stack.top - 1].delay;
                if (!valueStack7.TryGetConstantNumericLiteral(ExpressionType.NegateChecked, out expression))
                {
                    expression = ExpressionBuilder.NegateChecked(valueStack7.GetExpression());
                }
                this.yyval.delay = DelayExpression.Expression(expression);
                return;
            }

            case 23:
            {
                DelayExpression delayExpression7 = this.value_stack.array[this.value_stack.top - 2].delay;
                this.yyval.delay = DelayExpression.Expression(delayExpression7.GetExpression());
                return;
            }

            case 24:
            {
                LexLocation locationStack = this.location_stack.array[this.location_stack.top - 1];
                string      str           = this.value_stack.array[this.value_stack.top - 1].@value;
                this.yyval.delay = DelayExpression.NumericConstant(locationStack, str, TypeCode.Int64);
                return;
            }

            case 25:
            {
                LexLocation lexLocation = this.location_stack.array[this.location_stack.top - 1];
                string      str1        = this.value_stack.array[this.value_stack.top - 1].@value;
                this.yyval.delay = DelayExpression.NumericConstant(lexLocation, str1, TypeCode.Decimal);
                return;
            }

            case 26:
            {
                LexLocation locationStack1 = this.location_stack.array[this.location_stack.top - 1];
                string      str2           = this.value_stack.array[this.value_stack.top - 1].@value;
                this.yyval.delay = DelayExpression.NumericConstant(locationStack1, str2, TypeCode.Double);
                return;
            }

            case 27:
            {
                this.yyval.delay = DelayExpression.Expression(Expression.Constant(true, typeof(bool)));
                return;
            }

            case 28:
            {
                this.yyval.delay = DelayExpression.Expression(Expression.Constant(false, typeof(bool)));
                return;
            }

            case 29:
            {
                string str3 = this.value_stack.array[this.value_stack.top - 1].@value;
                this.yyval.delay = DelayExpression.Expression(Expression.Constant(str3));
                return;
            }

            case 30:
            {
                this.yyval.delay = DelayExpression.Expression(Expression.Constant(null));
                return;
            }

            case 31:
            {
                string            str4         = this.value_stack.array[this.value_stack.top - 4].@value;
                List <Expression> expressions1 = this.value_stack.array[this.value_stack.top - 2].expressions;
                this.yyval.expression = ExpressionBuilder.MakeFunction(this.messageParameter, str4, expressions1);
                return;
            }

            case 32:
            {
                this.yyval.expressions = new List <Expression>();
                return;
            }

            case 33:
            {
                DelayExpression   valueStack8  = this.value_stack.array[this.value_stack.top - 1].delay;
                List <Expression> expressions2 = new List <Expression>()
                {
                    ExpressionBuilder.ConvertToObject(valueStack8.GetExpression())
                };
                this.yyval.expressions = expressions2;
                return;
            }

            case 34:
            {
                List <Expression> expressions3     = this.value_stack.array[this.value_stack.top - 3].expressions;
                DelayExpression   delayExpression8 = this.value_stack.array[this.value_stack.top - 1].delay;
                expressions3.Add(ExpressionBuilder.ConvertToObject(delayExpression8.GetExpression()));
                this.yyval.expressions = expressions3;
                return;
            }

            case 35:
            {
                string str5 = this.value_stack.array[this.value_stack.top - 1].@value;
                this.requiredParameters.Add(str5);
                this.yyval.expression = ExpressionBuilder.GetParameter(this.parametersParameter, str5);
                return;
            }

            case 36:
            {
                QualifiedPropertyName qualifiedPropertyName1 = this.value_stack.array[this.value_stack.top - 1].qname;
                this.yyval.expression = new GetPropertyExpression(this.messageParameter, qualifiedPropertyName1);
                return;
            }

            case 37:
            {
                string str6 = this.value_stack.array[this.value_stack.top - 1].@value;
                this.yyval.qname = new QualifiedPropertyName(PropertyScope.User, str6);
                return;
            }

            case 38:
            {
                string str7 = this.value_stack.array[this.value_stack.top - 3].@value;
                string str8 = this.value_stack.array[this.value_stack.top - 1].@value;
                if (string.Equals(str7, "sys", StringComparison.OrdinalIgnoreCase))
                {
                    this.yyval.qname = new QualifiedPropertyName(PropertyScope.System, str8);
                    return;
                }
                if (string.Equals(str7, "user", StringComparison.OrdinalIgnoreCase))
                {
                    this.yyval.qname = new QualifiedPropertyName(PropertyScope.User, str8);
                    return;
                }
                this.scanner.yyerror(SRClient.FilterScopeNotSupported(str7), new object[0]);
                return;
            }

            case 39:
            {
                this.yyval.@value = this.value_stack.array[this.value_stack.top - 1].@value;
                return;
            }

            case 40:
            {
                this.yyval.@value = this.value_stack.array[this.value_stack.top - 1].@value;
                return;
            }

            default:
            {
                return;
            }
            }
        }