protected override Expression VisitChildren(System.Linq.Expressions.ExpressionVisitor visitor) { return(Update( (ParameterExpression)visitor.Visit(variable), visitor.Visit(disposable), visitor.Visit(body))); }
/// <summary> /// Reduces the node and then calls the <see cref="ExpressionVisitor.Visit(System.Linq.Expressions.Expression)" /> method passing the /// reduced expression. /// Throws an exception if the node isn't reducible. /// </summary> /// <param name="visitor"> An instance of <see cref="ExpressionVisitor" />. </param> /// <returns> The expression being visited, or an expression which should replace it in the tree. </returns> /// <remarks> /// Override this method to provide logic to walk the node's children. /// A typical implementation will call visitor.Visit on each of its /// children, and if any of them change, should return a new copy of /// itself with the modified children. /// </remarks> protected override Expression VisitChildren(ExpressionVisitor visitor) { visitor.Visit(_tableExpression); visitor.Visit(_predicate); return this; }
protected override Expression VisitChildren(System.Linq.Expressions.ExpressionVisitor visitor) { return(Update( visitor.Visit(test), visitor.Visit(body), continue_target, break_target)); }
protected override Expression VisitChildren(System.Linq.Expressions.ExpressionVisitor visitor) { return(Update( (ParameterExpression)visitor.Visit(variable), visitor.Visit(enumerable), visitor.Visit(body), break_target, continue_target)); }
protected override Expression VisitChildren(ExpressionVisitor visitor) { var newLeft = visitor.Visit(Left); var newRight = visitor.Visit(Right); return newLeft != Left || newRight != Right ? new StringCompareExpression(Operator, newLeft, newRight) : this; }
protected override Expression VisitChildren(ExpressionVisitor visitor) { var newMatchExpression = visitor.Visit(Match); var newPatternExpression = visitor.Visit(Pattern); return (newMatchExpression != Match) || (newPatternExpression != Pattern) ? new LikeExpression(newMatchExpression, newPatternExpression) : this; }
protected override Expression VisitChildren(ExpressionVisitor visitor) { var newMatchExpression = visitor.Visit(Match); var newPatternExpression = visitor.Visit(Pattern); return newMatchExpression != Match || newPatternExpression != Pattern ? new RegexMatchExpression(newMatchExpression, newPatternExpression, Options) : this; }
protected override Expression VisitChildren(ExpressionVisitor visitor) { Expression left = visitor.Visit(_left); Expression right = visitor.Visit(_right); if (left != _left || right != _right) { return new AssignmentExtensionExpression(left, right); } return this; }
protected override Expression VisitChildren(System.Linq.Expressions.ExpressionVisitor visitor) { return(Update( (ParameterExpression)visitor.Visit(variable), visitor.Visit(initializer), visitor.Visit(test), visitor.Visit(step), visitor.Visit(body), continue_target, break_target)); }
/// <summary> /// Loop in and make sure the sub-expressions are correctly "visited" - mainly the /// low and high guys. /// </summary> /// <param name="visitor"></param> /// <returns></returns> protected override Expression VisitChildren(ExpressionVisitor visitor) { var nLowBoundary = visitor.Visit(LowBoundary); var nHighBoundary = visitor.Visit(HighBoundary); if (nLowBoundary == LowBoundary && nHighBoundary == HighBoundary) { return this; } // Changed, so clone ourselves. return new EnumerableRangeExpression(nLowBoundary, nHighBoundary); }
protected override Expression VisitChildren(ExpressionVisitor visitor) { QueryNode newTarget = (QueryNode)visitor.Visit(Target); LambdaExpression[] newConditions = new LambdaExpression[Conditions.Count]; bool unchanged = (newTarget == Target); for (int i = 0; i < newConditions.Length; i++) { newConditions[i] = (LambdaExpression)visitor.Visit(Conditions[i]); unchanged &= newConditions[i] == Conditions[i]; } if (unchanged) return this; else return new Filter(newTarget, newConditions); }
protected override Expression VisitChildren(ExpressionVisitor visitor) { Expression body = visitor.Visit(_body); if (body == _body) { return this; } return new SkipInterpretExpression(body); }
protected override Expression VisitChildren(ExpressionVisitor visitor) { Expression v = visitor.Visit(_value); if (v == _value) { return this; } return Utils.Assign(_name, v); }
protected override Expression VisitChildren(ExpressionVisitor visitor) { var expr = visitor.Visit(_expr); if (expr != _expr) { return new LightExceptionConvertingExpression(expr, _supportsLightEx); } return this; }
protected override Expression VisitChildren(ExpressionVisitor visitor) { Expression b = visitor.Visit(_body); if (b == _body) { return this; } return new FinallyFlowControlExpression(b); }
protected override Expression VisitChildren(ExpressionVisitor visitor) { var instance = visitor.Visit(_expr); if (instance != _expr) { return new LightCheckAndThrowExpression(instance); } return this; }
protected override Expression VisitChildren(ExpressionVisitor visitor) { Expression v = visitor.Visit(_value); if (v == _value) { return this; } return Utils.MakeYield(_target, v, YieldMarker); }
protected override Expression VisitChildren(ExpressionVisitor visitor) { Expression v = visitor.Visit(_variable); if (v == _variable) { return this; } return Utils.Delete(v); }
/// <summary> /// Reduces the node and then calls the <see cref="ExpressionVisitor.Visit(System.Linq.Expressions.Expression)" /> method passing the /// reduced expression. /// Throws an exception if the node isn't reducible. /// </summary> /// <param name="visitor"> An instance of <see cref="ExpressionVisitor" />. </param> /// <returns> The expression being visited, or an expression which should replace it in the tree. </returns> /// <remarks> /// Override this method to provide logic to walk the node's children. /// A typical implementation will call visitor.Visit on each of its /// children, and if any of them change, should return a new copy of /// itself with the modified children. /// </remarks> protected override Expression VisitChildren(ExpressionVisitor visitor) { var newOperand = visitor.Visit(Operand); return newOperand != Operand ? new ExplicitCastExpression(newOperand, _type) : this; }
protected override Expression VisitChildren(ExpressionVisitor visitor) { QueryNode newTarget = (QueryNode)visitor.Visit(Target); if (newTarget == Target) return this; else return new MergeByName(newTarget); }
protected override Expression VisitChildren(ExpressionVisitor visitor) { QueryNode newTarget = (QueryNode)visitor.Visit(Target); if (newTarget == Target) return this; else return new Limit(newTarget, Start, Length); }
protected override Expression VisitChildren(ExpressionVisitor visitor) { var newInnerExpression = visitor.Visit(_expression); return newInnerExpression != _expression ? new AliasExpression(Alias, newInnerExpression) : this; }
protected override Expression VisitChildren(ExpressionVisitor visitor) { var newTimestampExpression = visitor.Visit(TimestampExpression); return newTimestampExpression != TimestampExpression ? new AtTimeZoneExpression(newTimestampExpression, TimeZone) : this; }
protected override Expression VisitChildren(ExpressionVisitor visitor) { var exception = visitor.Visit(_exception); if (exception != _exception) { return new LightThrowExpression(exception); } return this; }
protected override Expression VisitChildren(ExpressionVisitor visitor) { var newPredicate = visitor.Visit(_predicate); return _predicate != newPredicate ? new DiscriminatorPredicateExpression(newPredicate, QuerySource) : this; }
protected override Expression VisitChildren(ExpressionVisitor visitor) { var newExpression = visitor.Visit(_operand); return newExpression != _operand ? new NotNullableExpression(newExpression) : this; }
protected override Expression VisitChildren(ExpressionVisitor visitor) { Expression lineNo = visitor.Visit(_lineNumberExpression); if (lineNo != _lineNumberExpression) { return new LastFaultingLineExpression(lineNo); } return this; }
protected override Expression VisitChildren(ExpressionVisitor visitor) { QueryNode newTarget = (QueryNode)visitor.Visit(Target); if (newTarget == Target) return this; else return new Sort(newTarget, arguments); }
protected override Expression VisitChildren (ExpressionVisitor visitor) { var result = visitor.Visit (_expression); if (result != _expression) return new NonReducibleExtensionExpression (result); return this; }
internal override void RewriteBody(MSAst.ExpressionVisitor visitor) { _dlrBody = null; // clear the cached body if we've been reduced MSAst.Expression funcCode = GlobalParent.Constant(GetOrMakeFunctionCode()); FuncCodeExpr = funcCode; Body = new RewrittenBodyStatement(Body, visitor.Visit(Body)); }
protected override Expression VisitChildren(ExpressionVisitor visitor) { Expression v = visitor.Visit(_value); if (v == _value) { return this; } return new AwaitExpression(v); }
private static ReqlExpr GetWhereReqlAst( ReqlExpr reqlExpr, Expression predicate ) { var subQueryExpression = predicate as SubQueryExpression; var where = subQueryExpression.QueryModel.BodyClauses[0] as WhereClause; var visitor = new ExpressionVisitor( reqlExpr, subQueryExpression.QueryModel.MainFromClause.ItemType ); visitor.Visit( where.Predicate ); return visitor.Current; }
protected override Expression VisitChildren(ExpressionVisitor visitor) { var selector = (SelectorExpression) visitor.Visit(_selector); var term = (TermExpression) visitor.Visit(_term); if (selector != _selector || term != _term) return new RelationExpression(selector, _relation, term); return this; }
protected override Expression VisitChildren(ExpressionVisitor visitor) { Expression newContext = visitor.Visit(_newContext); Expression body = visitor.Visit(_body); if (newContext == _newContext && body == _body) { return this; } return Utils.CodeContextScope(body, newContext); }
protected override Expression VisitChildren(ExpressionVisitor visitor) { Expression rhs = visitor.Visit(_rhs); if (rhs != _rhs) { return new DelayedTupleAssign(_lhs, rhs); } return this; }
protected override MSAst.Expression VisitChildren(MSAst.ExpressionVisitor visitor) { if (_funcCode != null) { MSAst.Expression funcCode = visitor.Visit(_funcCode); if (funcCode != _funcCode) { DelayedFunctionCode res = new DelayedFunctionCode(); res._funcCode = funcCode; return res; } } return this; }
protected override MSAst.Expression VisitChildren(MSAst.ExpressionVisitor visitor) { return(visitor.Visit(_body)); }
internal override void RewriteBody(MSAst.ExpressionVisitor visitor) { _dlrBody = null; _body = new RewrittenBodyStatement(Body, visitor.Visit(Body)); }