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>();
 }
Example #3
0
        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;
        }
Example #4
0
 public void EndControlBlock()
 {
     this.flowControl = this.flowControl.EndControlBlock();
 }
Example #5
0
        public DotNetFlowControlScope BeginControlBlock()
        {
            var il = GetILGenerator();

            return(this.flowControl = this.flowControl.BeginControlBlock(il.DefineLabel(), il.DefineLabel()));
        }