15#ifndef ROOT__RSCANNER_H__
16#define ROOT__RSCANNER_H__
24#include "clang/AST/AST.h"
25#include "clang/AST/ASTContext.h"
26#include "clang/AST/DeclGroup.h"
27#include "clang/AST/DeclFriend.h"
28#include "clang/AST/Type.h"
29#include "clang/AST/RecursiveASTVisitor.h"
31#include "llvm/IR/Module.h"
36 class ClassTemplatePartialSpecializationDecl;
37 class ClassTemplateDecl;
50class RScanner:
public clang::RecursiveASTVisitor<RScanner>
63 operator clang::NamespaceDecl
const *()
const {
return fDecl; }
66 const clang::NamespaceDecl *
fDecl;
72 typedef std::vector<ROOT::TMetaUtils::AnnotatedRecordDecl>
ClassColl_t;
84 const cling::Interpreter &interpret,
86 unsigned int verbose = 0);
115 void Scan(
const clang::ASTContext &C);
119 static bool GetDeclQualName(
const clang::Decl* D, std::string& qual_name);
137 const clang::ClassTemplateSpecializationDecl *
fDecl;
150 const clang::RecordDecl*,
152 const clang::TypedefNameDecl*,
153 unsigned int indexOffset=0);
158 void DeclInfo(clang::Decl* D)
const;
159 std::string
ExprToStr(clang::Expr* expr)
const;
164 std::string
GetName(clang::Decl* D)
const;
171 void ShowError(
const std::string &msg,
const std::string &location =
"")
const;
172 void ShowInfo(
const std::string &msg,
const std::string &location =
"")
const;
173 void ShowTemplateInfo(
const std::string &msg,
const std::string &location =
"")
const;
174 void ShowWarning(
const std::string &msg,
const std::string &location =
"")
const;
177 void UnexpectedDecl(clang::Decl* D,
const std::string &txt =
"")
const;
179 void UnimportantDecl(clang::Decl* D,
const std::string &txt =
"")
const;
180 void UnknownDecl(clang::Decl* D,
const std::string &txt =
"")
const;
182 void UnsupportedDecl(clang::Decl* D,
const std::string &txt =
"")
const;
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
const clang::NamespaceDecl * fDecl
bool RequestOnlyTClass() const
bool operator<(const AnnotatedNamespaceDecl &right)
const clang::NamespaceDecl * GetNamespaceDecl() const
AnnotatedNamespaceDecl(clang::NamespaceDecl *decl, long index, bool rRequestOnlyTClass)
std::string GetLocation(clang::Decl *D) const
void Scan(const clang::ASTContext &C)
void UnknownDecl(clang::Decl *D, const std::string &txt="") const
unknown - this kind of declaration was not known to programmer
std::string ConvTemplateArguments(const clang::TemplateArgumentList &list) const
std::string ConvTemplateParams(clang::TemplateDecl *D) const
ROOT::TMetaUtils::TNormalizedCtxt & fNormCtxt
std::vector< ROOT::TMetaUtils::AnnotatedRecordDecl > ClassColl_t
DeclCallback fRecordDeclCallback
void UnsupportedDecl(clang::Decl *D, const std::string &txt="") const
unsupported - this kind of declaration is probably not used (in current version of C++)
static std::map< clang::Decl *, std::string > fgAnonymousEnumMap
const DeclsSelRulesMap_t & GetDeclsSelRulesMap() const
void UnimportantDecl(clang::Decl *D, const std::string &txt="") const
unimportant - this kind of declaration is not stored into reflex
bool TraverseClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl *)
void AddDelayedAnnotatedRecordDecls()
const clang::SourceManager * fSourceManager
static const int fgDeclLast
FunctionColl_t fSelectedFunctions
unsigned int VisibilityModifiers(clang::AccessSpecifier access) const
unsigned int Visibility(clang::Decl *D) const
bool VisitFieldDecl(clang::FieldDecl *D)
Nothing to be done here.
void ShowInfo(const std::string &msg, const std::string &location="") const
bool TreatRecordDeclOrTypedefNameDecl(clang::TypeDecl *typeDecl)
static int fgAnonymousClassCounter
std::string FuncParameters(clang::FunctionDecl *D) const
bool fTypeTable[fgTypeLast+1]
std::vector< const clang::FunctionDecl * > FunctionColl_t
void ShowTemplateInfo(const std::string &msg, const std::string &location="") const
std::string GetEnumName(clang::EnumDecl *D) const
NamespaceColl_t fSelectedNamespaces
bool GetFunctionPrototype(clang::Decl *D, std::string &prototype) const
std::set< clang::RecordDecl * > fselectedRecordDecls
std::string ConvTemplateParameterList(clang::TemplateParameterList *list) const
std::string ConvTemplateName(clang::TemplateName &N) const
std::vector< AnnotatedNamespaceDecl > NamespaceColl_t
unsigned int FuncModifiers(clang::FunctionDecl *D) const
static int fgBadClassCounter
void UnimplementedDecl(clang::Decl *D, const std::string &txt="")
information about item, that should be implemented
bool VisitVarDecl(clang::VarDecl *D)
TypedefColl_t fSelectedTypedefs
std::string GetSrcLocation(clang::SourceLocation L) const
void(* DeclCallback)(const clang::RecordDecl *)
void UnsupportedType(clang::QualType qual_type) const
const cling::Interpreter & fInterpreter
DeclCallback SetRecordDeclCallback(DeclCallback callback)
Set the callback to the RecordDecl and return the previous one.
bool VisitNamespaceDecl(clang::NamespaceDecl *D)
This method visits a namespace node.
std::map< const clang::Decl *, const BaseSelectionRule * > DeclsSelRulesMap_t
void ShowWarning(const std::string &msg, const std::string &location="") const
std::string GetName(clang::Decl *D) const
bool shouldVisitTemplateInstantiations() const
static int fgAnonymousEnumCounter
static const char * fgClangFuncKey
void ShowError(const std::string &msg, const std::string &location="") const
void UnexpectedDecl(clang::Decl *D, const std::string &txt="") const
unexpected - this kind of declaration is unexpected (in concrete place)
EnumColl_t fSelectedEnums
int AddAnnotatedRecordDecl(const ClassSelectionRule *, const clang::Type *, const clang::RecordDecl *, const std::string &, const clang::TypedefNameDecl *, unsigned int indexOffset=0)
unsigned int VarModifiers(clang::VarDecl *D) const
std::vector< const clang::TypedefNameDecl * > TypedefColl_t
std::vector< DelayedAnnotatedRecordDeclInfo > fDelayedAnnotatedRecordDecls
std::vector< const clang::VarDecl * > VariableColl_t
bool VisitEnumDecl(clang::EnumDecl *D)
static std::map< clang::Decl *, std::string > fgAnonymousClassMap
std::string FuncParameterList(clang::FunctionDecl *D) const
static bool GetDeclQualName(const clang::Decl *D, std::string &qual_name)
bool TraverseStmt(clang::Stmt *)
std::string ExprToStr(clang::Expr *expr) const
static const int fgTypeLast
SelectionRules & fSelectionRules
static const char * fgClangDeclKey
bool VisitRecordDecl(clang::RecordDecl *D)
void UnknownType(clang::QualType qual_type) const
bool fDeclTable[fgDeclLast+1]
VariableColl_t fSelectedVariables
bool VisitFunctionDecl(clang::FunctionDecl *D)
DeclsSelRulesMap_t fDeclSelRuleMap
unsigned int fVerboseLevel
bool GetDeclName(clang::Decl *D, std::string &name) const
std::vector< const clang::EnumDecl * > EnumColl_t
bool TraverseDeclContextHelper(clang::DeclContext *DC)
ClassColl_t fSelectedClasses
void DeclInfo(clang::Decl *D) const
bool shouldVisitDecl(clang::NamedDecl *D)
Whether we can actually visit this declaration, i.e.
bool VisitTypedefNameDecl(clang::TypedefNameDecl *D)
Visitor for every TypedefNameDecl, i.e.
The class representing the collection of selection rules.
const clang::ClassTemplateSpecializationDecl * fDecl
const clang::TypedefNameDecl * fTypedefNameDecl
const ClassSelectionRule * fSelected