trick/trick_source/codegen/Interface_Code_Gen/ICGASTConsumer.hh
Alex Lin 14a75508a3 Cleaning up once include variables and copyright cleanup.
Changed all header file once include variables to follow the same naming
convention and not start with any underscores.  Also deleted old
incorrect copyright notices.  Also removed $Id: tags from all files.

Fixes #14.  Fixes #22.
2015-03-23 16:03:14 -05:00

52 lines
1.2 KiB
C++

#ifndef ICGASTCONSUMER_HH
#define ICGASTCONSUMER_HH
#include "clang/AST/ASTConsumer.h"
#include "clang/Sema/SemaConsumer.h"
#include "TranslationUnitVisitor.hh"
class HeaderSearchDirs ;
class CommentSaver ;
class PrintAttributes ;
/**
This class is passed to the clang parser as an ASTconsumer. We are
only interested in parsing the AST when all nodes are finished.
Therefore we only have a single TranslationUnit handler that will
handle everything.
@author Alexander S. Lin
@date July 2012
*/
class ICGASTConsumer : public clang::SemaConsumer {
public:
ICGASTConsumer( clang::CompilerInstance & in_ci , HeaderSearchDirs & in_hsd ,
CommentSaver & in_cs , PrintAttributes & in_pa ) ;
TranslationUnitVisitor & getTranslationUnitVisitor() ;
/** Called with the compiler is finished parsing everything */
void HandleTranslationUnit(clang::ASTContext &Ctx);
private:
/** The compiler instance */
clang::CompilerInstance & ci ;
/** The header search directories */
HeaderSearchDirs & hsd ;
/** The top level AST visitor. Called to parse tree in HandleTranslationUnit */
TranslationUnitVisitor tuv ;
};
#endif