Class BlockStmtInstrGenerator
java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.BlockStmtInstrGenerator
- All Implemented Interfaces:
Function<EK9Parser.BlockStatementContext, List<IRInstr>>
public final class BlockStmtInstrGenerator
extends AbstractGenerator
implements Function<EK9Parser.BlockStatementContext, List<IRInstr>>
Creates IR instructions for block statements.
Handles variable declarations, variable only declarations, and statements.
Deals with the following ANTLR grammar.
blockStatement
: variableDeclaration
| variableOnlyDeclaration
| statement
;
-
Field Summary
Fields inherited from class AbstractGenerator
debugInfoCreator, instructionBuilder, stackContext -
Constructor Summary
ConstructorsConstructorDescriptionBlockStmtInstrGenerator(IRGenerationContext stackContext, GeneratorSet generators) Constructor accepting GeneratorSet for unified access to all generators. -
Method Summary
Modifier and TypeMethodDescriptionGenerate IR instructions for a block statement using stack-based scope management.Methods inherited from class AbstractGenerator
createTempVariable, createTempVariableFromContext, extractReturnType, getRecordedSymbolOrException
-
Constructor Details
-
BlockStmtInstrGenerator
BlockStmtInstrGenerator(IRGenerationContext stackContext, GeneratorSet generators) Constructor accepting GeneratorSet for unified access to all generators.
-
-
Method Details
-
apply
Generate IR instructions for a block statement using stack-based scope management. STACK-BASED: Gets scope ID from stack context instead of parameter threading.- Specified by:
applyin interfaceFunction<EK9Parser.BlockStatementContext, List<IRInstr>>
-