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.