예제 #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();
        }
예제 #2
0
        public override void RenderIL_Execute(ILCanvas canvas)
        {
            ILCanvasLabel after_label = canvas.CreateLabel();

            after_label.Emit_Br();

            entry_label.RenderIL_Execute(canvas);
            statement.RenderIL_Execute(canvas);

            after_label.Emit_Label();
        }
예제 #3
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();
        }
예제 #4
0
        public override void RenderIL_Load(ILCanvas canvas)
        {
            ILCanvasLabel end_label  = canvas.CreateLabel();
            ILCanvasLabel true_label = canvas.CreateLabel();

            foreach (ILValue value in values)
            {
                value.RenderIL_Load(canvas);
                true_label.Emit_Brtrue();
            }

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

            true_label.Emit_Label();
            canvas.Emit_Ldc_I4(1);

            end_label.Emit_Label();
        }