public CoreCodeGen(Core coreObj, ProtoCore.DSASM.CodeBlock parentBlock = null) { Debug.Assert(coreObj != null); this.core = coreObj; argOffset = 0; globalClassIndex = core.ClassIndex; if (null == CoreCodeGen.CodeRangeTable) { CoreCodeGen.CodeRangeTable = new CodeRangeTable(); } if (null == CoreCodeGen.IdentLocation) { CoreCodeGen.IdentLocation = new IdentLocationTable(); } if (null == CoreCodeGen.ImportTable) { CoreCodeGen.ImportTable = new ImportTable(); } context = new ProtoCore.CompileTime.Context(); opKwData = new ProtoCore.DSASM.OpKeywordData(); targetLangBlock = ProtoCore.DSASM.Constants.kInvalidIndex; enforceTypeCheck = true; localProcedure = core.ProcNode; globalProcIndex = null != localProcedure ? localProcedure.procId : ProtoCore.DSASM.Constants.kGlobalScope; tryLevel = 0; }
public CoreCodeGen(ProtoLanguage.CompileStateTracker compileState, ProtoCore.DSASM.CodeBlock parentBlock = null) { Debug.Assert(compileState != null); this.compileState = compileState; argOffset = 0; globalClassIndex = compileState.ClassIndex; if (null == CoreCodeGen.CodeRangeTable) CoreCodeGen.CodeRangeTable = new CodeRangeTable(); if (null == CoreCodeGen.IdentLocation) CoreCodeGen.IdentLocation = new IdentLocationTable(); if (null == CoreCodeGen.ImportTable) CoreCodeGen.ImportTable = new ImportTable(); context = new ProtoCore.CompileTime.Context(); targetLangBlock = ProtoCore.DSASM.Constants.kInvalidIndex; enforceTypeCheck = true; localProcedure = compileState.ProcNode; globalProcIndex = null != localProcedure ? localProcedure.procId : ProtoCore.DSASM.Constants.kGlobalScope; tryLevel = 0; }
internal static void ResetInternalStates() { CoreCodeGen.CodeRangeTable = null; CoreCodeGen.IdentLocation = null; CoreCodeGen.ImportTable = null; }