Class GuardedScopeOrchestrator

java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.GuardedScopeOrchestrator

public final class GuardedScopeOrchestrator extends AbstractGenerator
Orchestrates the common guard + scope + return variable pattern shared by control flow generators (while, do-while, for-range, for-in, try-catch).

Each control flow construct follows an identical template:

  1. Create debug info and enter outer scope
  2. Evaluate guard variable (if present)
  3. Process returning param for expression form
  4. Generate core body (DIFFERS per construct — supplied as lambda)
  5. Wrap with guard entry check or scope enter/exit
  6. Exit outer scope

Two orchestration methods handle different core body types:

For guards with entry checks (<-, :=?, ?= operators), the guard is checked ONCE at entry. If the check fails, the entire body is skipped via an IF wrapper.