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(); }
private void EmitSubject() { if (!SearchedMethod.GetIsStatic()) { SubjectExp.Emit(); } }
public void EmitSet(Exp valueExp) { MethodInfo setMethod = Property.GetSetMethod(); EmitHelper.LoadVar(IL, ListSymbol.VarBuilder); EmitHelper.LoadVar(IL, IndexSymbol.VarBuilder); valueExp.Emit(); EmitHelper.CallDynamic(IL, setMethod); }
public override void Emit() { if (this.InneExps.Count != 1) { throw new CCException(); } Exp exp = this.InneExps[0]; exp.Emit(); }
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(); }
protected void EmitArgsExp(ZCParamInfo[] paramInfos, Exp[] args) { var size = paramInfos.Length; for (int i = 0; i < size; i++) { Exp argExp = args[i]; var parameter = paramInfos[i]; argExp.RequireType = parameter.ZParamType; argExp.Emit(); } }
public void EmitSet(Exp valueExp) { MethodInfo setMethod = Property.GetSetMethod(); SubjectExp.Emit(); ArgExp.RequireType = ZTypeManager.GetBySharpType(setMethod.GetParameters()[0].ParameterType) as ZType; ArgExp.Emit(); //EmitHelper.Box(il, ArgExp.RetType, setMethod.GetParameters()[0].ParameterType); valueExp.RequireType = ZTypeManager.GetBySharpType(setMethod.GetParameters()[1].ParameterType) as ZType; valueExp.Emit(); EmitHelper.CallDynamic(IL, setMethod); }
protected void EmitArgsExp(IEnumerable <Exp> args, IEnumerable <ZType> ztypes) { var args2 = new List <Exp>(args); var ztypes2 = new List <ZType>(ztypes); var size = args2.Count; for (int i = 0; i < size; i++) { Exp argExp = args2[i]; argExp.RequireType = ztypes2[i]; argExp.Emit(); } }
protected void EmitValueExp(Exp valueExp) { valueExp.RequireType = this.RetType; valueExp.Emit(); }
protected void EmitArgExp(ZCParamInfo parameter, Exp argExp) { argExp.RequireType = parameter.ZParamType; argExp.Emit(); }