Class BinaryOperationGenerator
java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.BinaryOperationGenerator
- All Implemented Interfaces:
Function<ExprProcessingDetails,
List<IRInstr>>
- Direct Known Subclasses:
BinaryOperationGeneratorWithProcessor
abstract class BinaryOperationGenerator
extends AbstractGenerator
implements Function<ExprProcessingDetails,List<IRInstr>>
Generates IR instructions for binary operations (e.g., addition, subtraction, comparison, etc.).
Handles:
- Left and right operand evaluation with proper memory management
- Cost-based method resolution with automatic promotion
- CallInstr.operator generation for binary method calls
-
Field Summary
Fields inherited from class org.ek9lang.compiler.phase7.generator.AbstractGenerator
debugInfoCreator, instructionBuilder, stackContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply
(ExprProcessingDetails details) processOperandExpression
(EK9Parser.ExpressionContext operandExpr, VariableDetails operandDetails) Process operand expression - this should be overridden by subclasses to provide actual expression processing.Methods inherited from class org.ek9lang.compiler.phase7.generator.AbstractGenerator
extractCallMetaData, getRecordedSymbolOrException
-
Constructor Details
-
BinaryOperationGenerator
BinaryOperationGenerator(IRGenerationContext stackContext)
-
-
Method Details
-
apply
- Specified by:
apply
in interfaceFunction<ExprProcessingDetails,
List<IRInstr>>
-
processOperandExpression
protected abstract List<IRInstr> processOperandExpression(EK9Parser.ExpressionContext operandExpr, VariableDetails operandDetails) Process operand expression - this should be overridden by subclasses to provide actual expression processing. Default implementation returns empty list.
-