|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.expr.ExpressionTool
This class, ExpressionTool, contains a number of useful static methods for manipulating expressions. Most importantly, it provides the factory method make() for constructing a new expression
Constructor Summary | |
ExpressionTool()
|
Method Summary | |
static int |
allocateSlots(Expression exp,
int nextFree)
Allocate slot numbers to range variables |
static void |
copyLocationInfo(Expression from,
Expression to)
Copy location information (currently just the line number) from one expression to another |
static Value |
eagerEvaluate(Expression exp,
XPathContext context)
Evaluate the expression now; lazy evaluation is not permitted in this case |
static SourceLocator |
getLocator(Expression exp)
Get location information for an expression in the form of a SourceLocator |
static String |
indent(int level)
Construct indent string, for diagnostic output |
static Value |
lazyEvaluate(Expression exp,
XPathContext context)
Do lazy evaluation of an expression. |
static Expression |
make(String expression,
StaticContext env,
int start,
int terminator)
Parse an expression. |
static boolean |
markTailFunctionCalls(Expression exp)
|
static Expression |
unsorted(Expression exp,
boolean eliminateDuplicates)
Remove unwanted sorting from an expression, at compile time |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExpressionTool()
Method Detail |
public static Expression make(String expression, StaticContext env, int start, int terminator) throws XPathException
expression
- The expression (as a character string)env
- An object giving information about the compile-time
context of the expressionterminator
- The token that marks the end of this expression; typically
Tokenizer.EOF, but may for example be a right curly brace
XPathException
- if the expression contains a static errorpublic static void copyLocationInfo(Expression from, Expression to)
public static SourceLocator getLocator(Expression exp)
public static Expression unsorted(Expression exp, boolean eliminateDuplicates) throws XPathException
XPathException
public static Value lazyEvaluate(Expression exp, XPathContext context) throws XPathException
context
- the run-time evaluation context for the expression. If
the expression is not evaluated immediately, then parts of the
context on which the expression depends need to be saved as part of
the Closure
XPathException
- if any error occurs in evaluating the
expressionpublic static Value eagerEvaluate(Expression exp, XPathContext context) throws XPathException
context
- the run-time evaluation context
XPathException
- if any dynamic error occurs evaluating the
expressionpublic static boolean markTailFunctionCalls(Expression exp)
public static String indent(int level)
level
- the indentation level (the number of spaces to return)
public static int allocateSlots(Expression exp, int nextFree)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |