Class Expr

Direct Known Subclasses:
ParseExpr, Value

public abstract class Expr extends ExprInfo
Abstract class for representing XQuery expressions. Expression are divided into ParseExpr and Value classes.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract boolean
    accept(ASTVisitor visitor)
    Traverses this expression, notifying the visitor of declared and used variables, and checking the tree for other recursive properties.
    final Expr
    arg(int i)
    Returns the specified argument/operand of an expression (function, list, etc).
    Returns the arguments/operands of an expression (function, list, etc).
    Evaluates the expression and returns the resulting, atomized item, or Empty.VALUE if the expression yields an empty sequence.
    Evaluates the expression and returns an iterator on the resulting, atomized items.
    abstract Value
    Evaluates the expression and returns the atomized items.
    abstract void
    Checks if the updating semantics are satisfied.
    abstract Expr
    Compiles and optimizes the expression, assigns types and cardinalities.
    abstract Expr
    Copies an expression.
    abstract VarUsage
    count(Var var)
    Checks how often a variable or context reference is used in this expression.
    Returns the data reference bound to this expression.
    void
    data(Data dt)
    Assigns a data reference, if supported.
    boolean
    ddo()
    Indicates if this expression returns nodes in document order without duplicates.
    abstract Item
    Checks if the effective boolean value can be computed for this expression:
    abstract boolean
    This function is e.g.
    abstract int
    Counts the number of expressions in this expression's sub-tree.
    Returns the function type of this expression.
    abstract boolean
    has(Flag... flags)
    Indicates if an expression has one of the specified compiler properties.
    protected boolean
    Checks if this expression has free variables.
    boolean
    Checks if an expression can be rewritten to an index access.
    abstract Expr
    Inlines an expression into this one, replacing all variable or context references.
    abstract boolean
    Checks if inlining is possible.
    final boolean
    Checks if this expression is deterministic, performs no updates, does not access the context value and position, and calls no higher-order function.
    abstract Item
    Evaluates the expression and returns the resulting item, or Empty.VALUE if the expression yields an empty sequence.
    abstract Iter
    Evaluates the expression and returns an iterator on the resulting items.
    void
    Finds and marks tail calls, enabling TCO.
    mergeEbv(Expr expr, boolean or, CompileContext cc)
    Tries to merge two expressions that are part of an EBV test.
    Optimizes an already compiled expression without recompiling its sub-expressions.
    abstract void
    Refines the expression type.
    abstract SeqType
    Returns the static type of the resulting value.
    This function is called at compile time for expressions whose operands might be simplified.
    abstract long
    Returns the result size, or -1 if the size is unknown.
    abstract Item
    Performs a predicate test and returns the item if the test was successful.
    protected Expr
    Tries to push the given type check inside this expression.
    final boolean
    uses(Var var)
    Checks if the given variable is used by this expression.
    boolean
    Tests if this is a vacuous expression (empty sequence or error function).
    abstract Value
    Evaluates the expression and returns the resulting value.
    protected static boolean
    visitAll(ASTVisitor visitor, Expr... exprs)
    Visit all given expressions with the given visitor.

    Methods inherited from class org.basex.query.expr.ExprInfo

    description, plan, plan, toErrorString, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait