Class AssignmentStmtGenerator
java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.AssignmentStmtGenerator
- All Implemented Interfaces:
Function<EK9Parser.AssignmentStatementContext, List<IRInstr>>
public final class AssignmentStmtGenerator
extends AbstractGenerator
implements Function<EK9Parser.AssignmentStatementContext, List<IRInstr>>
Process assignment statement: variable = expression
Uses RELEASE-then-RETAIN pattern for memory-safe assignments.
Handles assignments like someLocal = "Hi" and cross-scope assignments like rtn: claude.
For property fields, uses "this.fieldName" naming convention.
From the ANTLR grammar, we're looking at processing this.
assignmentStatement
: (primaryReference | identifier | objectAccessExpression) op=(ASSIGN | ASSIGN2 | COLON |
ASSIGN_UNSET | ADD_ASSIGN | SUB_ASSIGN | DIV_ASSIGN | MUL_ASSIGN | MERGE | REPLACE | COPY) assignmentExpression
;
-
Field Summary
Fields inherited from class AbstractGenerator
debugInfoCreator, instructionBuilder, stackContext -
Constructor Summary
ConstructorsConstructorDescriptionAssignmentStmtGenerator(IRGenerationContext stackContext, GeneratorSet generators) Constructor accepting GeneratorSet for unified access to all generators. -
Method Summary
Methods inherited from class AbstractGenerator
createTempVariable, createTempVariableFromContext, extractReturnType, getRecordedSymbolOrException
-
Constructor Details
-
AssignmentStmtGenerator
AssignmentStmtGenerator(IRGenerationContext stackContext, GeneratorSet generators) Constructor accepting GeneratorSet for unified access to all generators.
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<EK9Parser.AssignmentStatementContext, List<IRInstr>>
-