Esempio n. 1
0
 static NetParam Uniquify(NetParam p, List <NetParam> pl, int startPoint)
 {
     while (!IsUnique(p, pl, startPoint) || CSKeywords.IsKeyword(p.Name))
     {
         p = new NetParam(p.Name + '0', p.Type);
     }
     return(p);
 }
Esempio n. 2
0
 static bool IsUnique(NetParam p, List <NetParam> pl, int startPoint)
 {
     for (int i = startPoint; i < pl.Count; i++)
     {
         if (p.Name == pl [i].Name)
         {
             return(false);
         }
     }
     return(true);
 }
Esempio n. 3
0
        static List <NetParam> SanitizeParamNames(List <NetParam> parms)
        {
            List <NetParam> outlist = new List <NetParam> ();
            bool            changed = false;

            do
            {
                changed = false;
                outlist = new List <NetParam> ();
                for (int i = 0; i < parms.Count; i++)
                {
                    NetParam q = Uniquify(parms [i], parms, i + 1);
                    changed = q.Name != parms [i].Name;
                    outlist.Add(q);
                }
                if (changed)
                {
                    parms = outlist;
                }
            } while (changed);
            return(outlist);
        }