net.sf.saxon.expr
public abstract class FunctionCall extends ComputedExpression
Field Summary | |
---|---|
protected Expression[] | argument
The array of expressions representing the actual parameters
to the function call |
Method Summary | |
---|---|
protected int | checkArgumentCount(int min, int max, StaticContext env)
Check number of arguments. |
protected abstract void | checkArguments(StaticContext env)
Method supplied by each class of function to check arguments during parsing, when all
the argument expressions have been read |
void | display(int level, NamePool pool, PrintStream out) |
String | getDisplayName(NamePool pool)
Diagnostic print of expression structure |
int | getFunctionNameCode()
Get the name code of the function being called |
int | getNumberOfArguments()
Determine the number of actual arguments supplied in the function call |
Iterator | iterateSubExpressions()
Get the immediate subexpressions of this expression |
Expression | optimize(Optimizer opt, StaticContext env, ItemType contextItemType)
Perform optimisation of an expression and its subexpressions.
|
Expression | preEvaluate(StaticContext env)
Pre-evaluate a function at compile time. |
Expression | promote(PromotionOffer offer)
Promote this expression if possible |
void | setArguments(Expression[] args)
Method called by the expression parser when all arguments have been supplied |
void | setFunctionNameCode(int nc)
Set the name code of the function being called |
Expression | simplify(StaticContext env)
Simplify the function call. |
protected Expression | simplifyArguments(StaticContext env)
Simplify the arguments of the function.
|
Expression | typeCheck(StaticContext env, ItemType contextItemType)
Type-check the expression. |
Parameters: min the minimum number of arguments allowed max the maximum number of arguments allowed
Returns: the actual number of arguments
Throws: net.sf.saxon.trans.XPathException if the number of arguments is out of range
Returns: the name code as recorded in the name pool
This method is called after all references to functions and variables have been resolved to the declaration of the function or variable, and after all type checking has been done.
Parameters: opt the optimizer in use. This provides access to supporting functions; it also allows different optimization strategies to be used in different circumstances. env the static context of the expression contextItemType the static type of "." at the point where this expression is invoked. The parameter is set to null if it is known statically that the context item will be undefined. If the type of the context item is not known statically, the argument is set to ITEM_TYPE
Returns: the original expression, rewritten if appropriate to optimize execution
Throws: net.sf.saxon.trans.StaticError if an error is discovered during this phase (typically a type error)
Returns: the result of simplifying the arguments of the expression