protected void CreateEachSymbols() { var procContext = this.ExpContext.ProcContext; int foreachIndex = this.ExpContext.ProcContext.CreateEachIndex(); var listSymbolName = "@each" + foreachIndex + "_list"; var indexName = "@each" + foreachIndex + "_index"; var elementName = "@each" + foreachIndex + "_item"; var countName = "@each" + foreachIndex + "_count"; ListSymbol = new ZCLocalVar(listSymbolName, SubjectExp.RetType, true); //ListSymbol.LoacalVarIndex = procContext.CreateLocalVarIndex(ListSymbol.ZName); this.ProcContext.AddLocalVar(ListSymbol); Type[] genericTypes = GenericUtil.GetInstanceGenriceType(ZTypeUtil.GetTypeOrBuilder(SubjectExp.RetType), typeof(列表 <>)); //Type[] genericTypes = GenericUtil.GetInstanceGenriceType(SubjectExp.RetType.SharpType, typeof(列表<>)); Type ElementType = genericTypes[0]; IndexSymbol = new ZCLocalVar(indexName, ZLangBasicTypes.ZINT, true); //IndexSymbol.LoacalVarIndex = procContext.CreateLocalVarIndex(indexName); this.ProcContext.AddLocalVar(IndexSymbol); CountSymbol = new ZCLocalVar(countName, ZLangBasicTypes.ZINT, true); //CountSymbol.LoacalVarIndex = procContext.CreateLocalVarIndex(countName); this.ProcContext.AddLocalVar(CountSymbol); }
public override void Emit() { SubjectExp.Emit(); EmitHelper.StormVar(IL, ListSymbol.VarBuilder); EmitHelper.LoadInt(IL, START_INDEX); EmitHelper.StormVar(IL, IndexSymbol.VarBuilder); EmitHelper.LoadVar(IL, ListSymbol.VarBuilder); EmitHelper.CallDynamic(IL, getCountMethod); EmitHelper.StormVar(IL, CountSymbol.VarBuilder); var True_Label = IL.DefineLabel(); var False_Label = IL.DefineLabel(); EmitCondition(); IL.Emit(OpCodes.Brfalse, False_Label); //定义一个标签,表示从下面开始进入循环体 IL.MarkLabel(True_Label); BodyExp.Emit(); if (ZTypeUtil.IsBool(BodyExp.RetType))//(BodyExp.RetType.SharpType != typeof(void)) { IL.Emit(OpCodes.Pop); } EmitHelper.Inc(IL, IndexSymbol.VarBuilder); EmitCondition(); IL.Emit(OpCodes.Brtrue, True_Label); IL.MarkLabel(False_Label); }
public override Exp Analy( ) { if (this.IsAnalyed) { return(this); } SubjectExp = AnalySubExp(SubjectExp); ArgExp = AnalySubExp(ArgExp); if (!this.AnalyCorrect) { return(this); } var propertyName = ZLangUtil.ZListItemPropertyName; var subjType = SubjectExp.RetType; if (subjType is ZLClassInfo) { ZLClassInfo zclass = subjType as ZLClassInfo; Type argType = ZTypeUtil.GetTypeOrBuilder(ArgExp.RetType); Property = zclass.SharpType.GetProperty(propertyName, new Type[] { argType }); } if (Property == null) { Errorf(SubjectExp.Position, "不存在索引"); } else { RetType = ZTypeManager.GetBySharpType(Property.PropertyType) as ZType; } IsAnalyed = true; return(this); }
protected List <Exp> AnalyArgLambda(ZLParamInfo[] defArgs, List <Exp> expArgs) { if (defArgs.Length != expArgs.Count) { throw new CCException(); } List <Exp> newExpArgs = new List <Exp>(); int size = defArgs.Length; for (int i = 0; i < size; i++) { var defArg = defArgs[i]; var expArg = expArgs[i]; if (defArg.GetIsGenericParam() == false && ZTypeUtil.IsFn(defArg.ZParamType)) { throw new CCException("参数不能同时是泛型参数和lambda参数"); } if (defArg.GetIsGenericParam() == false) { newExpArgs.Add(expArg); } else if (ZTypeUtil.IsFn(defArg.ZParamType)) { ExpNewLambda newLambdaExp = new ExpNewLambda(this.ExpContext, expArg, defArg.ZParamType); //newLambdaExp.SetContextExp(this.ExpContext); Exp exp2 = newLambdaExp.Analy(); newExpArgs.Add(exp2); } else { newExpArgs.Add(expArg); } } return(newExpArgs); }
public override TKTProcDesc[] GetProces() { List <TKTProcDesc> list = new List <TKTProcDesc>(); var methodArray = this.SharpType.GetMethods(); foreach (var method in methodArray) { if (!ReflectionUtil.IsDeclare(SharpType, method)) { continue; } /* 编译器生成的类肯定有标注 */ ZCodeAttribute procAttr = AttributeUtil.GetAttribute <ZCodeAttribute>(method); ProcDescCodeParser parser = new ProcDescCodeParser(); parser.InitType(SharpType, method); TKTProcDesc typeProcDesc = parser.Parser(procAttr.Code); ExMethodInfo exMethod = ZTypeUtil.CreatExMethodInfo(method, this.SharpType); typeProcDesc.ExMethod = exMethod; list.Add(typeProcDesc); } if (ParentMapping != null) { TKTProcDesc[] epi = ParentMapping.GetProces(); foreach (var pitem in epi) { pitem.ExMethod.IsSelf = false; } list.AddRange(epi); } return(list.ToArray()); }
public void EmitBody() { if (IsExists) { return; } var classContext = this.ParentProperties.ASTClass.ClassContext; var method = classContext.InitPropertyMethod; var IL = method.GetILGenerator(); bool isStatic = classContext.IsStatic(); if (!isStatic) { IL.Emit(OpCodes.Ldarg_0); } if (HasValue()) { PropertyValueExp.Emit(); } else { Type type = ZTypeUtil.GetTypeOrBuilder(PropertyZType); EmitHelper.LoadDefaultValue(IL, type); } EmitHelper.StormField(IL, _fieldBuilder); }
private Exp AnalyGeneric() { int count = GenericUtil.GetGenericTypeArgCount(ZTypeUtil.GetTypeOrBuilder(mainZType));// (mainZType.SharpType); if (tsize > count + 1) { Errorf(mainTypeToken.Position, "泛型类型'{0}'声明类型过多", mainTypeToken.Text); } else if (tsize < count + 1) { Errorf(mainTypeToken.Position, "泛型类型'{0}'缺少参数类型声明", mainTypeToken.Text); } else { if (count == 1) { return(AnalyGeneric_1()); } else if (count == 2) { return(AnalyGeneric_2()); } else { throw new ZLibRTException("Z语言不支持泛型参数超过2的泛型"); } } return(noneType); }
public void EmitBody() { var IL = this.NestedMethodContext.GetILGenerator(); List <ZCLocalVar> localList = this.NestedMethodContext.LocalManager.LocalVarList; BuilderUtil.EmitLocalVar(NestedMethodContext, false, IL, localList); //EmitLocalVar(IL, localList); ActionExp.Emit(); //if (!ZTypeUtil.IsVoid(this.RetZType)) //{ // IL.Emit(OpCodes.Ldloc_0); //} if (this.RetSymbol == null) { if (!ZTypeUtil.IsVoid(this.ActionExp.RetType)) { IL.Emit(OpCodes.Pop); } } else { EmitHelper.StormVar(IL, this.RetSymbol.VarBuilder); } IL.Emit(OpCodes.Ret); //CreateNestedType(); }
public static void EmitLocalVar(ContextProc procContext, bool isStatic, ILGenerator IL, List <ZCLocalVar> localList) { localList.Reverse(); for (int i = 0; i < localList.Count; i++) { ZCLocalVar varSymbol = localList[i]; varSymbol.VarBuilder = IL.DeclareLocal(ZTypeUtil.GetTypeOrBuilder(varSymbol.GetZType())); varSymbol.VarBuilder.SetLocalSymInfo(varSymbol.ZName); } for (int i = 0; i < localList.Count; i++) { ZCLocalVar varSymbol = localList[i]; if (varSymbol.IsNestedClassInstance) { LocalBuilder lanmbdaLocalBuilder = procContext.NestedInstance.VarBuilder; ConstructorBuilder newBuilder = procContext.GetNestedClassContext().DefaultConstructorBuilder; IL.Emit(OpCodes.Newobj, newBuilder); EmitHelper.StormVar(IL, lanmbdaLocalBuilder); if (!isStatic) { ZCFieldInfo masterClassField = procContext.GetNestedClassContext().MasterClassField; if (masterClassField != null) { ILGeneratorUtil.LoadLocal(IL, lanmbdaLocalBuilder); } IL.Emit(OpCodes.Ldarg_0); EmitSymbolHelper.EmitStorm(IL, masterClassField); } } } }
private void AnalyCountMethod() { ZType subjectZType = SubjectExp.RetType; Type mainType = ZTypeUtil.GetTypeOrBuilder(subjectZType); // subjectZType.SharpType; PropertyInfo countProperty = mainType.GetProperty(ZLangUtil.ZListCountPropertyName); //"Count"); getCountMethod = countProperty.GetGetMethod(); }
public override Exp Analy( ) { if (this.IsAnalyed) { return(this); } AnalyCorrect = true; if (LeftExp == null && RightExp != null) { ExpUnary unexp = new ExpUnary(this.ExpContext, OpToken, RightExp); var exp = unexp.Analy(); return(exp); } else if (LeftExp == null && RightExp == null) { Errorf(this.OpToken.Position, "运算符'{0}'两边缺少表达式", OpToken.Text); } OpKind = OpToken.Kind; LeftExp = AnalySubExp(LeftExp); RightExp = AnalySubExp(RightExp); if (RightExp == null) { Errorf(OpToken.Position, "运算符'{0}'右边缺少运算元素", OpToken.Text); } else { this.AnalyCorrect = this.LeftExp.AnalyCorrect && RightExp.AnalyCorrect && this.AnalyCorrect; if (LeftExp.AnalyCorrect && RightExp.AnalyCorrect) { ZType ltype = LeftExp.RetType; ZType rtype = RightExp.RetType; if (ZTypeUtil.IsVoid(ltype) || ZTypeUtil.IsVoid(rtype)) { Errorf(OpToken.Position, "没有结果的表达式无法进行'{0}'运算", OpToken.ToCode()); } else { OpMethod = ExpBinaryUtil.GetCalcMethod(OpKind, ltype, rtype); if (OpMethod != null) { RetType = ZTypeManager.GetBySharpType(OpMethod.ReturnType) as ZType; } else { Errorf(OpToken.Position, "两种类型无法进行'{0}'运算", OpToken.ToCode()); } } } else { this.RetType = ZLangBasicTypes.ZOBJECT; } } //AnalyResultLocal(); IsAnalyed = true; return(this); }
public void BuildVar(ILGenerator IL) { foreach (ZCLocalVar localVar in LocalVarList) { if (!localVar.IsReplaceToNestedFiled) { localVar.VarBuilder = IL.DeclareLocal(ZTypeUtil.GetTypeOrBuilder(localVar.GetZType())); localVar.VarBuilder.SetLocalSymInfo(localVar.ZName); } } }
public override void Emit() { //if (Raw.CallExp.ToString().StartsWith("子弹群添加Z")) //{ // Debugr.WriteLine("StmtCall Emit 子弹群添加Z"); //} CallExp.Emit(); if (!ZTypeUtil.IsVoid(CallExp.RetType)) { IL.Emit(OpCodes.Pop); } }
public void EmitBody() { var IL = this.MethodContext.GetILGenerator(); List <ZCLocalVar> localList = this.MethodContext.LocalManager.LocalVarList; EmitLocalVar(IL, localList); Body.Emit(); if (!ZTypeUtil.IsVoid(this.RetZType)) { IL.Emit(OpCodes.Ldloc_0); } IL.Emit(OpCodes.Ret); CreateNestedType(); }
public bool ReplaceLocalToField(string varName) { if (this.ContainsPropertyName(varName)) { return(false); } ZCLocalVar localVar = this.MasterProcContext.LocalManager.GetDefLocal(varName); ZType ztype = localVar.GetZType(); Type varSharpType = ZTypeUtil.GetTypeOrBuilder(ztype); var NestedClassBuilder = this.SelfCompilingType.ClassBuilder; ZCFieldInfo zf = this.SelfCompilingType.DefineFieldPublic(varName, (ZAClassInfo)ztype); localVar.IsReplaceToNestedFiled = true; this.MasterProcContext.LocalManager.DecLocalIndex(varName); return(true); }
public override Stmt Analy() { ForeachListExp = ParseAnalyRawExp(Raw.ListExp); CreateEachSymbols(); var ForeachToken = Raw.LoopToken; var ListExp = Raw.ListExp; var ItemToken = Raw.ItemToken; if (ListExp == null) { Errorf(ForeachToken.Position, "'循环每一个语句'不存在要循环的列表"); } if (ItemToken == null) { Errorf(ForeachToken.Position, "'循环每一个语句'不存在成员名称"); } if (ListExp == null || ItemToken == null) { return(null); } if (!checkCanForeach(ForeachListExp.RetType)) { Errorf(ForeachToken.Position, "该结果不能用作循环每一个"); return(null); } if (ZTypeUtil.IsExtends(ForeachListExp.RetType, typeof(列表 <>))) { startIndex = 1; compareMethod = typeof(Calculater).GetMethod("LEInt", new Type[] { typeof(int), typeof(int) }); } else { startIndex = 0; compareMethod = typeof(Calculater).GetMethod("LTInt", new Type[] { typeof(int), typeof(int) }); } StmtBody.Analy(); //Body.ProcContext = this.ProcContext; //Body.Analy(); return(this); }
private bool CheckRetType() { if (lambdaInfo.ActionExp.RetType == null) { throw new CCException(); } else if (ZTypeUtil.IsConditionFn(lambdaInfo.FnRetType)) { if (!ZTypeUtil.IsBool(lambdaInfo.ActionExp.RetType)) { Errorf(lambdaInfo.ActionExp.Position, "结果应该是" + lambdaInfo.FnRetType.ZTypeName); return(false); } } else if (ZTypeUtil.IsAction(lambdaInfo.FnRetType)) { return(true); } return(true); }
public override Exp Analy() { if (this.IsAnalyed) { return(this); } if (this.ExpContext == null) { throw new CCException(); } if (TypeTokens.Count == 1) { var expStaticClassName = ParseExpStaticClass(TypeTokens[0]); if (expStaticClassName != null) { return(expStaticClassName.Analy()); } } noneType = new ExpTypeNone(this.ExpContext, this); tsize = TypeTokens.Count; if (tsize == 0) { return(noneType); } mainTypeToken = TypeTokens[tsize - 1]; mainZType = SearchZType(mainTypeToken); if (mainZType == noneType) { return(noneType); } IsAnalyed = true; if (ZTypeUtil.IsGenericType(mainZType)) { return(AnalyGeneric()); } else { return(AnalyNormal()); } }
public void EmitName() { var classBuilder = this.MethodContext.ClassContext.GetTypeBuilder(); bool isStatic = this.MethodContext.ClassContext.IsStatic(); ZCMethodDesc ProcDesc = NamePart.GetZDesc(); List <Type> argTypes = new List <Type>(); var parameters = MethodContext.ZMethodInfo.ZParams; foreach (var zparam in parameters) { argTypes.Add(ZTypeUtil.GetTypeOrBuilder(zparam.ZParamType)); } var MethodName = NamePart.GetMethodName(); MethodAttributes methodAttributes; if (isStatic) { methodAttributes = MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.HideBySig; } else { methodAttributes = MethodAttributes.Public | MethodAttributes.Virtual; } MethodBuilder methodBuilder = classBuilder.DefineMethod(MethodName, methodAttributes, ZTypeUtil.GetTypeOrBuilder(RetZType), argTypes.ToArray()); if (MethodName == "启动") { Type myType = typeof(STAThreadAttribute); ConstructorInfo infoConstructor = myType.GetConstructor(new Type[] { }); CustomAttributeBuilder attributeBuilder = new CustomAttributeBuilder(infoConstructor, new object[] { }); methodBuilder.SetCustomAttribute(attributeBuilder); } else { string code = this.NamePart.GetZDesc().ToZCode(); ASTUtil.SetAttrZCode(methodBuilder, code); } this.MethodContext.SetBuilder(methodBuilder); this.NamePart.EmitName(); }
public override void Emit( ) { if (OpToken.Kind == TokenKindSymbol.ADD) { RightExp.Emit(); } else { if (ZTypeUtil.IsFloat(RetType))//(RetType.SharpType == typeof(float)) { IL.Emit(OpCodes.Ldc_R4, 0.0); } else if (ZTypeUtil.IsInt(RetType))//if (RetType.SharpType == typeof(int)) { EmitHelper.LoadInt(IL, 0); } RightExp.Emit(); IL.Emit(OpCodes.Sub); } base.EmitConv(); }
public override TKTProcDesc SearchProc(TKTProcDesc procDesc) { var methodArray = this.SharpType.GetMethods( ); foreach (var method in methodArray) { if (!ReflectionUtil.IsDeclare(SharpType, method)) { continue; } /* 编译器生成的类肯定有标注 */ ZCodeAttribute procAttr = AttributeUtil.GetAttribute <ZCodeAttribute>(method);// Attribute.GetCustomAttribute(method, typeof(ZCodeAttribute)) as ZCodeAttribute; //if (procAttr == null) //{ // ExMethodInfo exMethod = ZTypeHelper.CreatExMethodInfo(method, this.SharpType); // TKTProcDesc typeProcDesc = ProcDescHelper.CreateProcDesc(exMethod); // if (typeProcDesc.Eq(procDesc)) // { // return typeProcDesc; // } //} //else //{ ProcDescCodeParser parser = new ProcDescCodeParser(); parser.InitType(SharpType, method); TKTProcDesc typeProcDesc = parser.Parser(procAttr.Code); if (typeProcDesc.Eq(procDesc)) { ExMethodInfo exMethod = ZTypeUtil.CreatExMethodInfo(method, this.SharpType); typeProcDesc.ExMethod = exMethod; return(typeProcDesc); } //} } if (ParentMapping != null) { return(ParentMapping.SearchProc(procDesc)); } return(null); }
public override void Emit() { Type toType = ZTypeUtil.GetTypeOrBuilder(TypeExp.RetType); Type argType = ZTypeUtil.GetTypeOrBuilder(ArgExp.RetType); if (toType == typeof(int)) { if (argType == typeof(int)) { ArgExp.Emit(); return; } else if (argType == typeof(float)) { ArgExp.Emit(); IL.Emit(OpCodes.Conv_I); return; } } else if (toType == typeof(float)) { if (argType == typeof(int)) { ArgExp.Emit(); IL.Emit(OpCodes.Conv_R4); return; } else if (argType == typeof(float)) { ArgExp.Emit(); return; } } caseMethod = MakeCastMethod(TypeExp.RetType); ArgExp.RequireType = ZLangBasicTypes.ZOBJECT; ArgExp.Emit(); EmitHelper.CallDynamic(IL, caseMethod); base.EmitConv(); }
private Exp AnalyNewExpOrQiangDiao() { int argsCount = BracketExp.Count; if (argsCount != 1) { return(AnalyNewExp()); } else { Exp argExp = BracketExp.GetSubExps()[0]; if (ZTypeUtil.IsExtends(argExp.RetType, TypeExp.RetType)) { return(argExp); } else { return(AnalyNewExpOneArg()); } } }
protected void AnalyArgLambda() { if (!ToExp.AnalyCorrect) { return; } if (ToExp.RetType == null) { return; } if (ZTypeUtil.IsFn(ToExp.RetType)) { ExpNewLambda newLambdaExp = new ExpNewLambda(this.ExpContext, ValueExp, ToExp.RetType); //newLambdaExp.SetContext(this.ExpContext); Exp exp2 = newLambdaExp.Analy(); NewValueExp = exp2; } else { NewValueExp = ValueExp; } }
public override Exp Analy( ) { if (this.IsAnalyed) { return(this); } TypeExp = (ExpTypeBase)(AnalySubExp(TypeExp)); BracketExp = AnalySubExp(BracketExp) as ExpBracket; if (!AnalyCorrect) { return(this); } if (ZTypeUtil.IsListClass(TypeExp.RetType)) { ExpNewList newListExp = new ExpNewList(this.ExpContext, TypeExp, BracketExp); IsAnalyed = true; return(newListExp.Analy()); } else { return(AnalyNewExpOrQiangDiao()); } }
public override Stmt Analy() { //TimesExp.IsTopExp = true; TimesExp = AnalyRepeateExpRaw(Raw.TimesExp);// ParseAnalyRawExp(Raw.TimesExp); if (TimesExp == null) { Errorf(Raw.RepeatToken.Position, "重复语句没有表达式"); } else { TimesExp = TimesExp.Analy(); if (TimesExp != null && TimesExp.AnalyCorrect) { if (!ZTypeUtil.IsInt(TimesExp.RetType)) { Errorf(TimesExp.Position, "结果不是整数"); } } } CreateEachSymbols(); //RepeatBody.ProcContext = this.ProcContext; RepeatBody.Analy(); return(this); }
//private void AnalyListExp() //{ // ListExp = AnalyExpRaw(); // if (ListExp == null) // { // Errorf(ForeachToken.Position, "循环每一个语句没有表达式"); // } // else // { // ListExp = ListExp.Analy(); // } //} //private Exp AnalyExpRaw() //{ // ExpRaw rawExp = Raw.ListExp;// (Exp)ListExp; // ContextExp context = new ContextExp(this.ProcContext, this); // //rawExp.SetContext(context); // List<LexToken> tokens = rawExp.Seg(); // ExpParser parser = new ExpParser(); // Exp exp = parser.Parse(tokens, this.ProcContext.ClassContext.FileContext); // //exp.SetContext(rawExp.ExpContext); // return exp; //} protected void CreateEachSymbols() { var procContext = this.ProcContext; int foreachIndex = procContext.CreateRepeatIndex(); var indexName = "@foreach" + foreachIndex + "_index"; var countName = "@foreach" + foreachIndex + "_count"; var listName = "@foreach" + foreachIndex + "_list"; var itemName = this.Raw.ItemToken.Text; indexSymbol = new ZCLocalVar(indexName, ZLangBasicTypes.ZINT, true); //indexSymbol.LoacalVarIndex = procContext.CreateLocalVarIndex(indexName); this.ProcContext.AddLocalVar(indexSymbol); countSymbol = new ZCLocalVar(countName, ZLangBasicTypes.ZINT, true); //countSymbol.LoacalVarIndex = procContext.CreateLocalVarIndex(countName); this.ProcContext.AddLocalVar(countSymbol); listSymbol = new ZCLocalVar(listName, this.ForeachListExp.RetType, true); //listSymbol.LoacalVarIndex = procContext.CreateLocalVarIndex(listName); this.ProcContext.AddLocalVar(listSymbol); var listType = ZTypeUtil.GetTypeOrBuilder(this.ForeachListExp.RetType); Type[] genericTypes = GenericUtil.GetInstanceGenriceType(listType, typeof(列表 <>)); if (genericTypes.Length == 0) { genericTypes = GenericUtil.GetInstanceGenriceType(listType, typeof(IList <>)); } Type ElementType = genericTypes[0]; itemSymbol = new ZCLocalVar(itemName, (ZType)(ZTypeManager.GetBySharpType(ElementType)), true); //itemSymbol.LoacalVarIndex = procContext.CreateLocalVarIndex(itemName); this.ProcContext.AddLocalVar(itemSymbol); }
public override TKTProcDesc SearchProc(TKTProcDesc procDesc) { var methodArray = this.SharpType.GetMethods(); foreach (var method in methodArray) { if (!ReflectionUtil.IsDeclare(SharpType, method)) { continue; } /* 映射类可能有多个同义的方法对应同一个实际方法 */ ZCodeAttribute[] attrs = AttributeUtil.GetAttributes <ZCodeAttribute>(method); /* 编译器生成的类可能没有标注,没有标注的方法必定在ZMappingType上 */ if (attrs.Length == 0) { ExMethodInfo exMethod = ZTypeUtil.CreatExMethodInfo(method, this.SharpType); TKTProcDesc typeProcDesc = ProcDescHelper.CreateProcDesc(exMethod); if (typeProcDesc.Eq(procDesc)) { TKTProcDesc rdesc = ProcDescHelper.CreateProcDesc(exMethod); return(rdesc); } } else if (attrs.Length > 0) { ParameterInfo[] paramArray = method.GetParameters(); parser.InitType(SharpType, method); foreach (ZCodeAttribute attr in attrs) { ZCodeAttribute zCodeAttribute = attr as ZCodeAttribute; TKTProcDesc typeProcDesc = parser.Parser(zCodeAttribute.Code); if (method.IsStatic && !method.IsAbstract && typeProcDesc.HasSubject() && typeProcDesc.GetSubjectArg().ArgType == this.SharpType) { typeProcDesc = typeProcDesc.CreateTail(); } if (typeProcDesc.Eq(procDesc)) { ExMethodInfo exMethod = null;// getExMethod(method); /* 非 Abstract 的方法肯定从被映射的类中搜索 */ if (method.IsAbstract) { var method2 = searchMethodFromSharp(method); exMethod = ZTypeUtil.CreatExMethodInfo(method2, this.SharpType); //return exMethod; } else { exMethod = ZTypeUtil.CreatExMethodInfo(method, this.ZMappingType); //return exMethod; } typeProcDesc.ExMethod = exMethod; return(typeProcDesc); } } } } if (ParentMapping != null && !isRoot()) { var epi = ParentMapping.SearchProc(procDesc); if (epi != null) { //epi.IsSelf = false; return(epi); } } return(null); }
public override TKTConstructorDesc SearchConstructor(TKTConstructorDesc desc) { return(ZTypeUtil.SearchConstructor(desc, this.SharpType)); }
public override TKTConstructorDesc SearchConstructor(TKTConstructorDesc bracket) { return(ZTypeUtil.SearchConstructor(bracket, this.SharpType)); }