biz.hammurapi.antlr
Class AstVisitor

java.lang.Object
  extended by biz.hammurapi.antlr.AstVisitor
All Implemented Interfaces:
PoliteVisitor, Visitor

public class AstVisitor
extends java.lang.Object
implements PoliteVisitor

Visits AST and dispatches invocations by node names.

Version:
$Revision: 1.2 $
Author:
Pavel Vlasov

Constructor Summary
AstVisitor(java.lang.String[] tokenTypeNames, java.lang.String visitPrefix, java.lang.String leavePrefix)
           
 
Method Summary
 void leave(java.lang.Object target)
          Shall be invoked by Visitable at the end of navigation, when all children has already been visited.
 boolean visit(java.lang.Object target)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AstVisitor

public AstVisitor(java.lang.String[] tokenTypeNames,
                  java.lang.String visitPrefix,
                  java.lang.String leavePrefix)
Parameters:
tokenTypeNames - - can be obtained from Parser.
visitPrefix - - visit method name prefix. E.g. if prefix is visit_ then visit of AST with type name LITERAL_throws will be dispatched to method visit_LITERAL_throws if such method is present.
leavePrefix - - leave method name prefix.
Method Detail

visit

public boolean visit(java.lang.Object target)
Specified by:
visit in interface Visitor
Returns:
false if Visitor is not interested in further descending through Visitable structure

leave

public void leave(java.lang.Object target)
Description copied from interface: PoliteVisitor
Shall be invoked by Visitable at the end of navigation, when all children has already been visited.

Specified by:
leave in interface PoliteVisitor


Copyright © 2003 Hammurapi Group. All Rights Reserved.