コード例 #1
0
 protected override Expression VisitChildren(ExpressionVisitor visitor) {
     var expr = visitor.Visit(_expr);
     if (expr != _expr) {
         return new LightExceptionConvertingExpression(expr, _supportsLightEx);
     }
     return this;
 }
コード例 #2
0
 protected override Expression VisitChildren(ExpressionVisitor visitor) {
     Expression body = visitor.Visit(_body);
     if (body == _body) {
         return this;
     }
     return new SkipInterpretExpression(body);
 }
コード例 #3
0
ファイル: DeleteStatement.cs プロジェクト: jxnmaomao/ironruby
 protected override Expression VisitChildren(ExpressionVisitor visitor) {
     Expression v = visitor.Visit(_variable);
     if (v == _variable) {
         return this;
     }
     return Utils.Delete(v);
 }
コード例 #4
0
        /// <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;
        }
コード例 #5
0
 protected override Expression VisitChildren(ExpressionVisitor visitor) {
     Expression b = visitor.Visit(_body);
     if (b == _body) {
         return this;
     }
     return new FinallyFlowControlExpression(b);
 }
コード例 #6
0
ファイル: UsingExpression.cs プロジェクト: saber-wang/nlite
 protected override Expression VisitChildren(System.Linq.Expressions.ExpressionVisitor visitor)
 {
     return(Update(
                (ParameterExpression)visitor.Visit(variable),
                visitor.Visit(disposable),
                visitor.Visit(body)));
 }
コード例 #7
0
 protected override Expression VisitChildren(ExpressionVisitor visitor) {
     var instance = visitor.Visit(_expr);
     if (instance != _expr) {
         return new LightCheckAndThrowExpression(instance);
     }
     return this;
 }
コード例 #8
0
ファイル: YieldExpression.cs プロジェクト: rudimk/dlr-dotnet
 protected override Expression VisitChildren(ExpressionVisitor visitor) {
     Expression v = visitor.Visit(_value);
     if (v == _value) {
         return this;
     }
     return Utils.MakeYield(_target, v, YieldMarker);
 }
コード例 #9
0
 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;
        }
コード例 #11
0
    protected override Expression VisitChildren (ExpressionVisitor visitor)
    {
      var result = visitor.Visit (_expression);
      if (result != _expression)
        return new NonReducibleExtensionExpression (result);

      return this;
    }
コード例 #12
0
        /// <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;
        }
コード例 #13
0
		protected override Expression VisitChildren(ExpressionVisitor visitor)
		{
			QueryNode newTarget = (QueryNode)visitor.Visit(Target);
			if (newTarget == Target)
				return this;
			else
				return new MergeByName(newTarget);
		}
コード例 #14
0
        protected override Expression VisitChildren(ExpressionVisitor visitor) {
            var exception = visitor.Visit(_exception);
            if (exception != _exception) {
                return new LightThrowExpression(exception);
            }

            return this;
        }
コード例 #15
0
        protected override Expression VisitChildren(ExpressionVisitor visitor)
        {
            var newExpression = visitor.Visit(_operand);

            return newExpression != _operand
                ? new NotNullableExpression(newExpression)
                : this;
        }
コード例 #16
0
        /// <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;
        }
コード例 #17
0
        protected override Expression VisitChildren(ExpressionVisitor visitor)
        {
            var newInnerExpression = visitor.Visit(_expression);

            return newInnerExpression != _expression 
                ? new AliasExpression(Alias, newInnerExpression)
                : this;
        }
コード例 #18
0
ファイル: Sort.cs プロジェクト: Paccc/SharpDevelop
		protected override Expression VisitChildren(ExpressionVisitor visitor)
		{
			QueryNode newTarget = (QueryNode)visitor.Visit(Target);
			if (newTarget == Target)
				return this;
			else
				return new Sort(newTarget, arguments);
		}
コード例 #19
0
ファイル: Limit.cs プロジェクト: Paccc/SharpDevelop
		protected override Expression VisitChildren(ExpressionVisitor visitor)
		{
			QueryNode newTarget = (QueryNode)visitor.Visit(Target);
			if (newTarget == Target)
				return this;
			else
				return new Limit(newTarget, Start, Length);
		}
コード例 #20
0
        protected override Expression Accept(ExpressionVisitor visitor)
        {
            var parsedVisitor = visitor as CompilingExpressionVisitor;
            if (parsedVisitor != null)
                return Accept(parsedVisitor);

            return base.Accept(visitor);
        }
コード例 #21
0
        protected override Expression VisitChildren(ExpressionVisitor visitor)
        {
            var arguments = visitor.VisitAndConvert(new ReadOnlyCollection<Expression>(_arguments), "VisitChildren");

            return arguments != Arguments
                ? new SqlFunctionExpression(FunctionName, arguments, Type)
                : this;
        }
コード例 #22
0
        protected override Expression VisitChildren(ExpressionVisitor visitor) {
            Expression lineNo = visitor.Visit(_lineNumberExpression);
            if (lineNo != _lineNumberExpression) {
                return new LastFaultingLineExpression(lineNo);
            }

            return this;
        }
コード例 #23
0
        protected override Expression VisitChildren(ExpressionVisitor visitor)
        {
            var newPredicate = visitor.Visit(_predicate);

            return _predicate != newPredicate
                ? new DiscriminatorPredicateExpression(newPredicate, QuerySource)
                : this;
        }
コード例 #24
0
 protected override Expression VisitChildren(System.Linq.Expressions.ExpressionVisitor visitor)
 {
     return(Update(
                visitor.Visit(test),
                visitor.Visit(body),
                continue_target,
                break_target));
 }
コード例 #25
0
ファイル: ForEachExpression.cs プロジェクト: saber-wang/nlite
 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));
 }
コード例 #26
0
        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));
        }
コード例 #27
0
 protected sealed override Expression Accept(ExpressionVisitor visitor)
 {
     var mongoVisitor = visitor as ExtensionExpressionVisitor;
     if (mongoVisitor != null)
     {
         return Accept(mongoVisitor);
     }
     return base.Accept(visitor);
 }
コード例 #28
0
 protected override Expression Accept(ExpressionVisitor visitor)
 {
     var reducible = visitor as IReducingExpressionVisitor;
     if (reducible != null)
     {
         return reducible.VisitReducible(this);
     }
     return base.Accept(visitor);
 }
コード例 #29
0
        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;
        }
コード例 #30
0
        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;
        } 
コード例 #31
0
ファイル: AwaitExpression.cs プロジェクト: Alxandr/IronTotem
 protected override Expression VisitChildren(ExpressionVisitor visitor)
 {
     Expression v = visitor.Visit(_value);
     if (v == _value)
     {
         return this;
     }
     return new AwaitExpression(v);
 }
コード例 #32
0
        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);
        }
コード例 #33
0
    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);
    }
コード例 #34
0
        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);
        }
コード例 #35
0
ファイル: ScopeStatement.cs プロジェクト: yuhan0/ironpython3
 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;
 }
コード例 #36
0
 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));
 }
コード例 #37
0
 /// <summary>
 /// Dispatches to the specific visit method for this node type.
 /// </summary>
 protected internal override Expression Accept(ExpressionVisitor visitor)
 {
     return(visitor.VisitInvocation(this));
 }
コード例 #38
0
 internal virtual void RewriteBody(MSAst.ExpressionVisitor visitor)
 {
     _funcCode = null;
 }
コード例 #39
0
 protected override MSAst.Expression VisitChildren(MSAst.ExpressionVisitor visitor)
 {
     return(visitor.Visit(_body));
 }
コード例 #40
0
 protected override SystemLinq.Expression VisitChildren(SystemLinq.ExpressionVisitor visitor) => throw Exception;
コード例 #41
0
 protected internal override Expression Accept(ExpressionVisitor visitor)
 {
   return default(Expression);
 }
コード例 #42
0
 /// <summary>
 /// Dispatches to the specific visit method for this node type.
 /// </summary>
 protected internal override Expression Accept(ExpressionVisitor visitor)
 {
     return(visitor.VisitRuntimeVariables(this));
 }
コード例 #43
0
 /// <summary>
 /// Dispatches to the specific visit method for this node type.
 /// </summary>
 protected internal override Expression Accept(ExpressionVisitor visitor)
 {
     return(visitor.VisitMember(this));
 }
コード例 #44
0
 public override Expression Accept(ExpressionVisitor visitor)
 {
     return visitor.VisitIndex(this);
 }
コード例 #45
0
 internal override void RewriteBody(MSAst.ExpressionVisitor visitor)
 {
     _dlrBody = null;
     _body    = new RewrittenBodyStatement(Body, visitor.Visit(Body));
 }
コード例 #46
0
 /// <summary>
 /// Dispatches to the specific visit method for this node type.
 /// </summary>
 protected internal override Expression Accept(ExpressionVisitor visitor)
 {
     return(visitor.VisitConditional(this));
 }
コード例 #47
0
ファイル: Expression.cs プロジェクト: erisonliang/Theraot
 /// <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));
 }
コード例 #48
0
 protected override Expression Accept(ExpressionVisitor visitor)
 {
     throw new NotImplementedException();
 }
コード例 #49
0
 protected override MSAst.Expression VisitChildren(MSAst.ExpressionVisitor visitor)
 {
     return(this);
 }
コード例 #50
0
 protected override MSAst.Expression Accept(MSAst.ExpressionVisitor visitor)
 {
     return(this);
 }