* a function call or template call that is delegated to the caller, to be made after the stack has
* been unwound so as to save stack space.
*/
public TailCall processLeavingTail(XPathContext context) throws XPathException {
RegexIterator iter = getRegexIterator(context);
XPathContextMajor c2 = context.newContext();
c2.setOrigin(this);
c2.setCurrentIterator(iter);
c2.setCurrentRegexIterator(iter);
while (true) {
Item it = iter.next();
if (it == null) {
break;
}
if (iter.isMatching()) {
if (matching != null) {
matching.process(c2);
}
} else {
if (nonMatching != null) {