01: package net.sf.saxon.instruct;
02:
03: import net.sf.saxon.expr.XPathContext;
04: import net.sf.saxon.trans.XPathException;
05:
06: /**
07: * This interface represents an expression that is capable of being processed leaving tail calls for the
08: * calling instruction to deal with.
09: */
10:
11: public interface TailCallReturner {
12:
13: /**
14: * ProcessLeavingTail: called to do the real work of this instruction. This method
15: * must be implemented in each subclass. The results of the instruction are written
16: * to the current Receiver, which can be obtained via the Controller.
17: * @param context The dynamic context of the transformation, giving access to the current node,
18: * the current variables, etc.
19: * @return null if the instruction has completed execution; or a TailCall indicating
20: * a function call or template call that is delegated to the caller, to be made after the stack has
21: * been unwound so as to save stack space.
22: */
23:
24: public TailCall processLeavingTail(XPathContext context)
25: throws XPathException;
26: }
27:
28: //
29: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
30: // you may not use this file except in compliance with the License. You may obtain a copy of the
31: // License at http://www.mozilla.org/MPL/
32: //
33: // Software distributed under the License is distributed on an "AS IS" basis,
34: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
35: // See the License for the specific language governing rights and limitations under the License.
36: //
37: // The Original Code is: all this file.
38: //
39: // The Initial Developer of the Original Code is Michael H. Kay.
40: //
41: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
42: //
43: // Contributor(s):
44: //
|