public FlowControlScope BeginControlBlock()
        {
            var subScope = new FlowControlScope(this, this.Depth + 1);

            this.children.Add(subScope);
            return(subScope);
        }
 public FlowControlScope(FlowControlScope parent, int depth)
 {
     CurrentStartLabel = Instruction.Label();
     CurrentEndLabel   = Instruction.Label();
     this.parent       = parent;
     this.Depth        = depth;
     this.children     = new List <FlowControlScope>();
 }
Exemple #3
0
        // private int tempVariableCount;

        public ScriptCompilerContext(string assemblyName, XzaarExpression expressionTree)
        {
            MethodInstructions = new CompilerInstructionCollection(this);
            GlobalInstructions = new CompilerInstructionCollection(this);

            this.ExpressionTree  = expressionTree;
            this.KnownTypes      = new List <TypeReference>();
            this.Assembly        = XzaarAssembly.CreateAssembly(assemblyName);
            this.flowControl     = new FlowControlScope(null, -1);
            this.rootFlowControl = this.flowControl;
        }
Exemple #4
0
 public void EndControlBlock()
 {
     this.flowControl = this.flowControl.EndControlBlock();
 }
Exemple #5
0
 public void BeginControlBlock()
 {
     this.flowControl = this.flowControl.BeginControlBlock();
 }