Class ASTVisitor

  • Direct Known Subclasses:
    LockVisitor

    public abstract class ASTVisitor
    extends Object
    A visitor for all sub-expressions in an Expr. All methods return a boolean which signals if the tree walk should be continued.
    Author:
    BaseX Team 2005-22, BSD License, Leo Woerteler
    • Constructor Detail

      • ASTVisitor

        public ASTVisitor()
    • 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 by MainModule. Returns false 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 by MainModule. Returns false if the lock is not known statically.
        Parameters:
        lock - lock string (can be null)
        Returns:
        if more expressions should be visited (true by default)
      • enterFocus

        public void enterFocus()
        Notifies the visitor of an expression entering a focus. Overwritten by MainModule.
      • exitFocus

        public void exitFocus()
        Notifies the visitor of an expression leaving a focus. Overwritten by MainModule.