public static ConstantExpressionFingerprint Create(
            ConstantExpression expression, ParserContext context)
        {
            ConstantExpressionFingerprint fingerprint =
                new ConstantExpressionFingerprint(expression)
                {
                    _index = context.HoistedValues.Count
                };

            context.HoistedValues.Add(expression.Value);
            return fingerprint;
        }
Beispiel #2
0
        public override bool Equals(object obj)
        {
            ConstantExpressionFingerprint other =
                (obj as ConstantExpressionFingerprint);

            if (other == null)
            {
                return(false);
            }

            return(_index == other._index && base.Equals(other));
        }
Beispiel #3
0
        public static ExpressionFingerprint Create(Expression expression, ParserContext context)
        {
            BinaryExpression binaryExpression = (expression as BinaryExpression);

            if (binaryExpression != null)
            {
                return(BinaryExpressionFingerprint.Create(binaryExpression, context));
            }

            ConditionalExpression conditionalExpression = (expression as ConditionalExpression);

            if (conditionalExpression != null)
            {
                return(ConditionalExpressionFingerprint.Create(conditionalExpression, context));
            }

            ConstantExpression constantExpression = (expression as ConstantExpression);

            if (constantExpression != null)
            {
                return(ConstantExpressionFingerprint.Create(constantExpression, context));
            }

            MemberExpression memberExpression = (expression as MemberExpression);

            if (memberExpression != null)
            {
                return(MemberExpressionFingerprint.Create(memberExpression, context));
            }

            MethodCallExpression methodCallExpression = (expression as MethodCallExpression);

            if (methodCallExpression != null)
            {
                return(MethodCallExpressionFingerprint.Create(methodCallExpression, context));
            }

            ParameterExpression parameterExpression = (expression as ParameterExpression);

            if (parameterExpression != null)
            {
                return(ParameterExpressionFingerprint.Create(parameterExpression, context));
            }

            UnaryExpression unaryExpression = (expression as UnaryExpression);

            if (unaryExpression != null)
            {
                return(UnaryExpressionFingerprint.Create(unaryExpression, context));
            }

            return(null);
        }
Beispiel #4
0
        public static ConstantExpressionFingerprint Create(
            ConstantExpression expression, ParserContext context)
        {
            ConstantExpressionFingerprint fingerprint =
                new ConstantExpressionFingerprint(expression)
            {
                _index = context.HoistedValues.Count
            };

            context.HoistedValues.Add(expression.Value);
            return(fingerprint);
        }