Record Class ConditionCase
java.lang.Object
java.lang.Record
org.ek9lang.compiler.ir.ConditionCase
public record ConditionCase(String caseScopeId, String caseType, List<IRInstr> guardUpdates, String bodyScopeId, String enumConstant, int enumOrdinal, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult)
extends Record
Record representing a single condition case within a CONTROL_FLOW_CHAIN.
Each condition case represents one evaluation path in the sequential chain: - Question operator: NULL_CHECK case - If statement: Boolean condition evaluation - Switch case: Equality or expression evaluation - Guard conditions: Combined assignment + condition evaluation
Contains complete evaluation instructions for guard updates, condition checks, and corresponding body execution if the condition matches.
-
Constructor Summary
ConstructorsConstructorDescriptionConditionCase
(String caseScopeId, String caseType, List<IRInstr> guardUpdates, String bodyScopeId, String enumConstant, int enumOrdinal, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult) Creates an instance of aConditionCase
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebodyEvaluation
record component.Returns the value of thebodyResult
record component.Returns the value of thebodyScopeId
record component.Returns the value of thecaseScopeId
record component.caseType()
Returns the value of thecaseType
record component.Returns the value of theconditionEvaluation
record component.Returns the value of theconditionResult
record component.static ConditionCase
createEnumCase
(String caseScopeId, String enumConstant, int enumOrdinal, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult) Create a condition case for enum constant comparison (switch enum cases).static ConditionCase
createExpression
(String caseScopeId, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult) Create a condition case for general boolean expressions (if statements).static ConditionCase
createGuardCondition
(String caseScopeId, List<IRInstr> guardUpdates, String bodyScopeId, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult) Create a condition case for guard conditions (if/switch with guards).static ConditionCase
createLiteral
(String caseScopeId, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult) Create a condition case for literal value comparison (switch literal cases).static ConditionCase
createNullCheck
(String caseScopeId, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult) Create a condition case for the Question operator null check.Returns the value of theenumConstant
record component.int
Returns the value of theenumOrdinal
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of theguardUpdates
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of theprimitiveCondition
record component.toString()
IR-optimized toString following EK9's bracket-only, no-indentation format.
-
Constructor Details
-
ConditionCase
public ConditionCase(String caseScopeId, String caseType, List<IRInstr> guardUpdates, String bodyScopeId, String enumConstant, int enumOrdinal, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult) Creates an instance of aConditionCase
record class.- Parameters:
caseScopeId
- the value for thecaseScopeId
record componentcaseType
- the value for thecaseType
record componentguardUpdates
- the value for theguardUpdates
record componentbodyScopeId
- the value for thebodyScopeId
record componentenumConstant
- the value for theenumConstant
record componentenumOrdinal
- the value for theenumOrdinal
record componentconditionEvaluation
- the value for theconditionEvaluation
record componentconditionResult
- the value for theconditionResult
record componentprimitiveCondition
- the value for theprimitiveCondition
record componentbodyEvaluation
- the value for thebodyEvaluation
record componentbodyResult
- the value for thebodyResult
record component
-
-
Method Details
-
createNullCheck
-
createExpression
-
createEnumCase
public static ConditionCase createEnumCase(String caseScopeId, String enumConstant, int enumOrdinal, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult) Create a condition case for enum constant comparison (switch enum cases). -
createLiteral
-
createGuardCondition
public static ConditionCase createGuardCondition(String caseScopeId, List<IRInstr> guardUpdates, String bodyScopeId, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult) Create a condition case for guard conditions (if/switch with guards). -
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with thecompare
method from their corresponding wrapper classes. -
caseScopeId
Returns the value of thecaseScopeId
record component.- Returns:
- the value of the
caseScopeId
record component
-
caseType
Returns the value of thecaseType
record component.- Returns:
- the value of the
caseType
record component
-
guardUpdates
-
bodyScopeId
Returns the value of thebodyScopeId
record component.- Returns:
- the value of the
bodyScopeId
record component
-
enumConstant
Returns the value of theenumConstant
record component.- Returns:
- the value of the
enumConstant
record component
-
enumOrdinal
public int enumOrdinal()Returns the value of theenumOrdinal
record component.- Returns:
- the value of the
enumOrdinal
record component
-
conditionEvaluation
-
conditionResult
Returns the value of theconditionResult
record component.- Returns:
- the value of the
conditionResult
record component
-
primitiveCondition
Returns the value of theprimitiveCondition
record component.- Returns:
- the value of the
primitiveCondition
record component
-
bodyEvaluation
-
bodyResult
Returns the value of thebodyResult
record component.- Returns:
- the value of the
bodyResult
record component
-