예제 #1
0
        public override void Compile(sunCompiler compiler)
        {
            Condition.Compile(compiler);
            var falsePrologue = new sunJumpNotEqualSite(compiler.Binary);

            TrueBody.Compile(compiler);
            var trueEpilogue = new sunJumpSite(compiler.Binary);

            falsePrologue.Relocate();
            FalseBody.Compile(compiler);
            trueEpilogue.Relocate();
        }
예제 #2
0
        public override void Compile(sunCompiler compiler)
        {
            var point   = new sunJumpSite(compiler.Binary);
            var success = true;

            if (IsNamed)
            {
                success = compiler.Context.Loops.AddContinue(point, NameLabel.Value);
            }
            else
            {
                success = compiler.Context.Loops.AddContinue(point);
            }
            if (!success)
            {
                throw new sunContinueException(this);
            }
        }
예제 #3
0
        public override void Compile(sunCompiler compiler)
        {
            Condition.Compile(compiler);
            var trueBodyEpilogue = new sunJumpNotEqualSite(compiler.Binary);

            TrueBody.Compile(compiler);
            var falseBody = FalseBody;

            if (falseBody != null)
            {
                var falseBodyEpilogue = new sunJumpSite(compiler.Binary);
                trueBodyEpilogue.Relocate();
                falseBody.Compile(compiler);
                falseBodyEpilogue.Relocate();
            }
            else
            {
                trueBodyEpilogue.Relocate();
            }
        }