Example #1
0
        public override bool Equals(object obj)
        {
            ConstantExpressionFingerprint other = obj as ConstantExpressionFingerprint;

            return((other != null) &&
                   this.Equals(other));
        }
        public static ConstantExpressionFingerprint Create(ConstantExpression expression, ParserContext parserContext) {
            ConstantExpressionFingerprint fingerprint = new ConstantExpressionFingerprint(expression) {
                HoistedLocalsIndex = parserContext.HoistedValues.Count
            };

            parserContext.HoistedValues.Add(expression.Value);
            return fingerprint;
        }
Example #3
0
        public static ConstantExpressionFingerprint Create(ConstantExpression expression, ParserContext parserContext)
        {
            ConstantExpressionFingerprint fingerprint = new ConstantExpressionFingerprint(expression)
            {
                HoistedLocalsIndex = parserContext.HoistedValues.Count
            };

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

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

            return(this.HoistedLocalsIndex == other.HoistedLocalsIndex &&
                   base.Equals(other));
        }
        public static ExpressionFingerprint Create(Expression expression, ParserContext parserContext)
        {
            {
                BinaryExpression binaryExpression = expression as BinaryExpression;
                if (binaryExpression != null)
                {
                    return(BinaryExpressionFingerprint.Create(binaryExpression, parserContext));
                }
            }

            {
                ConditionalExpression conditionalExpression = expression as ConditionalExpression;
                if (conditionalExpression != null)
                {
                    return(ConditionalExpressionFingerprint.Create(conditionalExpression, parserContext));
                }
            }

            {
                ConstantExpression constantExpression = expression as ConstantExpression;
                if (constantExpression != null)
                {
                    return(ConstantExpressionFingerprint.Create(constantExpression, parserContext));
                }
            }

            {
                MemberExpression memberExpression = expression as MemberExpression;
                if (memberExpression != null)
                {
                    return(MemberExpressionFingerprint.Create(memberExpression, parserContext));
                }
            }

            {
                MethodCallExpression methodCallExpression = expression as MethodCallExpression;
                if (methodCallExpression != null)
                {
                    return(MethodCallExpressionFingerprint.Create(methodCallExpression, parserContext));
                }
            }

            {
                ParameterExpression parameterExpression = expression as ParameterExpression;
                if (parameterExpression != null)
                {
                    return(ParameterExpressionFingerprint.Create(parameterExpression, parserContext));
                }
            }

            {
                UnaryExpression unaryExpression = expression as UnaryExpression;
                if (unaryExpression != null)
                {
                    return(UnaryExpressionFingerprint.Create(unaryExpression, parserContext));
                }
            }

            // unknown expression
            return(null);
        }