Пример #1
0
 public virtual bool Visit(Net.Vpc.Upa.Expressions.Expression expression, Net.Vpc.Upa.Expressions.ExpressionTag tag)
 {
     foreach (Net.Vpc.Upa.Expressions.TaggedExpression cc in expression.GetChildren())
     {
         Net.Vpc.Upa.Expressions.Expression cce = cc.GetExpression();
         if (cce != null)
         {
             if (cce is Net.Vpc.Upa.Expressions.UserExpression)
             {
                 Net.Vpc.Upa.Expressions.Expression rr = expressionManager.ParseExpression(cce);
                 rr.Visit(this);
                 expression.SetChild(rr, cc.GetTag());
             }
             else if (cce is Net.Vpc.Upa.Expressions.Var)
             {
                 Net.Vpc.Upa.Expressions.Var v = (Net.Vpc.Upa.Expressions.Var)cce;
                 if (v.GetApplier() == null && v.GetName().Equals("this"))
                 {
                     v.SetName(thisName);
                 }
             }
         }
     }
     return(true);
 }
 public virtual bool Visit(Net.Vpc.Upa.Expressions.Expression expression, Net.Vpc.Upa.Expressions.ExpressionTag tag)
 {
     foreach (Net.Vpc.Upa.Expressions.TaggedExpression cc in expression.GetChildren())
     {
         Net.Vpc.Upa.Expressions.Expression cce = cc.GetExpression();
         if (cce != null)
         {
             if (cce is Net.Vpc.Upa.Expressions.UserExpression)
             {
                 Net.Vpc.Upa.Expressions.UserExpression ucce = (Net.Vpc.Upa.Expressions.UserExpression)cce;
                 Net.Vpc.Upa.Expressions.Expression     expr = expressionManager.ParseExpression(ucce.GetExpression());
                 expr.Visit(new Net.Vpc.Upa.Impl.Uql.Util.UserExpressionParametersMatcherVisitor(ucce));
                 expression.SetChild(expr, cc.GetTag());
             }
         }
     }
     return(true);
 }
Пример #3
0
 public virtual void Visit(Net.Vpc.Upa.Expressions.ExpressionVisitor visitor)
 {
     System.Collections.Generic.Stack <Net.Vpc.Upa.Expressions.TaggedExpression> stack = new System.Collections.Generic.Stack <Net.Vpc.Upa.Expressions.TaggedExpression>();
     stack.Push(new Net.Vpc.Upa.Expressions.TaggedExpression(this, null));
     while (!(stack.Count == 0))
     {
         Net.Vpc.Upa.Expressions.TaggedExpression e    = stack.Pop();
         Net.Vpc.Upa.Expressions.Expression       expr = e.GetExpression();
         if (expr != null)
         {
             if (!visitor.Visit(expr, e.GetTag()))
             {
                 return;
             }
             System.Collections.Generic.IList <Net.Vpc.Upa.Expressions.TaggedExpression> c = expr.GetChildren();
             if (c != null)
             {
                 foreach (Net.Vpc.Upa.Expressions.TaggedExpression te in c)
                 {
                     stack.Push(te);
                 }
             }
         }
     }
 }