Beispiel #1
0
        public override void RenderIL_Execute(ILCanvas canvas)
        {
            ILCanvasLabel exit_label = canvas.CreateLabel();

            condition.GetILImplicitCast(typeof(bool))
            .RenderIL_Load(canvas);

            if (HasElse())
            {
                ILCanvasLabel false_label = canvas.CreateLabel();

                false_label.Emit_Brfalse();
                if_true_statement.RenderIL_Execute(canvas);
                exit_label.Emit_Br();

                false_label.Emit_Label();
                if_false_statement.RenderIL_Execute(canvas);
            }
            else
            {
                exit_label.Emit_Brfalse();
                if_true_statement.RenderIL_Execute(canvas);
            }

            exit_label.Emit_Label();
        }
Beispiel #2
0
        public override void RenderIL_Execute(ILCanvas canvas)
        {
            ILCanvasLabel entry_label = canvas.CreateLabel();
            ILCanvasLabel exit_label  = canvas.CreateLabel();

            entry_label.Emit_Label();

            condition.GetILImplicitCast(typeof(bool))
            .RenderIL_Load(canvas);

            exit_label.Emit_Brfalse();
            while_statement.RenderIL_Execute(canvas);
            entry_label.Emit_Br();

            exit_label.Emit_Label();
        }
Beispiel #3
0
        public override void RenderIL_Load(ILCanvas canvas)
        {
            ILCanvasLabel end_label   = canvas.CreateLabel();
            ILCanvasLabel false_label = canvas.CreateLabel();

            foreach (ILValue value in values)
            {
                value.RenderIL_Load(canvas);
                false_label.Emit_Brfalse();
            }

            canvas.Emit_Ldc_I4(1);
            end_label.Emit_Br();

            false_label.Emit_Label();
            canvas.Emit_Ldc_I4(0);

            end_label.Emit_Label();
        }