Record Class LoopCaseData
java.lang.Object
java.lang.Record
org.ek9lang.compiler.backend.jvm.LoopCaseData
- Record Components:
loopStart- Label marking the start of the loop (for goto jumps back)conditionTemplate- IR instructions to evaluate loop condition (re-executed each iteration)conditionPrimitive- Variable name holding primitive boolean condition resultbodySetup- IR instructions for body setup (assigns loopVariable = current)valueGuard- nullable: the loop value is usable only when its primitive is true, else the body is skipped (a constraint hole in a constrained range)body- IR instructions for loop body (user code, shared across all cases)endCheck- the counter has reached the end: the loop stops before the increment when trueincrement- IR instructions for increment (current++ or current--); empty when a progress check stepsprogressCheck- nullable: the step and the test that the counter moved toward the end (Time and user-defined range types only); the loop ends when it did notendLabel- Label to jump to when loop exits (shared across all cases)loopScopeId- Unique scope ID for this loop (used for label generation)dispatchCase- Which FOR_RANGE dispatch case (ASCENDING or DESCENDING)
record LoopCaseData(org.objectweb.asm.Label loopStart, List<IRInstr> conditionTemplate, String conditionPrimitive, List<IRInstr> bodySetup, ForRangePolymorphicInstr.ValueGuard valueGuard, List<IRInstr> body, ForRangePolymorphicInstr.EndCheck endCheck, List<IRInstr> increment, ForRangePolymorphicInstr.ProgressCheck progressCheck, org.objectweb.asm.Label endLabel, String loopScopeId, BytecodeGenerationContext.DispatchCase dispatchCase)
extends Record
Encapsulates all data needed for generating a FOR_RANGE loop case (ascending or descending).
This record groups the 9 parameters needed for loop generation into a single cohesive unit.
-
Constructor Summary
ConstructorsConstructorDescriptionLoopCaseData(org.objectweb.asm.Label loopStart, List<IRInstr> conditionTemplate, String conditionPrimitive, List<IRInstr> bodySetup, ForRangePolymorphicInstr.ValueGuard valueGuard, List<IRInstr> body, ForRangePolymorphicInstr.EndCheck endCheck, List<IRInstr> increment, ForRangePolymorphicInstr.ProgressCheck progressCheck, org.objectweb.asm.Label endLabel, String loopScopeId, BytecodeGenerationContext.DispatchCase dispatchCase) Creates an instance of aLoopCaseDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the value of thebodyrecord component.Returns the value of thebodySetuprecord component.Returns the value of theconditionPrimitiverecord component.Returns the value of theconditionTemplaterecord component.Returns the value of thedispatchCaserecord component.endCheck()Returns the value of theendCheckrecord component.org.objectweb.asm.LabelendLabel()Returns the value of theendLabelrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theincrementrecord component.Returns the value of theloopScopeIdrecord component.org.objectweb.asm.LabelReturns the value of theloopStartrecord component.Returns the value of theprogressCheckrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevalueGuardrecord component.
-
Constructor Details
-
LoopCaseData
LoopCaseData(org.objectweb.asm.Label loopStart, List<IRInstr> conditionTemplate, String conditionPrimitive, List<IRInstr> bodySetup, ForRangePolymorphicInstr.ValueGuard valueGuard, List<IRInstr> body, ForRangePolymorphicInstr.EndCheck endCheck, List<IRInstr> increment, ForRangePolymorphicInstr.ProgressCheck progressCheck, org.objectweb.asm.Label endLabel, String loopScopeId, BytecodeGenerationContext.DispatchCase dispatchCase) Creates an instance of aLoopCaseDatarecord class.- Parameters:
loopStart- the value for theloopStartrecord componentconditionTemplate- the value for theconditionTemplaterecord componentconditionPrimitive- the value for theconditionPrimitiverecord componentbodySetup- the value for thebodySetuprecord componentvalueGuard- the value for thevalueGuardrecord componentbody- the value for thebodyrecord componentendCheck- the value for theendCheckrecord componentincrement- the value for theincrementrecord componentprogressCheck- the value for theprogressCheckrecord componentendLabel- the value for theendLabelrecord componentloopScopeId- the value for theloopScopeIdrecord componentdispatchCase- the value for thedispatchCaserecord 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). -
loopStart
-
conditionTemplate
Returns the value of theconditionTemplaterecord component.- Returns:
- the value of the
conditionTemplaterecord component
-
conditionPrimitive
Returns the value of theconditionPrimitiverecord component.- Returns:
- the value of the
conditionPrimitiverecord component
-
bodySetup
-
valueGuard
Returns the value of thevalueGuardrecord component.- Returns:
- the value of the
valueGuardrecord component
-
body
-
endCheck
-
increment
-
progressCheck
Returns the value of theprogressCheckrecord component.- Returns:
- the value of the
progressCheckrecord component
-
endLabel
-
loopScopeId
Returns the value of theloopScopeIdrecord component.- Returns:
- the value of the
loopScopeIdrecord component
-
dispatchCase
Returns the value of thedispatchCaserecord component.- Returns:
- the value of the
dispatchCaserecord component
-