Record Class GuardVariableDetails
java.lang.Object
java.lang.Record
org.ek9lang.compiler.ir.GuardVariableDetails
public record GuardVariableDetails(List<String> guardVariables, List<IRInstr> guardScopeSetup, String guardScopeId, String conditionScopeId)
extends Record
Record containing guard variable management information for CONTROL_FLOW_CHAIN constructs.
Guard variables are used in EK9 control flow constructs like: - if/when with guards: "when var <- expr with condition" - switch with guards: "switch var := expr with var" - for loops with guards: "for var ?= expr then iterator"
Provides SSA conversion hints to LLVM backend for proper phi node placement and scope management for guard variable lifetime.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconditionScopeId
record component.static GuardVariableDetails
create
(List<String> guardVariables, List<IRInstr> guardScopeSetup, String guardScopeId, String conditionScopeId) Create guard variable details with all components.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of theguardScopeId
record component.Returns the value of theguardScopeSetup
record component.Returns the value of theguardVariables
record component.boolean
Check if this has a guard scope.boolean
Check if this has guard variables.final int
hashCode()
Returns a hash code value for this object.boolean
Check if this has a shared condition scope.boolean
isEmpty()
Check if this guard details object is empty (no guard features).static GuardVariableDetails
none()
Create empty guard variable details (no guards).toString()
IR-optimized toString following EK9's bracket-only, no-indentation format.
-
Constructor Details
-
GuardVariableDetails
public GuardVariableDetails(List<String> guardVariables, List<IRInstr> guardScopeSetup, String guardScopeId, String conditionScopeId) Creates an instance of aGuardVariableDetails
record class.- Parameters:
guardVariables
- the value for theguardVariables
record componentguardScopeSetup
- the value for theguardScopeSetup
record componentguardScopeId
- the value for theguardScopeId
record componentconditionScopeId
- the value for theconditionScopeId
record component
-
-
Method Details
-
none
Create empty guard variable details (no guards). -
create
-
hasGuardVariables
public boolean hasGuardVariables()Check if this has guard variables. -
hasGuardScope
public boolean hasGuardScope()Check if this has a guard scope. -
isEmpty
public boolean isEmpty()Check if this guard details object is empty (no guard features). -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
guardVariables
-
guardScopeSetup
-
guardScopeId
Returns the value of theguardScopeId
record component.- Returns:
- the value of the
guardScopeId
record component
-
conditionScopeId
Returns the value of theconditionScopeId
record component.- Returns:
- the value of the
conditionScopeId
record component
-