Exemple #1
0
        void parseBracket()
        {
            i++;
            ZLBracketDesc zbracket = new ZLBracketDesc();

            for (; i < Code.Length; i++)
            {
                ZLParamInfo arg = ParseZParam();
                if (arg != null)
                {
                    zbracket.Add(arg);
                }
                if (ch == '\0')
                {
                    break;
                }
                if (ch == ')')
                {
                    i++;
                    break;
                }
            }
            /* ZCode括号内无参数则去掉括号 */
            if (zbracket.ParamsCount > 0)
            {
                zmethodDesc.Add(zbracket);
            }
        }
Exemple #2
0
        public static ZLConstructorDesc CreateZConstructorDesc(ConstructorInfo ci, ZLConstructorInfo zlc, ZLClassInfo zclass)
        {
            ZLBracketDesc zbracket = new ZLBracketDesc();
            //List<ZArgDefNormalDesc> args = new List<ZArgDefNormalDesc>();
            int index = 0;

            foreach (ParameterInfo param in ci.GetParameters())
            {
                ZLParamInfo arg = new ZLParamInfo(param, zlc, index);// , false);
                zbracket.Add(arg);
                index++;
            }
            ZLConstructorDesc desc = new ZLConstructorDesc(zlc, zbracket);

            return(desc);
        }
Exemple #3
0
        public static ZLParamInfo[] GetZLParams(ZLMethodInfo zmethod)
        {
            var markMethod  = zmethod.MarkMethod;
            var sharpMethod = zmethod.SharpMethod;

            List <ZLParamInfo> list = new List <ZLParamInfo>();

            ParameterInfo[] parameters = sharpMethod.GetParameters();
            int             index      = 0;

            foreach (ParameterInfo peramter in parameters)
            {
                ZLParamInfo zlparam = new ZLParamInfo(peramter, zmethod, index);//, false);
                list.Add(zlparam);
                index++;
            }
            return(list.ToArray());
        }
Exemple #4
0
        private ParameterInfo GetMethodParameterInfo(string parameterName)
        {
            ZLParamInfo zp = this.zlmethod.SearchParameter(parameterName);

            if (zp == null)
            {
                return(null);
            }
            return(zp.ParameterInfo);
            //var parameters = this.zlmethod.SharpMethod.GetParameters();
            //foreach(var item in parameters)
            //{
            //    if(item.Name==parameterName )
            //    {
            //        return item;
            //    }
            //}
            //return null;
        }
Exemple #5
0
        private ZLParamInfo ParseZParam()
        {
            string argTypeName = parseIdent();

            movenext();
            string argname = parseIdent();

            if (string.IsNullOrEmpty(argname))
            {
                return(null);
            }
            ParameterInfo paramInfo = GetMethodParameterInfo(argname);// paramsDict[argname];

            if (paramInfo == null)
            {
                throw new ZyyRTException("ZCode'" + Code + "'的参数'" + argname + "'找不到对应的ParameterInfo");
            }
            if (this.zlmethod.HasGenericParameter(argTypeName))//.genericTypeDict.ContainsKey(argTypeName))
            {
                //var genericRealTypeName = genericTypeDict[argTypeName].Name;
                ZLParamInfo zp = new ZLParamInfo(paramInfo, this.zlmethod, paramIndex);//, true);
                paramIndex++;
                return(zp);
            }
            else
            {
                var ztype = GetZTypeByTypeName(argTypeName);
                if (ztype != null)
                {
                    ZLParamInfo zp = new ZLParamInfo(paramInfo, this.zlmethod, paramIndex);//, false);
                    paramIndex++;
                    return(zp);
                }
            }
            throw new ZyyRTException("没有导入'" + argTypeName + "'类型");
        }
Exemple #6
0
 public void Add(ZLParamInfo zlparam)
 {
     _ParamList.Add(zlparam);
 }