Class AssignmentStmtGenerator
java.lang.Object
org.ek9lang.compiler.phase7.AssignmentStmtGenerator
- All Implemented Interfaces:
BiFunction<EK9Parser.AssignmentStatementContext,
String, List<IRInstr>>
final class AssignmentStmtGenerator
extends Object
implements BiFunction<EK9Parser.AssignmentStatementContext,String,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 ;
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply
(EK9Parser.AssignmentStatementContext ctx, String scopeId) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.BiFunction
andThen
-
Constructor Details
-
AssignmentStmtGenerator
AssignmentStmtGenerator(IRContext context)
-
-
Method Details
-
apply
- Specified by:
apply
in interfaceBiFunction<EK9Parser.AssignmentStatementContext,
String, List<IRInstr>>
-