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); } } } }
public void AnalyValue() { this.ProcContext = new ContextProc(this.ClassContext); foreach (var item in Properties) { item.AnalyValue(ProcContext); } }
public void AnalyValue(ContextProc procContext) { if (PropertyValue == null) { PropertySymbol.HasDefaultValue = false; return; } PropertySymbol.HasDefaultValue = true; Exp exp2 = null; ContextExp context = new ContextExp(procContext); PropertyValue.SetContext(context); exp2 = PropertyValue.Parse(); exp2 = exp2.Analy(); PropertyValue = exp2; }
private void CreateContext() { NestedClassContext = new ContextClass(this.ExpContext.FileContext); NestedClassContext.ClassName = this.ExpContext.ProcContext.CreateNestedClassName(); NestedProcContext = new ContextProc(NestedClassContext); NestedProcContext.ProcName = NestedClassContext.ClassName + "$CALL"; NestedProcContext.ProcManagerContext = NestedClassContext.ProcManagerContext; NestedProcContext.ProcManagerContext.Add(NestedProcContext); NestedStmt = new StmtCall(); NestedStmt.ProcContext = NestedProcContext; NestedExpContext = new ContextExp(NestedProcContext, NestedStmt); BodyExp.SetContext(NestedExpContext); CreateEmitContext(); }
public StmtRawParser(IEnumerable <LineTokenCollection> lineTokens, ContextProc context) { stmtList.Clear(); this.context = context; tape = new ArrayTape <LineTokenCollection>(lineTokens); }
public ChainItemFeaturer(ContextExp context) { Context = context; ProcContext = context.ProcContext; }