Class SwitchCaseOrChainGenerator

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

public final class SwitchCaseOrChainGenerator extends AbstractGenerator
Generates short-circuit OR chains for multiple switch case expressions.

Example: case 'D', 'A', 'Z' generates: text._eq('D') OR (text._eq('A') OR text._eq('Z'))

Uses LOGICAL_OR_BLOCK for efficient short-circuit evaluation: - If first comparison is TRUE → return immediately (skip remaining) - If FALSE → evaluate next comparison (recursively)

Backend Benefits: - JVM: Generates IFNE jumps for early exit - LLVM: Generates conditional branches with proper PHI nodes