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 aConditionalEvaluationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconditionInstructionsrecord component.Returns the value of theconditionResultrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConditionalEvaluation
Creates an instance of aConditionalEvaluationrecord class.- Parameters:
conditionInstructions- the value for theconditionInstructionsrecord componentconditionResult- the value for theconditionResultrecord 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 theconditionResultrecord component.- Returns:
- the value of the
conditionResultrecord component
-