Class TryCatchStatementGenerator
java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.TryCatchStatementGenerator
- All Implemented Interfaces:
Function<EK9Parser.TryStatementExpressionContext, List<IRInstr>>
public final class TryCatchStatementGenerator
extends AbstractGenerator
implements Function<EK9Parser.TryStatementExpressionContext, List<IRInstr>>
Generates IR for try/catch/finally constructs using CONTROL_FLOW_CHAIN.
Currently handles simple try/catch/finally (no guards, statement form only).
Scope structure:
Outer Scope (_scope_1): Try/catch wrapper for future guards Control Flow Scope (_scope_2): Try/catch control structure Try Scope (_scope_3): Try block execution (isolated) Catch Scope (_scope_4): Catch handler execution (isolated, if present) Finally Scope (_scope_5): Finally block execution (if present)
EK9 supports SINGLE catch block only (not multiple). Both 'catch' and 'handle' keywords are supported.
-
Field Summary
Fields inherited from class AbstractGenerator
debugInfoCreator, instructionBuilder, stackContext, typeNameOrException -
Constructor Summary
ConstructorsConstructorDescriptionTryCatchStatementGenerator(IRGenerationContext stackContext, GeneratorSet generators) -
Method Summary
Modifier and TypeMethodDescriptionMethods inherited from class AbstractGenerator
createTempVariable, createTempVariableFromContext, extractReturnType, getRecordedSymbolOrException, processBlockStatements, validateNoPreFlowStatement, validateStatementFormOnly
-
Constructor Details
-
TryCatchStatementGenerator
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<EK9Parser.TryStatementExpressionContext, List<IRInstr>>
-