mirror of
https://github.com/nasa/trick.git
synced 2024-12-19 05:07:54 +00:00
57 lines
1.4 KiB
C++
57 lines
1.4 KiB
C++
|
|
||
|
#ifndef _TRANSLATIONUNITVISITOR_HH_
|
||
|
#define _TRANSLATIONUNITVISITOR_HH_
|
||
|
|
||
|
#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
|