Top Description Fields Methods
org.apache.derby.iapi.sql.compile

public Interface ASTVisitor

extends Visitor
Imports
org.apache.derby.shared.common.error.StandardException

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

Modifier and TypeField and Description
public static final int
public static final int
public static final int

Method Summary

Modifier and TypeMethod and Description
public void
begin(String
Text used to create the tree.
statementText
,
int
of compilation (AFTER_PARSE, AFTER_BIND, or AFTER_OPTIMIZE).
phase
)

The compiler calls this method just before walking a query tree.

public void
end(int
of compilation (AFTER_PARSE, AFTER_BIND, or AFTER_OPTIMIZE).
phase
)

The compiler calls this method when it's done walking a tree.

public void
initializeVisitor()

Initialize the Visitor before processing any trees.

public void
teardownVisitor()

Final call to the Visitor.

Inherited from org.apache.derby.iapi.sql.compile.Visitor:
skipChildrenstopTraversalvisitvisitChildrenFirst

Field Detail

AFTER_BINDback to summary
public static final int AFTER_BIND
AFTER_OPTIMIZEback to summary
public static final int AFTER_OPTIMIZE
AFTER_PARSEback to summary
public static final int AFTER_PARSE

Method Detail

beginback to summary
public void begin(String statementText, int phase) throws StandardException

The compiler calls this method just before walking a query tree.

Parameters
statementText:String

Text used to create the tree.

phase:int

of compilation (AFTER_PARSE, AFTER_BIND, or AFTER_OPTIMIZE).

endback to summary
public void end(int phase) throws StandardException

The compiler calls this method when it's done walking a tree.

Parameters
phase:int

of compilation (AFTER_PARSE, AFTER_BIND, or AFTER_OPTIMIZE).

initializeVisitorback to summary
public 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.

teardownVisitorback to summary
public 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.