Class StmtInstrGenerator
java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.StmtInstrGenerator
- All Implemented Interfaces:
Function<EK9Parser.StatementContext,
List<IRInstr>>
final class StmtInstrGenerator
extends AbstractGenerator
implements Function<EK9Parser.StatementContext,List<IRInstr>>
Creates IR instructions for statements.
Generates new BasicBlock IR (IRInstructions).
From the ANTLR grammar this has to support the following:
statement : ifStatement | assertStatement | assignmentStatement | identifierReference op=(INC | DEC) | call | throwStatement | objectAccessExpression | switchStatementExpression | tryStatementExpression | whileStatementExpression | forStatementExpression | streamStatement ;
MIGRATING TO STACK: Now uses stack context for scope management instead of parameter threading. Still maintains Function interface for incremental migration approach.
-
Field Summary
Fields inherited from class org.ek9lang.compiler.phase7.generator.AbstractGenerator
debugInfoCreator, instructionBuilder, stackContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGenerate IR instructions for a statement using proper stack-based scope management.Methods inherited from class org.ek9lang.compiler.phase7.generator.AbstractGenerator
extractCallMetaData, getRecordedSymbolOrException
-
Constructor Details
-
StmtInstrGenerator
StmtInstrGenerator(IRGenerationContext stackContext)
-
-
Method Details
-
apply
Generate IR instructions for a statement using proper stack-based scope management. STACK-BASED: Gets scope ID from stack context instead of parameter threading.- Specified by:
apply
in interfaceFunction<EK9Parser.StatementContext,
List<IRInstr>>
-