15 #ifndef ROOT__RSCANNER_H__
16 #define ROOT__RSCANNER_H__
20 #include "clang/AST/AST.h"
21 #include "clang/AST/ASTContext.h"
22 #include "clang/AST/DeclGroup.h"
23 #include "clang/AST/DeclFriend.h"
24 #include "clang/AST/Type.h"
25 #include "clang/AST/RecursiveASTVisitor.h"
27 #include "llvm/IR/Module.h"
32 class ClassTemplatePartialSpecializationDecl;
33 class ClassTemplateDecl;
45 class RScanner:
public clang::RecursiveASTVisitor<RScanner>
56 operator clang::NamespaceDecl
const *()
const {
return fDecl; }
59 const clang::NamespaceDecl *
fDecl;
65 typedef std::vector<ROOT::TMetaUtils::AnnotatedRecordDecl>
ClassColl_t;
77 const cling::Interpreter &interpret,
107 void Scan(
const clang::ASTContext &
C);
138 void DeclInfo(clang::Decl* D)
const;
139 std::string
ExprToStr(clang::Expr* expr)
const;
145 std::string
GetName(clang::Decl* D)
const;
150 unsigned int Visibility(clang::Decl* D)
const;
152 void ShowError(
const std::string &msg,
const std::string &location =
"")
const;
153 void ShowInfo(
const std::string &msg,
const std::string &location =
"")
const;
154 void ShowTemplateInfo(
const std::string &msg,
const std::string &location =
"")
const;
155 void ShowWarning(
const std::string &msg,
const std::string &location =
"")
const;
158 void UnexpectedDecl(clang::Decl* D,
const std::string &txt =
"")
const;
162 void UnimportantDecl(clang::Decl* D,
const std::string &txt =
"")
const;
164 void UnknownDecl(clang::Decl* D,
const std::string &txt =
"")
const;
166 void UnsupportedDecl(clang::Decl* D,
const std::string &txt =
"")
const;
std::string ConvTemplateArguments(const clang::TemplateArgumentList &list) const
NamespaceColl_t fSelectedNamespaces
bool shouldVisitTemplateInstantiations() const
bool VisitVarDecl(clang::VarDecl *D)
void ShowWarning(const std::string &msg, const std::string &location="") const
bool TraverseStmt(clang::Stmt *)
bool GetDeclQualName(clang::Decl *D, std::string &qual_name) const
void UnimplementedDecl(clang::Decl *D, const std::string &txt="")
information about item, that should be implemented
std::string GetLocation(clang::Decl *D) const
RooArgList L(const RooAbsArg &v1)
static const int fgTypeLast
static std::map< clang::Decl *, std::string > fgAnonymousEnumMap
void ShowTemplateInfo(const std::string &msg, const std::string &location="") const
void(* DeclCallback)(const char *type)
const clang::NamespaceDecl * fDecl
static std::map< clang::Decl *, std::string > fgAnonymousClassMap
static int fgAnonymousEnumCounter
ROOT::TMetaUtils::TNormalizedCtxt & fNormCtxt
unsigned int fVerboseLevel
bool fDeclTable[fgDeclLast+1]
SelectionRules & fSelectionRules
void UnexpectedDecl(clang::Decl *D, const std::string &txt="") const
unexpected - this kind of declaration is unexpected (in concrete place)
static const char * fgClangDeclKey
unsigned int VarModifiers(clang::VarDecl *D) const
VariableColl_t fSelectedVariables
const char Int_t const char TProof Int_t stype
void UnimportantDecl(clang::Decl *D, const std::string &txt="") const
unimportant - this kind of declaration is not stored into reflex
static int fgAnonymousClassCounter
bool VisitTypedefNameDecl(clang::TypedefNameDecl *D)
Visitor for every TypedefNameDecl, i.e.
bool GetFunctionPrototype(clang::Decl *D, std::string &prototype) const
bool VisitFieldDecl(clang::FieldDecl *D)
Nothing to be done here.
std::string FuncParameterList(clang::FunctionDecl *D) const
void UnknownDecl(clang::Decl *D, const std::string &txt="") const
unknown - this kind of declaration was not known to programmer
unsigned int Visibility(clang::Decl *D) const
FunctionColl_t fSelectedFunctions
bool TraverseClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl *)
The class representing the collection of selection rules.
std::string GetSrcLocation(clang::SourceLocation L) const
std::vector< clang::FunctionDecl * > FunctionColl_t
void UnimplementedType(clang::QualType qual_type)
DeclCallback SetRecordDeclCallback(DeclCallback callback)
Set the callback to the RecordDecl and return the previous one.
const cling::Interpreter & fInterpreter
RScanner(SelectionRules &rules, EScanType stype, const cling::Interpreter &interpret, ROOT::TMetaUtils::TNormalizedCtxt &normCtxt, unsigned int verbose=0)
Regular constructor setting up the scanner to search for entities matching the 'rules'.
std::string GetName(clang::Decl *D) const
bool RequestOnlyTClass() const
std::vector< clang::VarDecl * > VariableColl_t
const DeclsSelRulesMap_t & GetDeclsSelRulesMap() const
bool operator<(const AnnotatedNamespaceDecl &right)
static const int fgDeclLast
std::vector< clang::EnumDecl * > EnumColl_t
void ShowError(const std::string &msg, const std::string &location="") const
DeclsSelRulesMap_t fDeclSelRuleMap
ClassColl_t fSelectedClasses
std::string GetEnumName(clang::EnumDecl *D) const
std::string ConvTemplateParams(clang::TemplateDecl *D) const
Type
enumeration specifying the integration types.
void ShowInfo(const std::string &msg, const std::string &location="") const
void Scan(const clang::ASTContext &C)
const clang::NamespaceDecl * GetNamespaceDecl() const
std::string ExprToStr(clang::Expr *expr) const
bool VisitFunctionDecl(clang::FunctionDecl *D)
const clang::SourceManager * fSourceManager
std::map< clang::Decl *, const BaseSelectionRule * > DeclsSelRulesMap_t
void DeclInfo(clang::Decl *D) const
bool VisitEnumDecl(clang::EnumDecl *D)
std::string ConvTemplateName(clang::TemplateName &N) const
bool VisitRecordDecl(clang::RecordDecl *D)
bool fTypeTable[fgTypeLast+1]
std::set< clang::RecordDecl * > fselectedRecordDecls
EnumColl_t fSelectedEnums
bool TraverseDeclContextHelper(clang::DeclContext *DC)
AnnotatedNamespaceDecl(clang::NamespaceDecl *decl, long index, bool rRequestOnlyTClass)
typedef void((*Func_t)())
bool VisitNamespaceDecl(clang::NamespaceDecl *D)
This method visits a namespace node.
std::vector< ROOT::TMetaUtils::AnnotatedRecordDecl > ClassColl_t
void UnknownType(clang::QualType qual_type) const
std::vector< AnnotatedNamespaceDecl > NamespaceColl_t
unsigned int VisibilityModifiers(clang::AccessSpecifier access) const
static const char * fgClangFuncKey
std::string FuncParameters(clang::FunctionDecl *D) const
bool GetDeclName(clang::Decl *D, std::string &name) const
DeclCallback fRecordDeclCallback
unsigned int FuncModifiers(clang::FunctionDecl *D) const
std::string GetClassName(clang::DeclContext *DC) const
void UnsupportedDecl(clang::Decl *D, const std::string &txt="") const
unsupported - this kind of declaration is probably not used (in current version of C++) ...
bool TreatRecordDeclOrTypedefNameDecl(clang::TypeDecl *typeDecl)
void UnsupportedType(clang::QualType qual_type) const
static int fgBadClassCounter
void UnimportantType(clang::QualType qual_type) const
unimportant - this kind of declaration is not stored into reflex
std::vector< clang::TypedefNameDecl * > TypedefColl_t
std::string ConvTemplateParameterList(clang::TemplateParameterList *list) const
TypedefColl_t fSelectedTypedefs