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 body = visitor.Visit(_body); if (body == _body) { return this; } return new SkipInterpretExpression(body); }
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) { visitor.Visit(_tableExpression); visitor.Visit(_predicate); 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(System.Linq.Expressions.ExpressionVisitor visitor) { return(Update( (ParameterExpression)visitor.Visit(variable), visitor.Visit(disposable), visitor.Visit(body))); }
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(_value); if (v == _value) { return this; } return Utils.Assign(_name, v); }
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 result = visitor.Visit (_expression); if (result != _expression) return new NonReducibleExtensionExpression (result); return this; }
/// <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) { var exception = visitor.Visit(_exception); if (exception != _exception) { return new LightThrowExpression(exception); } return this; }
protected override Expression VisitChildren(ExpressionVisitor visitor) { var newExpression = visitor.Visit(_operand); return newExpression != _operand ? new NotNullableExpression(newExpression) : this; }
/// <summary> /// 简化节点,然后对简化的表达式调用访问者委托。该方法在节点不可简化时引发异常。 /// </summary> /// <returns> /// 要访问的表达式,或应在树中替换此表达式的表达式。 /// </returns> /// <param name="visitor"><see cref="T:System.Func`2"/> 的一个实例。</param> protected override Expression VisitChildren(ExpressionVisitor visitor) { var newArguments = visitor.VisitAndConvert(_arguments, "VisitChildren"); return newArguments != _arguments ? new SqlFunctionExpression(FunctionName, newArguments, Type) : this; }
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) { QueryNode newTarget = (QueryNode)visitor.Visit(Target); if (newTarget == Target) return this; else return new Sort(newTarget, arguments); }
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 Accept(ExpressionVisitor visitor) { var parsedVisitor = visitor as CompilingExpressionVisitor; if (parsedVisitor != null) return Accept(parsedVisitor); return base.Accept(visitor); }
protected override Expression VisitChildren(ExpressionVisitor visitor) { var arguments = visitor.VisitAndConvert(new ReadOnlyCollection<Expression>(_arguments), "VisitChildren"); return arguments != Arguments ? new SqlFunctionExpression(FunctionName, arguments, Type) : 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) { var newPredicate = visitor.Visit(_predicate); return _predicate != newPredicate ? new DiscriminatorPredicateExpression(newPredicate, QuerySource) : 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)); }
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 sealed override Expression Accept(ExpressionVisitor visitor) { var mongoVisitor = visitor as ExtensionExpressionVisitor; if (mongoVisitor != null) { return Accept(mongoVisitor); } return base.Accept(visitor); }
protected override Expression Accept(ExpressionVisitor visitor) { var reducible = visitor as IReducingExpressionVisitor; if (reducible != null) { return reducible.VisitReducible(this); } return base.Accept(visitor); }
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 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) { Expression v = visitor.Visit(_value); if (v == _value) { return this; } return new AwaitExpression(v); }
protected override Expression Accept(ExpressionVisitor visitor) { Check.NotNull(visitor, nameof(visitor)); var specificVisitor = visitor as ISqlExpressionVisitor; return specificVisitor != null ? specificVisitor.VisitLiteral(this) : base.Accept(visitor); }
protected override Expression Accept (ExpressionVisitor visitor) { ArgumentUtility.CheckNotNull ("visitor", visitor); var relinqVisitor = visitor as RelinqExpressionVisitor; if (relinqVisitor == null) return base.Accept (visitor); return relinqVisitor.VisitSubQuery (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 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 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> /// Dispatches to the specific visit method for this node type. /// </summary> protected internal override Expression Accept(ExpressionVisitor visitor) { return(visitor.VisitInvocation(this)); }
internal virtual void RewriteBody(MSAst.ExpressionVisitor visitor) { _funcCode = null; }
protected override MSAst.Expression VisitChildren(MSAst.ExpressionVisitor visitor) { return(visitor.Visit(_body)); }
protected override SystemLinq.Expression VisitChildren(SystemLinq.ExpressionVisitor visitor) => throw Exception;
protected internal override Expression Accept(ExpressionVisitor visitor) { return default(Expression); }
/// <summary> /// Dispatches to the specific visit method for this node type. /// </summary> protected internal override Expression Accept(ExpressionVisitor visitor) { return(visitor.VisitRuntimeVariables(this)); }
/// <summary> /// Dispatches to the specific visit method for this node type. /// </summary> protected internal override Expression Accept(ExpressionVisitor visitor) { return(visitor.VisitMember(this)); }
public override Expression Accept(ExpressionVisitor visitor) { return visitor.VisitIndex(this); }
internal override void RewriteBody(MSAst.ExpressionVisitor visitor) { _dlrBody = null; _body = new RewrittenBodyStatement(Body, visitor.Visit(Body)); }
/// <summary> /// Dispatches to the specific visit method for this node type. /// </summary> protected internal override Expression Accept(ExpressionVisitor visitor) { return(visitor.VisitConditional(this)); }
/// <summary> /// Dispatches to the specific visit method for this node type. For /// example, <see cref="MethodCallExpression" /> will call into /// <see cref="ExpressionVisitor.VisitMethodCall" />. /// </summary> /// <param name="visitor">The visitor to visit this node with.</param> /// <returns>The result of visiting this node.</returns> /// <remarks> /// This default implementation for <see cref="ExpressionType.Extension" /> /// nodes will call <see cref="ExpressionVisitor.VisitExtension" />. /// Override this method to call into a more specific method on a derived /// visitor class of ExprressionVisitor. However, it should still /// support unknown visitors by calling VisitExtension. /// </remarks> protected internal virtual Expression Accept(ExpressionVisitor visitor) { return(visitor.VisitExtension(this)); }
protected override Expression Accept(ExpressionVisitor visitor) { throw new NotImplementedException(); }
protected override MSAst.Expression VisitChildren(MSAst.ExpressionVisitor visitor) { return(this); }
protected override MSAst.Expression Accept(MSAst.ExpressionVisitor visitor) { return(this); }