Class Scenario2AggregateWrapperGenerator
java.lang.Object
org.ek9lang.compiler.phase7.Scenario2AggregateWrapperGenerator
Generates IR for Scenario 2 aggregate wrapper constructors, delegation, and function-accepting methods.
Handles:
- Constructor operations - create delegate instance and store in field
- Wrapping constructor - accepts existing delegate for return-type wrapping
- Standard delegation - load delegate, call method, handle return type wrapping/casting
- Function-accepting methods - inline implementations for whenPresent/whenOk/whenError
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidgenerateConstructorOperation(IRConstruct construct, MethodSymbol method, String baseTypeName) Generate constructor that creates the delegate instance.(package private) voidgenerateDelegationOperation(IRConstruct construct, MethodSymbol method, String baseTypeName) Generate a delegation operation for a single method.(package private) voidgenerateFunctionAcceptingMethod(IRConstruct construct, MethodSymbol method, String baseTypeName) Generate inline implementation for methods that accept function wrapper types.(package private) voidgenerateWrappingConstructor(IRConstruct construct, AggregateSymbol aggregateSymbol, String baseTypeName) Generate wrapping constructor that takes the base type as parameter.(package private) booleanCheck if a method has any parameter whose type is a function wrapper.
-
Constructor Details
-
Scenario2AggregateWrapperGenerator
Scenario2AggregateWrapperGenerator(Scenario2WrapperHelper helper)
-
-
Method Details
-
hasFunctionWrapperParameter
Check if a method has any parameter whose type is a function wrapper. -
generateConstructorOperation
Generate constructor that creates the delegate instance. -
generateWrappingConstructor
void generateWrappingConstructor(IRConstruct construct, AggregateSymbol aggregateSymbol, String baseTypeName) Generate wrapping constructor that takes the base type as parameter. -
generateDelegationOperation
Generate a delegation operation for a single method. -
generateFunctionAcceptingMethod
void generateFunctionAcceptingMethod(IRConstruct construct, MethodSymbol method, String baseTypeName) Generate inline implementation for methods that accept function wrapper types.
-