Ejemplo n.º 1
0
 protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     foreach (var parameter in this.Parameters.Transform(transform)) {
         yield return parameter;
     }
     yield return this.Body = transform(this.Body);
 }
Ejemplo n.º 2
0
 protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     foreach (var child in base.VisitOrTransformChildren(transform)) {
         yield return child;
     }
     yield return this.ReturnType = (IAstTypeReference)transform(this.ReturnType);
 }
Ejemplo n.º 3
0
 protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     yield return this.Callee = (IAstCallable)transform(this.Callee);
     foreach (var argument in this.Arguments.Transform(transform)) {
         yield return argument;
     }
 }
Ejemplo n.º 4
0
 protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     return Enumerable.Concat(
         Parameters.Transform(transform).Cast<IAstElement>(),
         Body.Transform(transform)
     );
 }
Ejemplo n.º 5
0
 protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     return(Enumerable.Concat(
                Parameters.Transform(transform).Cast <IAstElement>(),
                Body.Transform(transform)
                ));
 }
Ejemplo n.º 6
0
 protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     if (this.Target != null)
     {
         yield return(this.Target = transform(this.Target));
     }
 }
Ejemplo n.º 7
0
        protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
        {
            if (this.Target != null)
                yield return this.Target = transform(this.Target);

            yield return this.Reference = (IAstPropertyReference)transform(this.Reference);
        }
        protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
        {
            if (this.Target != null)
                yield return this.Target = transform(this.Target);

            yield return this.Function = (IAstMethodReference)transform(this.Function);
        }
Ejemplo n.º 9
0
 protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     if (this.Result != null)
     {
         yield return(this.Result = (IAstExpression)transform(this.Result));
     }
 }
Ejemplo n.º 10
0
 protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     yield return this.Source = transform(this.Source);
     foreach (var element in this.Body.Transform(transform)) {
         yield return element;
     }
 }
Ejemplo n.º 11
0
        protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
        {
            yield return(this.Left = (IAstExpression)transform(this.Left));

            yield return(this.Operator = (IAstMethodReference)transform(this.Operator));

            yield return(this.Right = (IAstExpression)transform(this.Right));
        }
Ejemplo n.º 12
0
 protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     if (this.AssignedValue != null)
     {
         yield return(this.AssignedValue = (IAstExpression)transform(this.AssignedValue));
     }
     yield return(this.Type = (IAstTypeReference)transform(this.Type));
 }
Ejemplo n.º 13
0
 protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     foreach (var parameterType in this.ParameterTypes.Transform(transform))
     {
         yield return(parameterType);
     }
     yield return(this.ReturnType = (IAstTypeReference)transform(this.ReturnType));
 }
Ejemplo n.º 14
0
 protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     foreach (var parameter in this.Parameters.Transform(transform))
     {
         yield return(parameter);
     }
     yield return(this.Body = transform(this.Body));
 }
Ejemplo n.º 15
0
        protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
        {
            yield return(this.PrimaryType = (IAstTypeReference)transform(this.PrimaryType));

            foreach (var argument in this.TypeArguments.Transform(transform))
            {
                yield return(argument);
            }
        }
Ejemplo n.º 16
0
        protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
        {
            if (this.Target != null)
            {
                yield return(this.Target = transform(this.Target));
            }

            yield return(this.Reference = (IAstPropertyReference)transform(this.Reference));
        }
Ejemplo n.º 17
0
        protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
        {
            yield return(this.Condition = transform(this.Condition));

            foreach (var element in this.Body.Transform(transform))
            {
                yield return(element);
            }
        }
Ejemplo n.º 18
0
        public static void TransformDescendants(this IAstElement ancestor, AstElementTransform transform)
        {
            Argument.RequireNotNull("transform", transform);

            ancestor.TransformChildren(c => {
                c.TransformDescendants(transform);
                return(transform(c));
            });
        }
Ejemplo n.º 19
0
        protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
        {
            if (this.Target != null)
            {
                yield return(this.Target = transform(this.Target));
            }

            yield return(this.Function = (IAstMethodReference)transform(this.Function));
        }
Ejemplo n.º 20
0
        protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
        {
            yield return(this.Target = transform(this.Target));

            foreach (var argument in this.Arguments.Transform(transform))
            {
                yield return(argument);
            }
        }
Ejemplo n.º 21
0
        public static void TransformChildren(this IAstElement parent, AstElementTransform transform)
        {
            Argument.RequireNotNull("parent", parent);
            Argument.RequireNotNull("transform", transform);

            var enumerator = parent.VisitOrTransformChildren(transform).GetEnumerator();

            while (enumerator.MoveNext())
            {
            }
        }
Ejemplo n.º 22
0
        protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
        {
            yield return this.Type = (IAstTypeReference)transform(this.Type);
            foreach (var argument in this.Arguments.Transform(transform)) {
                yield return argument;
            }
            if (this.Initializer == null)
                yield break;

            yield return this.Initializer = transform(this.Initializer);
        }
Ejemplo n.º 23
0
 protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     foreach (var child in base.VisitOrTransformChildren(transform))
     {
         yield return(child);
     }
     if (this.fixedReturnType != null)
     {
         yield return(this.fixedReturnType = (IAstTypeReference)transform(this.fixedReturnType));
     }
 }
Ejemplo n.º 24
0
        public static void TransformChildren <TAstElement>(this IAstElement parent, AstElementTransform <TAstElement> transform)
            where TAstElement : IAstElement
        {
            Argument.RequireNotNull("transform", transform);
            parent.TransformChildren(c => {
                if (!(c is TAstElement))
                {
                    return(c);
                }

                return(transform((TAstElement)c));
            });
        }
Ejemplo n.º 25
0
        protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
        {
            yield return(this.Type = (IAstTypeReference)transform(this.Type));

            foreach (var argument in this.Arguments.Transform(transform))
            {
                yield return(argument);
            }
            if (this.Initializer == null)
            {
                yield break;
            }

            yield return(this.Initializer = transform(this.Initializer));
        }
Ejemplo n.º 26
0
        public static void TransformDescendants <TAstElement>(this IAstElement ancestor, AstElementTransform <TAstElement> transform)
            where TAstElement : IAstElement
        {
            Argument.RequireNotNull("transform", transform);

            ancestor.TransformDescendants(c => {
                c.TransformDescendants(transform);
                if (!(c is TAstElement))
                {
                    return(c);
                }

                return(transform((TAstElement)c));
            });
        }
Ejemplo n.º 27
0
 protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     if (this.AssignedValue != null)
         yield return this.AssignedValue = (IAstExpression)transform(this.AssignedValue);
     yield return this.Type = (IAstTypeReference)transform(this.Type);
 }
Ejemplo n.º 28
0
 protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     yield return this.Value = transform(this.Value);
 }
Ejemplo n.º 29
0
 IEnumerable <IAstElement> IAstElement.VisitOrTransformChildren(AstElementTransform transform)
 {
     return(this.VisitOrTransformChildren(transform));
 }
Ejemplo n.º 30
0
 protected abstract IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform);
Ejemplo n.º 31
0
 protected abstract IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform);
Ejemplo n.º 32
0
 protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     foreach (var parameterType in this.ParameterTypes.Transform(transform)) {
         yield return parameterType;
     }
     yield return this.ReturnType = (IAstTypeReference)transform(this.ReturnType);
 }
Ejemplo n.º 33
0
 protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     yield return this.Left = (IAstExpression)transform(this.Left);
     yield return this.Operator = (IAstMethodReference)transform(this.Operator);
     yield return this.Right = (IAstExpression)transform(this.Right);
 }
Ejemplo n.º 34
0
 IEnumerable<IAstElement> IAstElement.VisitOrTransformChildren(AstElementTransform transform)
 {
     return this.VisitOrTransformChildren(transform);
 }
Ejemplo n.º 35
0
 protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     yield return(this.Type = (IAstTypeReference)transform(this.Type));
 }
Ejemplo n.º 36
0
 protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     yield return this.PrimaryType = (IAstTypeReference)transform(this.PrimaryType);
     foreach (var argument in this.TypeArguments.Transform(transform)) {
         yield return argument;
     }
 }
Ejemplo n.º 37
0
 protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     yield return(this.Value = transform(this.Value));
 }
Ejemplo n.º 38
0
 protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     if (this.Result != null)
         yield return this.Result = (IAstExpression)transform(this.Result);
 }
Ejemplo n.º 39
0
 protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     return this.Elements.Transform(transform);
 }
Ejemplo n.º 40
0
 protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     return(this.Actual.VisitOrTransformChildren(transform));
 }
Ejemplo n.º 41
0
 protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     yield return this.Type = (IAstTypeReference)transform(this.Type);
 }
Ejemplo n.º 42
0
        protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
        {
            yield return(this.Target = (IAstAssignable)transform(this.Target));

            yield return(this.Value = (IAstExpression)transform(this.Value));
        }
Ejemplo n.º 43
0
 protected override IEnumerable<IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     yield return this.Target = (IAstAssignable)transform(this.Target);
     yield return this.Value = (IAstExpression)transform(this.Value);
 }
Ejemplo n.º 44
0
 protected override IEnumerable <IAstElement> VisitOrTransformChildren(AstElementTransform transform)
 {
     return(No.Elements);
 }
Ejemplo n.º 45
0
        public static IEnumerable <TAstElement> Transform <TAstElement>(this IList <TAstElement> elements, AstElementTransform transform)
            where TAstElement : IAstElement
        {
            Argument.RequireNotNull("elements", elements);
            Argument.RequireNotNull("transform", transform);

            for (var i = 0; i < elements.Count; i++)
            {
                var transformed = (TAstElement)transform(elements[i]);
                if (!object.ReferenceEquals(transformed, elements[i]))
                {
                    elements[i] = transformed;
                }

                yield return(elements[i]);
            }
        }