public abstract class ContextFn extends StandardFunc
definition, sc
Constructor and Description |
---|
ContextFn() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(ASTVisitor visitor)
Traverses this expression, notifying the visitor of declared and used variables,
and checking the tree for other recursive properties.
|
boolean |
contextAccess()
Indicates if the function accesses the current context.
|
int |
contextArg()
Argument that provides the context.
|
VarUsage |
count(Var var)
Checks how often a variable or context reference is used in this expression.
|
protected Expr |
ctxArg(int i,
QueryContext qc)
Returns the specified argument, or the context value if it does not exist.
|
boolean |
has(Flag... flags)
Indicates if an expression has one of the specified compiler properties.
|
Expr |
inline(InlineContext ic)
Inlines an expression into this one, replacing all variable or context references.
|
boolean |
inlineable()
Indicates if the function will evaluate the current context.
|
Expr |
simplifyEbv(Expr expr,
CompileContext cc)
Optimizes EBV checks.
|
checkAdmin, checkArity, checkArity, checkCreate, checkData, checkPath, checkPath, coerceFunc, compileData, copy, data, data, dataLock, dateTimeToMs, description, equals, opt, optFirst, optFirst, optimize, plan, plan, serialize, simplifyArgs, toBaseUri, toBindings, toCollation, toDate, toDBNode, toEncodingOrNull, toNodeOrAtomItem, toOptions, toPath, toPath, toQuery, toQuery, vacuous
allAreValues, args, checkUp, compile, copyAll, exprSize, flatten, inline, inlineable, mayBePositional, simplifyAll
adoptType, atomValue, checkAllUp, checkNoEmpty, checkNoEmpty, checkNoneUp, checkNoUp, checkType, checkType, checkUp, copyType, ctxValue, ebv, item, iter, refineType, seqType, size, test, toArray, toArray, toAtomItem, toB64, toB64, toBin, toBin, toBoolean, toBoolean, toBytes, toBytes, toDouble, toDouble, toElem, toFloat, toFunc, toItem, toItem, toLong, toLong, toMap, toMap, toNode, toNode, toNodeOrNull, toNumber, toNumberOrNull, toQNm, toQNm, toToken, toToken, toTokenOrNull, toZeroToken, value
arg, atomItem, atomIter, ddo, funcType, hasFreeVars, indexAccessible, isSimple, markTailCalls, mergeEbv, simplifyFor, typeCheck, uses, visitAll
toErrorString, toString
public int contextArg()
public final boolean contextAccess()
protected final Expr ctxArg(int i, QueryContext qc) throws QueryException
i
- index of argumentqc
- query contextQueryException
- query exceptionpublic final boolean has(Flag... flags)
Expr
true
if at least flag matches an expression.has
in class StandardFunc
flags
- flags to be checkedpublic final boolean accept(ASTVisitor visitor)
Expr
public boolean inlineable()
public final VarUsage count(Var var)
Expr
Closure.optimize(org.basex.query.CompileContext)
GFLWOR.inlineForLet(org.basex.query.CompileContext)
GFLWOR.optimizePos(org.basex.query.CompileContext)
GFLWOR.simplify(org.basex.query.CompileContext)
GFLWOR.unusedVars(org.basex.query.CompileContext)
SimpleMap.optimize(org.basex.query.CompileContext)
TypeswitchGroup.optimize(org.basex.query.CompileContext)
public final Expr inline(InlineContext ic) throws QueryException
Expr
InlineContext.inline(Expr)
(see invocations of this
functions for further inlinings).
The variable reference is replaced in:
The context is replaced in:
inline
in class Arr
ic
- inlining contextnull
otherwiseQueryException
- query exceptionpublic final Expr simplifyEbv(Expr expr, CompileContext cc) throws QueryException
cc
- compilation contextexpr
- context expression (can be null
)null
QueryException
- query exceptionCopyright © 2005–2023 BaseX Team. All rights reserved.