public final class StaticFuncs extends ExprInfo
Constructor and Description |
---|
StaticFuncs() |
Modifier and Type | Method and Description |
---|---|
void |
check(QueryContext qc)
Checks if all functions have been correctly declared, and initializes all function calls.
|
void |
checkUp()
Checks if the functions perform updates.
|
void |
compile(QueryContext qc)
Compiles the functions.
|
StaticFunc |
declare(AnnList anns,
QNm nm,
Var[] args,
SeqType type,
Expr expr,
StaticContext sc,
VarScope scope,
String doc,
InputInfo ii)
Declares a new user-defined function.
|
StaticFunc[] |
funcs()
Returns all user-defined functions.
|
StaticFunc |
get(QNm name,
int arity,
InputInfo ii,
boolean error)
Returns the function with the given name and arity.
|
void |
plan(FElem plan)
Creates an expression tree.
|
void |
registerFuncLit(Closure lit)
Registers a literal for a function that was not yet encountered during parsing.
|
QueryException |
similarError(QNm name,
InputInfo ii)
Throws an exception if the name of a function is similar to the specified function name.
|
String |
toString() |
addPlan, addPlan, description, planAttr, planElem, toErrorString
public StaticFunc declare(AnnList anns, QNm nm, Var[] args, SeqType type, Expr expr, StaticContext sc, VarScope scope, String doc, InputInfo ii) throws QueryException
anns
- annotationsnm
- function nameargs
- formal parameterstype
- declared return typeexpr
- function bodysc
- static contextscope
- variable scopedoc
- current xqdoc cacheii
- input infoQueryException
- query exceptionpublic void registerFuncLit(Closure lit)
lit
- the literalpublic void check(QueryContext qc) throws QueryException
qc
- query contextQueryException
- query exceptionpublic void checkUp() throws QueryException
QueryException
- query exceptionpublic void compile(QueryContext qc)
qc
- query contextpublic StaticFunc get(QNm name, int arity, InputInfo ii, boolean error) throws QueryException
name
- function namearity
- function arityii
- input infoerror
- raise error if function is not foundnull
otherwiseQueryException
- query exceptionpublic QueryException similarError(QNm name, InputInfo ii)
name
- function nameii
- input infopublic void plan(FElem plan)
ExprInfo
public StaticFunc[] funcs()
Copyright © 2005–2015 BaseX Team. All rights reserved.