Exemplo n.º 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));
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
 }
Exemplo n.º 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();
        }
Exemplo n.º 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);
        }
Exemplo n.º 6
0
        // public string ArgName { get; protected set; }

        public ZMethodNormalArg(string argName, ZType argType)
        {
            ArgZType = argType;
            ArgName  = argName;
        }
Exemplo n.º 7
0
        //public string ArgName { get; protected set; }

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

            return(ztype);
        }
Exemplo n.º 9
0
        //public object Data { get; set; }

        public ZCallValueArg(ZType argZType)
        {
            ValueZType = argZType;
        }
Exemplo n.º 10
0
        //public object Data { get; set; }

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