00001 00017 #ifndef OutputExprTreeVisitor_H 00018 #define OutputExprTreeVisitor_H 00019 00020 #include <OpenAnalysis/IRInterface/IRHandles.hpp> 00021 #include <OpenAnalysis/IRInterface/LinearityIRInterface.hpp> 00022 #include <OpenAnalysis/ExprTree/ExprTree.hpp> 00023 #include <OpenAnalysis/ExprTree/ExprTreeVisitor.hpp> 00024 #include <OpenAnalysis/Alias/Interface.hpp> 00025 #include <OpenAnalysis/ExprTree/MemRefsVisitor.hpp> 00026 #include <OpenAnalysis/OABase/Annotation.hpp> 00027 00028 namespace OA { 00029 00030 //-------------------------------------------------------------------- 00033 class OutputExprTreeVisitor : public ExprTreeVisitor, public Annotation { 00034 public: 00035 OutputExprTreeVisitor(IRHandlesIRInterface& ir); 00036 ~OutputExprTreeVisitor() {} 00037 00038 void visitExprTreeBefore(ExprTree&) { } 00039 void visitExprTreeAfter(ExprTree&) { } 00040 00041 //--------------------------------------- 00042 // method for each ExprTree::Node subclass 00043 //--------------------------------------- 00044 // default base class so that visitors can handle unknown 00045 // node sub-classes in a generic fashion 00046 void visitNode(ExprTree::Node&); 00047 00048 void visitOpNode(ExprTree::OpNode& n); 00049 void visitCallNode(ExprTree::CallNode& n); 00050 void visitMemRefNode(ExprTree::MemRefNode& n); 00051 void visitConstSymNode(ExprTree::ConstSymNode& n); 00052 void visitConstValNode(ExprTree::ConstValNode& n); 00053 00054 void output(IRHandlesIRInterface&); 00055 00056 bool getIsConst() { return mIsConst; } 00057 00058 00059 private: 00060 bool mIsConst; 00061 int mId; 00062 IRHandlesIRInterface& mIR; 00063 }; 00064 00065 00066 } // end of OA namespace 00067 00068 #endif
1.7.1