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)); }
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)); }
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)); }
public static VfpExpression Replace(VfpVariableReferenceExpression variableReferenceExpression, VfpExpression expression) { var rewriter = new VariableReferenceReplacer(variableReferenceExpression); return(rewriter.Visit(expression)); }
public override VfpExpression Visit(VfpVariableReferenceExpression expression) { return(_variableReferenceExpression); }
public VariableReferenceReplacer(VfpVariableReferenceExpression variableReferenceExpression) { _variableReferenceExpression = variableReferenceExpression; }
public override VfpExpression Visit(VfpVariableReferenceExpression expression) { return(new VfpVariableReferenceExpression(_variableReference.ResultType, _variableReference.VariableName)); }
public VfpVariableReferenceExpressionRewriter(VfpVariableReferenceExpression variableReference) { _variableReference = variableReference; }
protected VfpVariableReferenceExpression VisitNullHandler(VfpVariableReferenceExpression expression) { return(expression); }
public virtual VfpExpression Visit(VfpVariableReferenceExpression expression) { return(new VfpVariableReferenceExpression(expression.ResultType, expression.VariableName)); }
public override VfpExpression Visit(VfpVariableReferenceExpression expression) { _expressions.Add(expression); return(base.Visit(expression)); }