コード例 #1
0
        protected void InitPackageDescTable()
        {
            _PackageDescTable = new Dictionary <string, ZPackageInfo>();

            var refTypes = ZAssembly.GetTypes();

            foreach (var type in refTypes)
            {
                if (type.IsPublic)
                {
                    string packageName = type.Namespace;
                    packageName = packageName.Replace('.', '/');
                    ZPackageInfo zpackage = GetZPackageDesc(packageName);
                    var          descType = ZTypeManager.GetByMarkType(type);
                    if (descType != null)
                    {
                        zpackage.AddZDescType(descType);
                    }
                    else
                    {
                        var zdim = ZTypeManager.CreateZLDimImp(type);
                        if (zdim != null)
                        {
                            zpackage.AddZDimType(zdim);
                        }
                    }
                }
            }
        }
コード例 #2
0
ファイル: ZCodeParser.cs プロジェクト: pyzh/ZLanguage3
 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));
     }
 }
コード例 #3
0
ファイル: ProcDescHelper.cs プロジェクト: pyzh/ZCompileCore2
        public static ZConstructorDesc CreateZConstructorDesc(ConstructorInfo ci)
        {
            List <ZMethodNormalArg> args = new List <ZMethodNormalArg>();

            foreach (ParameterInfo param in ci.GetParameters())
            {
                ZMethodNormalArg arg = new ZMethodNormalArg(param.Name, ZTypeManager.GetBySharpType(param.ParameterType) as ZType);
                args.Add(arg);
            }
            ZConstructorDesc desc = new ZConstructorDesc(args);

            desc.Constructor = ci;
            return(desc);
        }
コード例 #4
0
        protected void InitPackageDescTable()
        {
            _PackageDescTable = new Dictionary <string, ZPackageDesc>();

            var refTypes = ZAssembly.GetTypes();

            foreach (var type in refTypes)
            {
                if (type.IsPublic)
                {
                    string       packageName = type.Namespace;
                    ZPackageDesc zpackage    = GetZPackageDesc(packageName);

                    IZDescType descType = ZTypeManager.GetByMarkType(type);
                    if (descType != null)
                    {
                        zpackage.AddZDescType(descType);
                    }
                }
            }
        }
コード例 #5
0
 public ZType GetMemberZType()
 {
     return(ZTypeManager.GetBySharpType(SharpField.FieldType) as ZType);
 }