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)body- IR instructions for loop body (user code, shared across all cases)increment- IR instructions for increment (current++ or current--)endLabel- 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, List<IRInstr> body, List<IRInstr> increment, 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, List<IRInstr> body, List<IRInstr> increment, 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.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.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LoopCaseData
LoopCaseData(org.objectweb.asm.Label loopStart, List<IRInstr> conditionTemplate, String conditionPrimitive, List<IRInstr> bodySetup, List<IRInstr> body, List<IRInstr> increment, 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 componentbody- the value for thebodyrecord componentincrement- the value for theincrementrecord 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
-
body
-
increment
-
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
-