Debian Codegraph @

net/sf/saxon/expr/instruct/TailCallReturner.java

raw symbols SCIP
1 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2018 Saxonica Limited.
3 // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4 // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
6 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7
8 package net.sf.saxon.expr.instruct;
9
10 import net.sf.saxon.expr.XPathContext;
11 import net.sf.saxon.trans.XPathException;
12
13 /**
14 * This interface represents an expression that is capable of being processed leaving tail calls for the
15 * calling instruction to deal with.
16 */
17
18 public interface TailCallReturner {
19
20 /**
21 * ProcessLeavingTail: called to do the real work of this instruction. This method
22 * must be implemented in each subclass. The results of the instruction are written
23 * to the current Receiver, which can be obtained via the Controller.
24 *
25 * @param context The dynamic context of the transformation, giving access to the current node,
26 * the current variables, etc.
27 * @return null if the instruction has completed execution; or a TailCall indicating
28 * a function call or template call that is delegated to the caller, to be made after the stack has
29 * been unwound so as to save stack space.
30 * @throws net.sf.saxon.trans.XPathException
31 * if a dynamic error occurs during the evaluation
32 * of the instruction
33 */
34
35 /*@Nullable*/
36 public TailCall processLeavingTail(XPathContext context) throws XPathException;
37 }
38