public DotNetFlowControlScope BeginControlBlock(Label start, Label end) { var subScope = new DotNetFlowControlScope(this, this.Depth + 1, start, end); this.children.Add(subScope); return(subScope); }
public DotNetFlowControlScope(DotNetFlowControlScope parent, int depth, Label start, Label end) { this.CurrentStartLabel = start; this.CurrentEndLabel = end; this.parent = parent; this.Depth = depth; this.children = new List <DotNetFlowControlScope>(); }
public DotNetXzaarScriptCompilerContext() { assemblyName = new AssemblyName("DynamicXzaarScriptAssembly"); assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave); mainModule = assemblyBuilder.DefineDynamicModule(assemblyName.Name, assemblyName.Name + ".dll", true); MainType = CurrentType = Global = new XsGlobal(mainModule); MainMethod = CurrentMethod = Global.MainMethod; var il = GetILGenerator(); this.flowControl = new DotNetFlowControlScope(null, -1, il.DefineLabel(), il.DefineLabel()); this.rootFlowControl = this.flowControl; }
public void EndControlBlock() { this.flowControl = this.flowControl.EndControlBlock(); }
public DotNetFlowControlScope BeginControlBlock() { var il = GetILGenerator(); return(this.flowControl = this.flowControl.BeginControlBlock(il.DefineLabel(), il.DefineLabel())); }