public interface RepeatingNode extends NodeInterface
Node or a subclass of Node.
Repeating nodes are intended to be implemented by guest language implementations. For a full
usage example please see LoopNode.LoopNode,
TruffleRuntime.createLoopNode(RepeatingNode)| Modifier and Type | Field and Description |
|---|---|
static Object |
BREAK_LOOP_STATUS
A value indicating that the loop should not be repeated.
|
static Object |
CONTINUE_LOOP_STATUS
A value indicating that the loop should be repeated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
executeRepeating(VirtualFrame frame)
Repeatedly invoked by a
loop node implementation until the method returns
false or throws an exception. |
default Object |
executeRepeatingWithValue(VirtualFrame frame)
Repeatedly invoked by a
loop node implementation, but allows returning a
language-specific loop exit status. |
static final Object CONTINUE_LOOP_STATUS
static final Object BREAK_LOOP_STATUS
CONTINUE_LOOP_STATUS can also be used to indicate that the loop should not be
repeated.boolean executeRepeating(VirtualFrame frame)
loop node implementation until the method returns
false or throws an exception.frame - the current execution frame passed through the interpretertrue if the method should be executed again to complete the loop and
false if it must not.default Object executeRepeatingWithValue(VirtualFrame frame)
loop node implementation, but allows returning a
language-specific loop exit status. Only languages that need to return custom loop statuses
should override this method.frame - the current execution frame passed through the interpreterCONTINUE_LOOP_STATUS if the method should be executed again to complete
the loop and any other (language-specific) value if it must not.