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(); }
public override void Compile(sunCompiler compiler) { var loop = PushLoop(compiler.Context); var bodyPrologue = compiler.Binary.Offset; loop.ContinuePoint = compiler.Binary.Offset; Condition.Compile(compiler); var bodyEpilogue = new sunJumpNotEqualSite(compiler.Binary); Body.Compile(compiler); compiler.Binary.WriteJMP(bodyPrologue); bodyEpilogue.Relocate(); loop.BreakPoint = compiler.Binary.Offset; compiler.Context.Loops.Pop(compiler); }
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(); } }
public override void Compile(sunCompiler compiler) { #if SSC_SCOPES compiler.Context.Scopes.Push(); #endif var loop = PushLoop(compiler.Context); TryCompile(Declaration, compiler); var bodyPrologue = compiler.Binary.Offset; TryCompile(Condition, compiler); var bodyEpilogue = new sunJumpNotEqualSite(compiler.Binary); Body.Compile(compiler); loop.ContinuePoint = compiler.Binary.Offset; TryCompile(Iteration, compiler); compiler.Binary.WriteJMP(bodyPrologue); bodyEpilogue.Relocate(); loop.BreakPoint = compiler.Binary.Offset; compiler.Context.Loops.Pop(compiler); #if SSC_SCOPES compiler.Context.Scopes.Pop(); #endif }