public abstract class Step extends Preds
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.
|
Expr |
compile(QueryContext qc,
VarScope scp)
Compiles and optimizes the expression, assigns types and cardinalities.
|
abstract Step |
copy(QueryContext qc,
VarScope scp,
IntObjMap<Var> vs)
Copies an expression.
|
int |
exprSize()
Counts the number of expressions in this expression's sub-tree.
|
static Step |
get(InputInfo info,
Axis axis,
Test test,
Expr... preds)
This method returns the most appropriate step implementation.
|
Expr |
inline(QueryContext qc,
VarScope scp,
Var var,
Expr ex)
Inlines an expression into this one, replacing all references to the given variable.
|
Expr |
optimize(QueryContext qc,
VarScope scp)
Optimizes an already compiled expression without recompiling its sub-expressions.
|
void |
plan(FElem plan)
Creates an expression tree.
|
boolean |
sameAs(Expr cmp)
Compares the current and specified expression for equality.
|
boolean |
simple(Axis ax,
boolean name)
Checks if this step has no predicates and uses the specified axis text.
|
String |
toString() |
checkUp, count, has, merge, num, preds, removable, seqType
atomItem, atomValue, checkAtomic, checkNoEmpty, checkNoEmpty, checkNoneUp, checkNoUp, checkType, compBln, copyType, ctxValue, ebv, item, iter, optPre, optPre, preEval, seqType, seqType, size, test, toArray, toArray, toAtomItem, toB64, toB64, toBin, toBin, toBoolean, toBoolean, toBytes, toBytes, toDouble, toDouble, toElem, toEmptyNode, toEmptyToken, toFloat, toFunc, toItem, toLong, toLong, toMap, toMap, toNode, toNode, toNumber, toQNm, toQNm, toToken, toToken, value
atomIter, data, hasFreeVars, indexAccessible, inlineAll, isEmpty, isFunction, isVacuous, isValue, iterable, markTailCalls, optimizeEbv, typeCheck, uses, visitAll
addPlan, addPlan, description, planAttr, planElem, toErrorString
public final Test test
public static Step get(InputInfo info, Axis axis, Test test, Expr... preds)
info
- input infoaxis
- axistest
- node testpreds
- predicatespublic Expr compile(QueryContext qc, VarScope scp) throws QueryException
Expr
QueryContext.compile()
.compile
in class Preds
qc
- query contextscp
- variable scopeQueryException
- query exceptionpublic Expr optimize(QueryContext qc, VarScope scp) throws QueryException
Expr
optimize
in class Preds
qc
- query contextscp
- variable scopeQueryException
- query exceptionpublic Expr inline(QueryContext qc, VarScope scp, Var var, Expr ex) throws QueryException
Expr
GFLWOR.inlineLets(org.basex.query.QueryContext, org.basex.query.var.VarScope)
and For.toPredicate(org.basex.query.QueryContext, org.basex.query.var.VarScope, org.basex.query.expr.Expr)
,
and the variable reference is replaced in VarRef.inline(org.basex.query.QueryContext, org.basex.query.var.VarScope, org.basex.query.var.Var, org.basex.query.expr.Expr)
.inline
in class Expr
qc
- query context for reoptimizationscp
- variable scope for reoptimizationvar
- variable to replaceex
- expression to inlinenull
otherwiseQueryException
- query exceptionpublic abstract Step copy(QueryContext qc, VarScope scp, IntObjMap<Var> vs)
Expr
public final boolean simple(Axis ax, boolean name)
ax
- axis to be checkedname
- name/node testpublic final boolean sameAs(Expr cmp)
Expr
public boolean accept(ASTVisitor visitor)
Expr
public int exprSize()
Expr
StaticFunc.inline(org.basex.query.QueryContext, org.basex.query.util.list.AnnList, org.basex.query.expr.Expr)
to check if an expression
is small enough to be inlined.public final void plan(FElem plan)
ExprInfo
Copyright © 2005–2015 BaseX Team. All rights reserved.