Class AssignmentExprInstrGenerator
java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.AssignmentExprInstrGenerator
- All Implemented Interfaces:
BiFunction<EK9Parser.AssignmentExpressionContext, String, List<IRInstr>>
final class AssignmentExprInstrGenerator
extends AbstractGenerator
implements BiFunction<EK9Parser.AssignmentExpressionContext, String, List<IRInstr>>
Creates IR instructions for assignment expressions.
Generates new BasicBlock IR (IRInstructions).
Note that this is just really a 'pointer' assignment to some existing allocated object/memory. It is not a deep copy in any way.
THis deals with the following ANTLR grammar.
assignmentExpression
: expression
| dynamicClassDeclaration
| switchStatementExpression
| tryStatementExpression
| assertThrowsExpression
| assertDoesNotThrowExpression
| assertPanicExpression
| whileStatementExpression
| forStatementExpression
| streamExpression
;
THE generator of an assignmentExpression, ONE per construct (generators.assignmentExprGenerator, IR tidy
W3.9, EXPR-15): the expression is an argument, never captured, so nothing is built per assignment.
-
Field Summary
Fields inherited from class AbstractGenerator
stackContext, symbolTypeOrException, typeNameOrException, variableNameForIR -
Constructor Summary
ConstructorsConstructorDescriptionAssignmentExprInstrGenerator(IRGenerationContext stackContext, GeneratorSet generators) Constructor accepting injected GeneratorSet. -
Method Summary
Modifier and TypeMethodDescriptionapply(EK9Parser.AssignmentExpressionContext ctx, String rhsExprResult) Generate IR instructions for an assignment expression intorhsExprResult.Methods inherited from class AbstractGenerator
addCoverageProbe, createTempVariable, createTempVariableFromContext, getRecordedSymbolOrException, processBlockStatements, processBlockStatements, resultVariableOrTempMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiFunction
andThen
-
Constructor Details
-
AssignmentExprInstrGenerator
AssignmentExprInstrGenerator(IRGenerationContext stackContext, GeneratorSet generators) Constructor accepting injected GeneratorSet. Provides access to all generators including control flow expression generators.
-
-
Method Details
-
apply
Generate IR instructions for an assignment expression intorhsExprResult.- Specified by:
applyin interfaceBiFunction<EK9Parser.AssignmentExpressionContext, String, List<IRInstr>>
-