Class SwitchStatementGenerator
java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.SwitchStatementGenerator
- All Implemented Interfaces:
Function<EK9Parser.SwitchStatementExpressionContext, List<IRInstr>>
public final class SwitchStatementGenerator
extends AbstractGenerator
implements Function<EK9Parser.SwitchStatementExpressionContext, List<IRInstr>>
Generates IR for switch statements (statement form only) using CONTROL_FLOW_CHAIN.
Follows the same pattern as IfStatementGenerator.
Current implementation supports: - Literal case comparisons (case 1, case 2, etc.) - Integer type evaluation variable - Default case - Statement form only (no return value)
NOT yet supported: - Expression form (switch as expression returning value) - Guard variables in switch - Enum case comparisons - Multiple literals per case (case 1, 2, 3) - Expression cases (case < 12, case > 50)
-
Field Summary
Fields inherited from class AbstractGenerator
debugInfoCreator, instructionBuilder, stackContext -
Constructor Summary
ConstructorsConstructorDescriptionSwitchStatementGenerator(IRGenerationContext stackContext, GeneratorSet generators) -
Method Summary
Modifier and TypeMethodDescriptionMethods inherited from class AbstractGenerator
createTempVariable, getRecordedSymbolOrException
-
Constructor Details
-
SwitchStatementGenerator
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<EK9Parser.SwitchStatementExpressionContext, List<IRInstr>>
-