org.apache.derby.iapi.sql.compile
Interface ASTVisitor

All Superinterfaces:
Visitor

public interface ASTVisitor
extends Visitor

A Visitor which handles nodes in Derby's abstract syntax trees. In addition to this contract, it is expected that an ASTVisitor will have a 0-arg constructor. You use an ASTVisitor like this:

 // initialize your visitor
 MyASTVisitor myVisitor = new MyASTVisitor();
 myVisitor.initializeVisitor();
 languageConnectionContext.setASTVisitor( myVisitor );

 // then run your queries.
 ...

 // when you're done inspecting query trees, release resources and
 // remove your visitor
 languageConnectionContext.setASTVisitor( null );
 myVisitor.teardownVisitor();
 


Field Summary
static int AFTER_BIND
           
static int AFTER_OPTIMIZE
           
static int AFTER_PARSE
           
 
Method Summary
 void begin(java.lang.String statementText, int phase)
          The compiler calls this method just before walking a query tree.
 void end(int phase)
          The compiler calls this method when it's done walking a tree.
 void initializeVisitor()
          Initialize the Visitor before processing any trees.
 void teardownVisitor()
          Final call to the Visitor.
 
Methods inherited from interface org.apache.derby.iapi.sql.compile.Visitor
skipChildren, stopTraversal, visit, visitChildrenFirst
 

Field Detail

AFTER_PARSE

static final int AFTER_PARSE
See Also:
Constant Field Values

AFTER_BIND

static final int AFTER_BIND
See Also:
Constant Field Values

AFTER_OPTIMIZE

static final int AFTER_OPTIMIZE
See Also:
Constant Field Values
Method Detail

initializeVisitor

void initializeVisitor()
                       throws StandardException
Initialize the Visitor before processing any trees. User-written code calls this method before poking the Visitor into the LanguageConnectionContext. For example, an implementation of this method might open a trace file.

Throws:
StandardException

teardownVisitor

void teardownVisitor()
                     throws StandardException
Final call to the Visitor. User-written code calls this method when it is done inspecting query trees. For instance, an implementation of this method might release resources, closing files it has opened.

Throws:
StandardException

begin

void begin(java.lang.String statementText,
           int phase)
           throws StandardException
The compiler calls this method just before walking a query tree.

Parameters:
statementText - Text used to create the tree.
phase - of compilation (AFTER_PARSE, AFTER_BIND, or AFTER_OPTIMIZE).
Throws:
StandardException

end

void end(int phase)
         throws StandardException
The compiler calls this method when it's done walking a tree.

Parameters:
phase - of compilation (AFTER_PARSE, AFTER_BIND, or AFTER_OPTIMIZE).
Throws:
StandardException

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.