Record Class GuardVariableDetails
java.lang.Object
java.lang.Record
org.ek9lang.compiler.ir.data.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 theconditionScopeIdrecord component.static GuardVariableDetailscreate(List<String> guardVariables, List<IRInstr> guardScopeSetup, String guardScopeId, String conditionScopeId) Create guard variable details with all components.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theguardScopeIdrecord component.Returns the value of theguardScopeSetuprecord component.Returns the value of theguardVariablesrecord component.booleanCheck if this has a guard scope.booleanCheck if this has guard variables.final inthashCode()Returns a hash code value for this object.booleanCheck if this has a shared condition scope.booleanisEmpty()Check if this guard details object is empty (no guard features).static GuardVariableDetailsnone()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 aGuardVariableDetailsrecord class.- Parameters:
guardVariables- the value for theguardVariablesrecord componentguardScopeSetup- the value for theguardScopeSetuprecord componentguardScopeId- the value for theguardScopeIdrecord componentconditionScopeId- the value for theconditionScopeIdrecord 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 theguardScopeIdrecord component.- Returns:
- the value of the
guardScopeIdrecord component
-
conditionScopeId
Returns the value of theconditionScopeIdrecord component.- Returns:
- the value of the
conditionScopeIdrecord component
-