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>>
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 org.ek9lang.compiler.phase7.generator.AbstractGenerator
debugInfoCreator, instructionBuilder, stackContext
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.ek9lang.compiler.phase7.generator.AbstractGenerator
extractCallMetaData, getRecordedSymbolOrException
-
Constructor Details
-
AssignmentStmtGenerator
AssignmentStmtGenerator(IRGenerationContext stackContext)
-
-
Method Details
-
apply
- Specified by:
apply
in interfaceFunction<EK9Parser.AssignmentStatementContext,
List<IRInstr>>
-