OA::ExprTreeVisitor Class Reference

#include <ExprTreeVisitor.hpp>

Inheritance diagram for OA::ExprTreeVisitor:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~ExprTreeVisitor ()
virtual void visitExprTreeBefore (ExprTree &)=0
 called before root noded in the expression tree is visited
virtual void visitExprTreeAfter (ExprTree &)=0
 called after root noded in the expression tree is visited
virtual void visitNode (ExprTree::Node &)=0
virtual void visitOpNode (ExprTree::OpNode &n)
virtual void visitCallNode (ExprTree::CallNode &n)
virtual void visitMemRefNode (ExprTree::MemRefNode &n)
virtual void visitConstSymNode (ExprTree::ConstSymNode &n)
virtual void visitConstValNode (ExprTree::ConstValNode &n)

Protected Member Functions

 ExprTreeVisitor ()

Detailed Description

ExprTreeVisitor is an abstract base class used to implement the Visitor pattern on ExprTree Nodes.

The ExprTree::acceptVisitor method will call visitExprTreeBefore, visitExprTreeAfter, and acceptVisitor on the root node. If you want to traverse other nodes then you must call acceptVisitor on children nodes when appropriate. See EvalToConstVisitor::visitOpNode for an example.

Memory Management: It is assumed that the concrete visitors will NOT keep references to expression tree nodes and that the expression tree will not be deallocated while an ExprTreeVisitor is visiting an ExprTree. Concrete visitors should also never take the address of a Node or ExprTree and pass it to a method that requires an OA_ptr<Node>.

Definition at line 39 of file ExprTreeVisitor.hpp.


Constructor & Destructor Documentation

OA::ExprTreeVisitor::ExprTreeVisitor (  )  [inline, protected]

Definition at line 41 of file ExprTreeVisitor.hpp.

virtual OA::ExprTreeVisitor::~ExprTreeVisitor (  )  [inline, virtual]

Definition at line 43 of file ExprTreeVisitor.hpp.


Member Function Documentation

virtual void OA::ExprTreeVisitor::visitCallNode ( ExprTree::CallNode n  )  [inline, virtual]
virtual void OA::ExprTreeVisitor::visitConstSymNode ( ExprTree::ConstSymNode n  )  [inline, virtual]
virtual void OA::ExprTreeVisitor::visitConstValNode ( ExprTree::ConstValNode n  )  [inline, virtual]
virtual void OA::ExprTreeVisitor::visitExprTreeAfter ( ExprTree  )  [pure virtual]
virtual void OA::ExprTreeVisitor::visitExprTreeBefore ( ExprTree  )  [pure virtual]
virtual void OA::ExprTreeVisitor::visitMemRefNode ( ExprTree::MemRefNode n  )  [inline, virtual]
virtual void OA::ExprTreeVisitor::visitNode ( ExprTree::Node  )  [pure virtual]
virtual void OA::ExprTreeVisitor::visitOpNode ( ExprTree::OpNode n  )  [inline, virtual]

The documentation for this class was generated from the following file:

Generated on Sat Oct 31 05:25:57 2009 for OpenAnalysis by  doxygen 1.6.1