Record Class ConditionalEvaluation
java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase7.support.ConditionalEvaluation
public record ConditionalEvaluation(List<IRInstr> conditionInstructions, String conditionResult)
extends Record
Record to group conditional evaluation instructions with the resulting condition name.
This pattern supports future IF/ELSE/Switch chaining by providing a reusable structure for condition evaluation across multiple IR instruction types: - LogicalOperationInstr (primitive boolean conditions) - GuardedAssignmentBlockInstr (assignment conditions) - Future IfElseBlockInstr (branching conditions) - Future SwitchBlockInstr (switch conditions)
Replaces the flat parameter model with structured grouping of related data: - Instructions that evaluate the condition - Name of the variable holding the condition result
-
Constructor Summary
ConstructorsConstructorDescriptionConditionalEvaluation
(List<IRInstr> conditionInstructions, String conditionResult) Creates an instance of aConditionalEvaluation
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconditionInstructions
record component.Returns the value of theconditionResult
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ConditionalEvaluation
Creates an instance of aConditionalEvaluation
record class.- Parameters:
conditionInstructions
- the value for theconditionInstructions
record componentconditionResult
- the value for theconditionResult
record component
-
-
Method Details
-
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)
. -
conditionInstructions
-
conditionResult
Returns the value of theconditionResult
record component.- Returns:
- the value of the
conditionResult
record component
-