コード例 #1
0
        public override VfpExpression Visit(VfpVariableReferenceExpression expression)
        {
            Write(" ");
            Write(expression.VariableName);

            return(expression);
        }
        public override VfpExpression Visit(VfpVariableReferenceExpression expression)
        {
            foreach (var shortNames in SqlVisitor.AliasNames)
            {
                if (expression.VariableName.StartsWith(shortNames))
                {
                    return(new VfpVariableReferenceExpression(expression.ResultType, expression.VariableName.Replace(shortNames, shortNames.Substring(0, 1))));
                }
            }

            return(base.Visit(expression));
        }
コード例 #3
0
        private static VfpExpression GetScanProperty(VfpVariableReferenceExpression variable, VfpExpression property)
        {
            var expression   = VariableReferenceReplacer.Replace(variable, property);
            var scanProperty = expression as VfpPropertyExpression;

            if (scanProperty == null)
            {
                return(expression);
            }

            var variables = VariableReferenceGatherer.Gather(expression);

            if (!variables.Any())
            {
                return(expression);
            }

            var scanVariable = variables.First();

            return(scanVariable.Property(scanProperty.ResultType, scanProperty.Property));
        }
コード例 #4
0
        private VfpLimitExpression GetVfpLimitExpression(VfpLimitExpression limitExpression, VfpScanExpression scanExpression)
        {
            if (scanExpression == null)
            {
                return(null);
            }

            var keyMembers = GetKeyMembers(scanExpression.Target.ElementType.KeyMembers);

            if (!keyMembers.Any())
            {
                return(null);
            }

            var variableReference = new VfpVariableReferenceExpression(scanExpression.ResultType, GetUniqueVariableName());
            var expressionBinding = new VfpExpressionBinding(scanExpression, variableReference);
            var sortClauses       = GetSortClauses(keyMembers, expressionBinding).ToList().AsReadOnly();
            var sortExpression    = new VfpSortExpression(scanExpression.ResultType, expressionBinding, sortClauses);

            return(new VfpLimitExpression(limitExpression.ResultType,
                                          sortExpression,
                                          limitExpression.Limit,
                                          limitExpression.WithTies));
        }
コード例 #5
0
        public static VfpExpression Replace(VfpVariableReferenceExpression variableReferenceExpression, VfpExpression expression)
        {
            var rewriter = new VariableReferenceReplacer(variableReferenceExpression);

            return(rewriter.Visit(expression));
        }
コード例 #6
0
 public override VfpExpression Visit(VfpVariableReferenceExpression expression)
 {
     return(_variableReferenceExpression);
 }
コード例 #7
0
 public VariableReferenceReplacer(VfpVariableReferenceExpression variableReferenceExpression)
 {
     _variableReferenceExpression = variableReferenceExpression;
 }
コード例 #8
0
 public override VfpExpression Visit(VfpVariableReferenceExpression expression)
 {
     return(new VfpVariableReferenceExpression(_variableReference.ResultType, _variableReference.VariableName));
 }
コード例 #9
0
 public VfpVariableReferenceExpressionRewriter(VfpVariableReferenceExpression variableReference)
 {
     _variableReference = variableReference;
 }
コード例 #10
0
 protected VfpVariableReferenceExpression VisitNullHandler(VfpVariableReferenceExpression expression)
 {
     return(expression);
 }
コード例 #11
0
 public virtual VfpExpression Visit(VfpVariableReferenceExpression expression)
 {
     return(new VfpVariableReferenceExpression(expression.ResultType, expression.VariableName));
 }
コード例 #12
0
        public override VfpExpression Visit(VfpVariableReferenceExpression expression)
        {
            _expressions.Add(expression);

            return(base.Visit(expression));
        }