trick/trick_source/codegen/Interface_Code_Gen/TranslationUnitVisitor.hh

57 lines
1.3 KiB
C++
Raw Normal View History

2015-02-26 15:02:31 +00:00
#ifndef TRANSLATIONUNITVISITOR_HH
#define TRANSLATIONUNITVISITOR_HH
2015-02-26 15:02:31 +00:00
#include <string>
#include <vector>
#include <set>
#include <map>
#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<TranslationUnitVisitor> {
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