public override object VisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data)
 {
     if (nameComparer.Equals(from, parameterDeclarationExpression.ParameterName)) {
         parameterDeclarationExpression.ParameterName = to;
     }
     return base.VisitParameterDeclarationExpression(parameterDeclarationExpression, data);
 }
Ejemplo n.º 2
0
        public override object VisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data)
        {
            CodeParameterDeclarationExpression parameter = new CodeParameterDeclarationExpression(ConvType(parameterDeclarationExpression.TypeReference), parameterDeclarationExpression.ParameterName);

            parameters.Add(parameter);

            return parameter;
        }
 public virtual object TrackedVisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data)
 {
     return base.VisitParameterDeclarationExpression(parameterDeclarationExpression, data);
 }
 public override sealed object VisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data)
 {
     this.BeginVisit(parameterDeclarationExpression);
     object result = this.TrackedVisitParameterDeclarationExpression(parameterDeclarationExpression, data);
     this.EndVisit(parameterDeclarationExpression);
     return result;
 }
Ejemplo n.º 5
0
 public virtual object VisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data)
 {
     Debug.Assert((parameterDeclarationExpression != null));
     Debug.Assert((parameterDeclarationExpression.Attributes != null));
     Debug.Assert((parameterDeclarationExpression.TypeReference != null));
     Debug.Assert((parameterDeclarationExpression.DefaultValue != null));
     foreach (AttributeSection o in parameterDeclarationExpression.Attributes) {
         Debug.Assert(o != null);
         o.AcceptVisitor(this, data);
     }
     parameterDeclarationExpression.TypeReference.AcceptVisitor(this, data);
     return parameterDeclarationExpression.DefaultValue.AcceptVisitor(this, data);
 }
 public virtual object VisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data)
 {
     throw new global::System.NotImplementedException("ParameterDeclarationExpression");
 }
Ejemplo n.º 7
0
 public override object VisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data)
 {
     curBlock.Add(parameterDeclarationExpression.ParameterName);
     //print("add parameter ${parameterDeclarationExpression.ParameterName} to block")
     return base.VisitParameterDeclarationExpression(parameterDeclarationExpression, data);
 }
Ejemplo n.º 8
0
        void FormalParameter(out ParameterDeclarationExpression p)
        {
            AttributeSection section;
            List<AttributeSection> attributes = new List<AttributeSection>();
            TypeReference type = null;
            ParamModifierList mod = new ParamModifierList(this);
            Expression expr = null;
            p = null;
            ArrayList arrayModifiers = null;
            Location startLocation = la.Location;

            while (la.kind == 40) {
            AttributeSection(out section);
            attributes.Add(section);
            }
            while (StartOf(29)) {
            ParameterModifier(mod);
            }
            Identifier();
            string parameterName = t.val;
            if (IsDims()) {
            ArrayTypeModifiers(out arrayModifiers);
            }
            if (la.kind == 63) {
            Get();
            TypeName(out type);
            }
            if(type != null) {
                if (arrayModifiers != null) {
                    if (type.RankSpecifier != null) {
                        Error("array rank only allowed one time");
                    } else {
                        type.RankSpecifier = (int[])arrayModifiers.ToArray(typeof(int));
                    }
                }
            }

            if (la.kind == 20) {
            Get();
            Expr(out expr);
            }
            mod.Check();
            p = new ParameterDeclarationExpression(type, parameterName, mod.Modifier, expr);
            p.Attributes = attributes;
            p.StartLocation = startLocation;
            p.EndLocation = t.EndLocation;
        }
 public virtual object VisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data)
 {
     Debug.Assert((parameterDeclarationExpression != null));
     Debug.Assert((parameterDeclarationExpression.Attributes != null));
     Debug.Assert((parameterDeclarationExpression.TypeReference != null));
     Debug.Assert((parameterDeclarationExpression.DefaultValue != null));
     for (int i = 0; i < parameterDeclarationExpression.Attributes.Count; i++) {
         AttributeSection o = parameterDeclarationExpression.Attributes[i];
         Debug.Assert(o != null);
         nodeStack.Push(o);
         o.AcceptVisitor(this, data);
         o = (AttributeSection)nodeStack.Pop();
         if (o == null)
             parameterDeclarationExpression.Attributes.RemoveAt(i--);
         else
             parameterDeclarationExpression.Attributes[i] = o;
     }
     nodeStack.Push(parameterDeclarationExpression.TypeReference);
     parameterDeclarationExpression.TypeReference.AcceptVisitor(this, data);
     parameterDeclarationExpression.TypeReference = ((TypeReference)(nodeStack.Pop()));
     nodeStack.Push(parameterDeclarationExpression.DefaultValue);
     parameterDeclarationExpression.DefaultValue.AcceptVisitor(this, data);
     parameterDeclarationExpression.DefaultValue = ((Expression)(nodeStack.Pop()));
     return null;
 }