Class AssignIfUnsetBlockGenerator
java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.AssignIfUnsetBlockGenerator
- All Implemented Interfaces:
Function<AssignIfUnsetDetails, List<IRInstr>>
final class AssignIfUnsetBlockGenerator
extends AbstractGenerator
implements Function<AssignIfUnsetDetails, List<IRInstr>>
Assign-if-unset generator using unified CONTROL_FLOW_CHAIN approach.
This generator has been migrated to use the unified control flow: 1. Delegates to injected ControlFlowChainGenerator for actual IR generation 2. Maintains backward compatibility with existing call sites 3. Uses CONTROL_FLOW_CHAIN with ASSIGN_IF_UNSET chain type
Assign-if-unset becomes a CONTROL_FLOW_CHAIN with condition: if (!lhsSymbol?) then assign else do nothing
PHASE 7 REFACTORING COMPLETE: Now accepts injected ControlFlowChainGenerator for maximum object reuse.
-
Field Summary
Fields inherited from class AbstractGenerator
stackContext, symbolTypeOrException, typeNameOrException, variableNameForIR -
Constructor Summary
ConstructorsConstructorDescriptionAssignIfUnsetBlockGenerator(IRGenerationContext stackContext, GeneratorSet generators) One per construct (generators.assignIfUnsetBlockGenerator, IR tidy W3.9, EXPR-15): the chain generator, the reassignment and the statement-owned closeables are the set's, read when used (some are made after this). -
Method Summary
Methods inherited from class AbstractGenerator
addCoverageProbe, createTempVariable, createTempVariableFromContext, getRecordedSymbolOrException, processBlockStatements, processBlockStatements, resultVariableOrTemp
-
Constructor Details
-
AssignIfUnsetBlockGenerator
AssignIfUnsetBlockGenerator(IRGenerationContext stackContext, GeneratorSet generators) One per construct (generators.assignIfUnsetBlockGenerator, IR tidy W3.9, EXPR-15): the chain generator, the reassignment and the statement-owned closeables are the set's, read when used (some are made after this).
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<AssignIfUnsetDetails, List<IRInstr>>
-