Package net.sf.saxon.expr.parser
Class LoopLifter
java.lang.Object
net.sf.saxon.expr.parser.LoopLifter
Class to handle loop-lifting optimization, that is, extraction of subexpressions appearing within
a loop when there is no dependency on the controlling variable of the loop. This handles both
focus-dependent loops (such as xsl:for-each) and variable-dependent loops (such as XPath for-expressions),
and also takes into account specialist loops such as xsl:for-each-group, xsl:merge, and xsl:analyze-string.
The class is instantiated to perform optimization of a component such as a function or template, and
it contains temporary instance-level data pertaining to that function or template.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
gatherInfo
(Expression exp) Gather information about an expression.getRoot()
static Expression
process
(Expression exp, ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) Apply loop-lifting to an expression (typically the body of a template or function)
-
Constructor Details
-
LoopLifter
-
-
Method Details
-
process
public static Expression process(Expression exp, ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException Apply loop-lifting to an expression (typically the body of a template or function)- Parameters:
exp
- the expression to which loop lifting is appliedvisitor
- the expression visitorcontextInfo
- the static type of the context item- Returns:
- the optimized expression
- Throws:
XPathException
- if any error occurs
-
getRoot
-
gatherInfo
Gather information about an expression. The information (in the form of an ExpInfo object) is added to the expInfoMap, which is indexed by expression.- Parameters:
exp
- the expression for which information is required
-