Esempio n. 1
0
        private string CreateMethodName(ZCMethodDesc zdesc)
        {
            List <string> list = new List <string>();

            for (int i = 0; i < zdesc.Parts.Length; i++)
            {
                object item = zdesc.Parts[i];
                if (item is string)
                {
                    list.Add(item as string);
                }
                else if (item is ZCBracketDesc)
                {
                    ZCBracketDesc zbracket = item as ZCBracketDesc;
                    for (var j = 0; j < zbracket.ParamsCount; j++)
                    {
                        var zparam = zbracket.ZParams[j];
                        if (zparam.GetIsGenericParam())
                        {
                            list.Add("类型");
                        }
                        else
                        {
                            list.Add(zparam.ZParamType.ZTypeName);
                        }
                    }
                }
                else
                {
                    throw new ZyyRTException();
                }
            }
            return(string.Join("", list));
        }
Esempio n. 2
0
 public void EmitName()
 {
     for (int i = 0; i < NameParts.Count; i++)
     {
         var term = NameParts[i];
         if (term is List <MethodParameter> )
         {
             var _ZBracketDefDesc = new ZCBracketDesc();
             var args             = (List <MethodParameter>)term;
             foreach (MethodParameter item in args)
             {
                 item.EmitName();
             }
         }
     }
     //for (int i = 0; i < NameRaw.NameTerms.Count; i++)
     //{
     //    var term = NameRaw.NameTerms[i];
     //    if (term is ProcBracket)
     //    {
     //        var pbracket = term as ProcBracket;
     //        pbracket.EmitName();
     //    }
     //}
 }
Esempio n. 3
0
 public ZCMethodDesc GetZDesc()
 {
     if (_ProcDesc == null)
     {
         _ProcDesc = ((ContextMethod)this.MethodAST.MethodContext).ZMethodInfo.ZMethodDesc;// new ZCMethodDesc();
         for (int i = 0; i < NameParts.Count; i++)
         {
             var term = NameParts[i];
             if (term is string)
             {
                 //var textterm = term as LexToken;
                 string namePart = (string)term;
                 _ProcDesc.Add(namePart);
             }
             else if (term is List <MethodParameter> )
             {
                 var _ZBracketDefDesc = new ZCBracketDesc();
                 var args             = (List <MethodParameter>)term;
                 foreach (MethodParameter item in args)
                 {
                     var zarg = item.GetZParam();
                     _ZBracketDefDesc.Add(zarg);
                 }
                 //ProcBracket pbrackets = term as ProcBracket;
                 //var bracketDesc = pbrackets.GetZDesc();
                 _ProcDesc.Add(_ZBracketDefDesc);
             }
             else
             {
                 throw new CCException();
             }
         }
         return(_ProcDesc);
     }
     return(_ProcDesc);
 }