Interface CompositeInstr
- All Known Implementing Classes:
AssertThrowsInstr, ControlFlowChainInstr, DictLiteralInstr, ForRangePolymorphicInstr, ListLiteralInstr, LogicalOperationInstr, StringInterpolationInstr
public sealed interface CompositeInstr
permits AssertThrowsInstr, ControlFlowChainInstr, DictLiteralInstr, ForRangePolymorphicInstr, ListLiteralInstr, LogicalOperationInstr, StringInterpolationInstr
An instruction that holds nested instruction lists - THE one statement of which lists a composite has, in which
order, and whether each runs once or once per loop iteration.
IRStructureWalk (visiting) and
IRRewriter (rebuilding) work through it, so no walker or pass re-derives a composite's shape.
Composites are immutable: withNestedLists(UnaryOperator) builds a copy whose lists are the rewritten ones, everything
else unchanged, and returns this when the rewrite changed nothing.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumHow often a nested list runs each time its composite runs.static final recordOne nested list. -
Method Summary
Modifier and TypeMethodDescriptionEvery nested list, in the order the IR text renders them.Null-safe application of a list rewrite: an absent list stays absent.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) A copy with every nested list replaced byrewriteof it - exactly the listsnestedLists()reports, in that order;thiswhen no list changed.
-
Method Details
-
nestedLists
List<CompositeInstr.NestedList> nestedLists()Every nested list, in the order the IR text renders them. Absent (null) lists are omitted. -
withNestedLists
A copy with every nested list replaced byrewriteof it - exactly the listsnestedLists()reports, in that order;thiswhen no list changed. -
rewritten
-