#ifndef TRANSLATIONUNITVISITOR_HH #define TRANSLATIONUNITVISITOR_HH #include #include #include #include #include "clang/Frontend/CompilerInstance.h" #include "clang/AST/RecursiveASTVisitor.h" class CommentSaver ; class ClassValues ; class EnumValues ; class HeaderSearchDirs ; class PrintAttributes ; /** This is the top level AST visitor. This class dispatched nodes we are interested in to lower level AST visitors. All class information is stored in this visitor. @author Alexander S. Lin @date July 2012 */ class TranslationUnitVisitor : public clang::RecursiveASTVisitor { public: TranslationUnitVisitor( clang::CompilerInstance & in_ci , HeaderSearchDirs & hsd , CommentSaver & cs , PrintAttributes & in_pa ) ; /** custom node traversal function that dispatches nodes we are interested in to lower level AST visitors */ bool TraverseDecl(clang::Decl *D); private: /** The compiler instance */ clang::CompilerInstance & ci ; /** The header search directories */ HeaderSearchDirs & hsd ; /** Holds all comments */ CommentSaver & cs ; /** attributes printer */ PrintAttributes & pa ; std::map < std::string , std::set< std::string > > fwd_declared_classes ; } ; #endif