Class ObjectAccessInstrGenerator
java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.ObjectAccessInstrGenerator
Creates IR instructions for object access expressions.
Handles constructor calls and method calls using resolved symbols.
Generates new BasicBlock IR (IRInstructions).
Supports method chaining patterns like Constructor().method() by:
- Processing objectAccessStart (constructor/identifier/primaryReference) first
- Walking the objectAccess chain iteratively
- Applying ARC memory management for each intermediate temp
- Storing the final result to the target variable
Grammar structure:
objectAccessExpression : objectAccessStart objectAccess objectAccessStart : (primaryReference | identifier | call) objectAccess : objectAccessType objectAccess? // RECURSIVE objectAccessType : DOT (identifier | operationCall)
-
Field Summary
Fields inherited from class AbstractGenerator
debugInfoCreator, instructionBuilder, stackContext, typeNameOrException -
Constructor Summary
ConstructorsConstructorDescriptionObjectAccessInstrGenerator(IRGenerationContext stackContext, GeneratorSet generators) -
Method Summary
Modifier and TypeMethodDescriptionapply(EK9Parser.ObjectAccessExpressionContext ctx, VariableDetails variableDetails) Generate IR instructions for object access expression using resolved symbols.
-
Constructor Details
-
ObjectAccessInstrGenerator
ObjectAccessInstrGenerator(IRGenerationContext stackContext, GeneratorSet generators)
-
-
Method Details
-
apply
public List<IRInstr> apply(EK9Parser.ObjectAccessExpressionContext ctx, VariableDetails variableDetails) Generate IR instructions for object access expression using resolved symbols. Handles both simple cases (likestdout.println()) and chained cases (likeDateTime().now()).
-