Package org.basex.query.util
Class ASTVisitor
- java.lang.Object
-
- org.basex.query.util.ASTVisitor
-
- Direct Known Subclasses:
LockVisitor
public abstract class ASTVisitor extends Object
A visitor for all sub-expressions in anExpr
. All methods return aboolean
which signals if the tree walk should be continued.- Author:
- BaseX Team 2005-22, BSD License, Leo Woerteler
-
-
Constructor Summary
Constructors Constructor Description ASTVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
declared(Var var)
Notifies the visitor of a variable declaration.boolean
dynFuncCall(DynFuncCall call)
Notifies the visitor of a dynamic function call.void
enterFocus()
Notifies the visitor of an expression entering a focus.void
exitFocus()
Notifies the visitor of an expression leaving a focus.boolean
funcItem(FuncItem func)
Notifies the visitor of a function item.boolean
inlineFunc(Scope scope)
Notifies the visitor of a sub-scope.boolean
lock(String lock)
Notifies the visitor of a database lock.boolean
lock(Supplier<ArrayList<String>> list)
Notifies the visitor of database locks.boolean
staticFuncCall(StaticFuncCall call)
Notifies the visitor of a static function call.boolean
staticVar(StaticVar var)
Notifies the visitor of a reference to a static variable.boolean
used(VarRef ref)
Notifies the visitor of a variable reference.
-
-
-
Method Detail
-
declared
public boolean declared(Var var)
Notifies the visitor of a variable declaration.- Parameters:
var
- declared variable- Returns:
- if more expressions should be visited (
true
by default)
-
used
public boolean used(VarRef ref)
Notifies the visitor of a variable reference.- Parameters:
ref
- used variable- Returns:
- if more expressions should be visited (
true
by default)
-
staticVar
public boolean staticVar(StaticVar var)
Notifies the visitor of a reference to a static variable.- Parameters:
var
- static variable- Returns:
- if more expressions should be visited (
true
by default)
-
inlineFunc
public boolean inlineFunc(Scope scope)
Notifies the visitor of a sub-scope.- Parameters:
scope
- sub scope- Returns:
- if more expressions should be visited (
true
by default)
-
staticFuncCall
public boolean staticFuncCall(StaticFuncCall call)
Notifies the visitor of a static function call.- Parameters:
call
- function call- Returns:
- if more expressions should be visited (
true
by default)
-
dynFuncCall
public boolean dynFuncCall(DynFuncCall call)
Notifies the visitor of a dynamic function call.- Parameters:
call
- function call- Returns:
- if more expressions should be visited (
true
by default)
-
funcItem
public boolean funcItem(FuncItem func)
Notifies the visitor of a function item.- Parameters:
func
- the function item- Returns:
- if more expressions should be visited (
true
by default)
-
lock
public boolean lock(Supplier<ArrayList<String>> list)
Notifies the visitor of database locks. Overwritten byMainModule
. Returnsfalse
if the lock is not known statically.- Parameters:
list
- function supplying lock strings- Returns:
- if more expressions should be visited (
true
by default)
-
lock
public boolean lock(String lock)
Notifies the visitor of a database lock. Overwritten byMainModule
. Returnsfalse
if the lock is not known statically.- Parameters:
lock
- lock string (can benull
)- Returns:
- if more expressions should be visited (
true
by default)
-
enterFocus
public void enterFocus()
Notifies the visitor of an expression entering a focus. Overwritten byMainModule
.
-
exitFocus
public void exitFocus()
Notifies the visitor of an expression leaving a focus. Overwritten byMainModule
.
-
-