Class PrimitiveBooleanExtractor
java.lang.Object
org.ek9lang.compiler.phase7.support.PrimitiveBooleanExtractor
- All Implemented Interfaces:
Function<BooleanExtractionParams, List<IRInstr>>
public final class PrimitiveBooleanExtractor
extends Object
implements Function<BooleanExtractionParams, List<IRInstr>>
CONCERN: Boolean primitive extraction from EK9 Boolean objects.
RESPONSIBILITY: Convert EK9 Boolean to primitive boolean via _true() with ARC compliance.
REUSABILITY: ALL generators needing primitive boolean values for control flow.
Encapsulates the pattern: 1. Call _true() method on EK9 Boolean object (returns primitive boolean) 2. No memory management needed - primitive booleans are value types
Used extensively in control flow generators (if, while, for) where conditional expressions must be primitive booleans.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(BooleanExtractionParams params) Extract primitive boolean from EK9 Boolean object.
-
Constructor Details
-
PrimitiveBooleanExtractor
public PrimitiveBooleanExtractor()
-
-
Method Details
-
apply
Extract primitive boolean from EK9 Boolean object.Handles: - CALL _true() method (EK9 Boolean → primitive boolean) - No memory management needed (primitive value)
- Specified by:
applyin interfaceFunction<BooleanExtractionParams, List<IRInstr>>- Parameters:
params- Boolean extraction parameters- Returns:
- Instructions with primitive boolean in params.resultTemp()
-