public static class OnEmpty.UnwindAndJump extends OnEmpty
OnEmpty.ReturnEmptyString, OnEmpty.ReturnNull, OnEmpty.UnwindAndJump
RETURN_EMPTY_STRING, RETURN_NULL
Constructor and Description |
---|
UnwindAndJump(LabelInfo label)
Generate an UnwindAndStack action using an empty stack (no unwinding needed)
|
UnwindAndJump(java.util.Stack<java.lang.Class> unwindStack,
LabelInfo label) |
Modifier and Type | Method and Description |
---|---|
void |
generate(Generator ga)
Generate code.
|
LabelInfo |
getLabel()
Get the label acting as the jump destination
|
java.util.Stack<java.lang.Class> |
getUnwindStack()
Get information about the stack that needs to be unwound before making the jump.
|
public UnwindAndJump(java.util.Stack<java.lang.Class> unwindStack, LabelInfo label)
unwindStack
- Information about the classes of object that will be on the bytecode stack and must be
popped off the stack before jumping to the onEmpty label: the generated code must pop the items described
on this stack before jumping to the label.label
- a label to which control will be transferred (with nothing on the stack) if the result of the
evaluation is an empty sequence. This mechanism supports the design pattern whereby many expressions return
empty if one of there arguments is empty; rather than repeatedly checking for empty after evaluating each
subexpression, there is a "longjump" treating this as an exception case.public UnwindAndJump(LabelInfo label)
label
- the label to jump topublic void generate(Generator ga)
public LabelInfo getLabel()
public java.util.Stack<java.lang.Class> getUnwindStack()
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.