Beispiel #1
0
 private ZType GetZTypeByTypeName(string typeName)
 {
     if (!IsGenericTypName(typeName))
     {
         var ztypes = ZTypeManager.GetByMarkName(typeName);
         if (ztypes.Length == 0)
         {
             ztypes = ZTypeManager.GetBySharpName(typeName);
         }
         if (ztypes.Length > 0)
         {
             ZType ztype = ztypes[0] as ZType;
             //arg = new ZMethodArg(typeName, ztype);
             return(ztype);
         }
         else
         {
         }
         return(null);
     }
     else
     {
         string shortClassName = GetGenericTypNameShortName(typeName);
         return(GetZTypeByTypeName(shortClassName));
     }
 }
Beispiel #2
0
        public ZType SearchZTypeOne(string zname)
        {
            ZType ztype = null;

            ztype = EnumerableHelper.SearchOne <ZEnumType>(EnumTypes, (ZEnumType zenum) => zenum.ZName == zname);
            if (ztype == null)
            {
                ztype = EnumerableHelper.SearchOne <ZClassType>(ClassTypes, (ZClassType zclass) => zclass.ZName == zname);
            }
            return(ztype);
        }
Beispiel #3
0
 public bool ZEquals(ZType zclass)
 {
     if (zclass is ZLEnumInfo)
     {
         ZLEnumInfo z2 = (zclass as ZLEnumInfo);
         if (z2.SharpType == this.SharpType)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #4
0
        public ZType[] SearchZType(string zname)
        {
            ZType ztype = SearchZTypeOne(zname);

            if (ztype == null)
            {
                return(new ZType[] { });
            }
            else
            {
                return(new ZType[] { ztype });
            }
            //List<ZType> ztypes = new List<ZType>();
            //ztypes.AddRange( ZTypeListHelper.Search(zname, EnumTypes.ToArray()));
            //ztypes.AddRange(ZTypeListHelper.Search(zname, ClassTypes.ToArray()));
            //return ztypes.ToArray();
        }
Beispiel #5
0
        public WordInfo SearchWord(string text)
        {
            if (!ContainsWord(text))
            {
                return(null);
            }
            ZType    ztype = SearchZTypeOne(text);
            WordInfo info0 = null;

            if (ztype != null)
            {
                info0 = new WordInfo(text, WordKind.TypeName, ztype);
            }
            WordInfo info1   = IWordDictionaryHelper.EnumerableSearchWord(text, EnumTypes);
            WordInfo info2   = IWordDictionaryHelper.EnumerableSearchWord(text, ClassTypes);
            WordInfo newWord = WordInfo.Merge(info0, info1, info2);

            return(newWord);
        }
Beispiel #6
0
        // public string ArgName { get; protected set; }

        public ZMethodNormalArg(string argName, ZType argType)
        {
            ArgZType = argType;
            ArgName  = argName;
        }
        //public string ArgName { get; protected set; }

        public ZMethodGenericArg(string argName, ZType argBaseType)
        {
            ArgName      = argName;
            ArgBaseZType = argBaseType;
        }
Beispiel #8
0
        public static ZType RegNewGenericType(Type newType)
        {
            ZType ztype = CreateZTypeImp(newType) as ZType;

            return(ztype);
        }
Beispiel #9
0
        //public object Data { get; set; }

        public ZCallValueArg(ZType argZType)
        {
            ValueZType = argZType;
        }
Beispiel #10
0
        //public object Data { get; set; }

        public ZCallGenericArg(ZType argZType)
        {
            BaseZType = argZType;
        }
Beispiel #11
0
 public ZArgCall(string name, ZType ztype)
 {
     ZArgName = name;
     ZArgType = ztype;
 }
Beispiel #12
0
 public ZCLocalVar(string name, ZType type, bool isAutoGenerated)
 {
     this.ZName      = name;
     ZType           = type;
     IsAutoGenerated = isAutoGenerated;
 }
Beispiel #13
0
 public ZCLocalVar(string name, ZType type)
 {
     this.ZName = name;
     ZType      = type;
 }