ROOT  6.06/08
Reference Guide
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
RScanner Class Reference

Definition at line 45 of file Scanner.h.

Classes

class  AnnotatedNamespaceDecl
 

Public Types

enum  EScanType : char { EScanType::kNormal, EScanType::kTwoPasses, EScanType::kOnePCM }
 
typedef std::vector< AnnotatedNamespaceDeclNamespaceColl_t
 
typedef std::vector< ROOT::TMetaUtils::AnnotatedRecordDeclClassColl_t
 
typedef std::vector< clang::TypedefNameDecl * > TypedefColl_t
 
typedef std::vector< clang::FunctionDecl * > FunctionColl_t
 
typedef std::vector< clang::VarDecl * > VariableColl_t
 
typedef std::vector< clang::EnumDecl * > EnumColl_t
 
typedef void(* DeclCallback) (const char *type)
 
typedef std::map< clang::Decl *, const BaseSelectionRule * > DeclsSelRulesMap_t
 

Public Member Functions

 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'. More...
 
bool shouldVisitTemplateInstantiations () const
 
bool TraverseStmt (clang::Stmt *)
 
bool TraverseClassTemplatePartialSpecializationDecl (clang::ClassTemplatePartialSpecializationDecl *)
 
bool VisitEnumDecl (clang::EnumDecl *D)
 
bool VisitFieldDecl (clang::FieldDecl *D)
 Nothing to be done here. More...
 
bool VisitFunctionDecl (clang::FunctionDecl *D)
 
bool VisitNamespaceDecl (clang::NamespaceDecl *D)
 This method visits a namespace node. More...
 
bool VisitRecordDecl (clang::RecordDecl *D)
 
bool VisitTypedefNameDecl (clang::TypedefNameDecl *D)
 Visitor for every TypedefNameDecl, i.e. More...
 
bool VisitVarDecl (clang::VarDecl *D)
 
bool TreatRecordDeclOrTypedefNameDecl (clang::TypeDecl *typeDecl)
 
bool TraverseDeclContextHelper (clang::DeclContext *DC)
 
DeclCallback SetRecordDeclCallback (DeclCallback callback)
 Set the callback to the RecordDecl and return the previous one. More...
 
void Scan (const clang::ASTContext &C)
 
std::string GetClassName (clang::DeclContext *DC) const
 
bool GetDeclName (clang::Decl *D, std::string &name) const
 
bool GetDeclQualName (clang::Decl *D, std::string &qual_name) const
 
bool GetFunctionPrototype (clang::Decl *D, std::string &prototype) const
 
const DeclsSelRulesMap_tGetDeclsSelRulesMap () const
 
virtual ~ RScanner ()
 

Public Attributes

ClassColl_t fSelectedClasses
 
NamespaceColl_t fSelectedNamespaces
 
TypedefColl_t fSelectedTypedefs
 
FunctionColl_t fSelectedFunctions
 
VariableColl_t fSelectedVariables
 
EnumColl_t fSelectedEnums
 

Static Public Attributes

static const char * fgClangDeclKey = "ClangDecl"
 
static const char * fgClangFuncKey = "ClangFunc"
 

Private Member Functions

std::string ConvTemplateArguments (const clang::TemplateArgumentList &list) const
 
std::string ConvTemplateName (clang::TemplateName &N) const
 
std::string ConvTemplateParameterList (clang::TemplateParameterList *list) const
 
std::string ConvTemplateParams (clang::TemplateDecl *D) const
 
void DeclInfo (clang::Decl *D) const
 
std::string ExprToStr (clang::Expr *expr) const
 
std::string FuncParameterList (clang::FunctionDecl *D) const
 
std::string FuncParameters (clang::FunctionDecl *D) const
 
std::string GetClassName (clang::RecordDecl *D) const
 
std::string GetEnumName (clang::EnumDecl *D) const
 
std::string GetLocation (clang::Decl *D) const
 
std::string GetName (clang::Decl *D) const
 
std::string GetSrcLocation (clang::SourceLocation L) const
 
unsigned int FuncModifiers (clang::FunctionDecl *D) const
 
unsigned int VarModifiers (clang::VarDecl *D) const
 
unsigned int Visibility (clang::Decl *D) const
 
unsigned int VisibilityModifiers (clang::AccessSpecifier access) const
 
void ShowError (const std::string &msg, const std::string &location="") const
 
void ShowInfo (const std::string &msg, const std::string &location="") const
 
void ShowTemplateInfo (const std::string &msg, const std::string &location="") const
 
void ShowWarning (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) More...
 
void UnimplementedDecl (clang::Decl *D, const std::string &txt="")
 information about item, that should be implemented More...
 
void UnimplementedType (clang::QualType qual_type)
 
void UnimplementedType (const clang::Type *T)
 
void UnimportantDecl (clang::Decl *D, const std::string &txt="") const
 unimportant - this kind of declaration is not stored into reflex More...
 
void UnimportantType (clang::QualType qual_type) const
 unimportant - this kind of declaration is not stored into reflex More...
 
void UnknownDecl (clang::Decl *D, const std::string &txt="") const
 unknown - this kind of declaration was not known to programmer More...
 
void UnknownType (clang::QualType qual_type) 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++) More...
 
void UnsupportedType (clang::QualType qual_type) const
 

Private Attributes

unsigned int fVerboseLevel
 
const clang::SourceManager * fSourceManager
 
const cling::Interpreter & fInterpreter
 
bool fDeclTable [fgDeclLast+1]
 
clang::Decl * fLastDecl
 
DeclCallback fRecordDeclCallback
 
bool fTypeTable [fgTypeLast+1]
 
ROOT::TMetaUtils::TNormalizedCtxtfNormCtxt
 
SelectionRulesfSelectionRules
 
std::set< clang::RecordDecl * > fselectedRecordDecls
 
EScanType fScanType
 
bool fFirstPass
 
DeclsSelRulesMap_t fDeclSelRuleMap
 

Static Private Attributes

static std::map< clang::Decl *, std::string > fgAnonymousClassMap
 
static std::map< clang::Decl *, std::string > fgAnonymousEnumMap
 
static const int fgDeclLast = clang::Decl::Var
 
static const int fgTypeLast = clang::Type::TemplateTypeParm
 
static int fgAnonymousClassCounter = 0
 
static int fgAnonymousEnumCounter = 0
 
static int fgBadClassCounter = 0
 

#include </builddir/build/BUILD/root-6.06.08/core/metautils/src/Scanner.h>

+ Inheritance diagram for RScanner:
+ Collaboration diagram for RScanner:

Member Typedef Documentation

§ ClassColl_t

Definition at line 65 of file Scanner.h.

§ DeclCallback

typedef void(* RScanner::DeclCallback) (const char *type)

Definition at line 70 of file Scanner.h.

§ DeclsSelRulesMap_t

typedef std::map<clang::Decl*,const BaseSelectionRule*> RScanner::DeclsSelRulesMap_t

Definition at line 71 of file Scanner.h.

§ EnumColl_t

typedef std::vector<clang::EnumDecl*> RScanner::EnumColl_t

Definition at line 69 of file Scanner.h.

§ FunctionColl_t

typedef std::vector<clang::FunctionDecl*> RScanner::FunctionColl_t

Definition at line 67 of file Scanner.h.

§ NamespaceColl_t

Definition at line 64 of file Scanner.h.

§ TypedefColl_t

typedef std::vector<clang::TypedefNameDecl*> RScanner::TypedefColl_t

Definition at line 66 of file Scanner.h.

§ VariableColl_t

typedef std::vector<clang::VarDecl*> RScanner::VariableColl_t

Definition at line 68 of file Scanner.h.

Member Enumeration Documentation

§ EScanType

enum RScanner::EScanType : char
strong
Enumerator
kNormal 
kTwoPasses 
kOnePCM 

Definition at line 73 of file Scanner.h.

Constructor & Destructor Documentation

§ RScanner()

RScanner::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'.

Definition at line 94 of file Scanner.cxx.

§ ~ RScanner()

virtual RScanner::~ RScanner ( )
virtual

Member Function Documentation

§ ConvTemplateArguments()

std::string RScanner::ConvTemplateArguments ( const clang::TemplateArgumentList &  list) const
private

Referenced by ConvTemplateName().

§ ConvTemplateName()

std::string RScanner::ConvTemplateName ( clang::TemplateName &  N) const
private

Definition at line 521 of file Scanner.cxx.

§ ConvTemplateParameterList()

std::string RScanner::ConvTemplateParameterList ( clang::TemplateParameterList *  list) const
private

Referenced by ConvTemplateName().

§ ConvTemplateParams()

std::string RScanner::ConvTemplateParams ( clang::TemplateDecl *  D) const
private

Referenced by ConvTemplateName().

§ DeclInfo()

void RScanner::DeclInfo ( clang::Decl *  D) const
private

Definition at line 296 of file Scanner.cxx.

§ ExprToStr()

std::string RScanner::ExprToStr ( clang::Expr *  expr) const
private

Definition at line 506 of file Scanner.cxx.

Referenced by ConvTemplateName(), and FuncParameters().

§ FuncModifiers()

unsigned int RScanner::FuncModifiers ( clang::FunctionDecl *  D) const
private

§ FuncParameterList()

std::string RScanner::FuncParameterList ( clang::FunctionDecl *  D) const
private

Definition at line 644 of file Scanner.cxx.

§ FuncParameters()

std::string RScanner::FuncParameters ( clang::FunctionDecl *  D) const
private

Definition at line 617 of file Scanner.cxx.

§ GetClassName() [1/2]

std::string RScanner::GetClassName ( clang::DeclContext *  DC) const

Definition at line 1099 of file Scanner.cxx.

§ GetClassName() [2/2]

std::string RScanner::GetClassName ( clang::RecordDecl *  D) const
private

Definition at line 455 of file Scanner.cxx.

§ GetDeclName()

bool RScanner::GetDeclName ( clang::Decl *  D,
std::string &  name 
) const

Definition at line 1111 of file Scanner.cxx.

§ GetDeclQualName()

bool RScanner::GetDeclQualName ( clang::Decl *  D,
std::string &  qual_name 
) const

Definition at line 1127 of file Scanner.cxx.

Referenced by TreatRecordDeclOrTypedefNameDecl(), and VisitNamespaceDecl().

§ GetDeclsSelRulesMap()

const DeclsSelRulesMap_t& RScanner::GetDeclsSelRulesMap ( ) const
inline

Definition at line 118 of file Scanner.h.

§ GetEnumName()

std::string RScanner::GetEnumName ( clang::EnumDecl *  D) const
private

Definition at line 482 of file Scanner.cxx.

§ GetFunctionPrototype()

bool RScanner::GetFunctionPrototype ( clang::Decl *  D,
std::string &  prototype 
) const

Definition at line 1143 of file Scanner.cxx.

§ GetLocation()

std::string RScanner::GetLocation ( clang::Decl *  D) const
private

§ GetName()

std::string RScanner::GetName ( clang::Decl *  D) const
private

§ GetSrcLocation()

std::string RScanner::GetSrcLocation ( clang::SourceLocation  L) const
private

Definition at line 245 of file Scanner.cxx.

§ Scan()

void RScanner::Scan ( const clang::ASTContext &  C)

Definition at line 1179 of file Scanner.cxx.

§ SetRecordDeclCallback()

RScanner::DeclCallback RScanner::SetRecordDeclCallback ( RScanner::DeclCallback  callback)

Set the callback to the RecordDecl and return the previous one.

Definition at line 1207 of file Scanner.cxx.

§ shouldVisitTemplateInstantiations()

bool RScanner::shouldVisitTemplateInstantiations ( ) const
inline

Definition at line 82 of file Scanner.h.

§ ShowError()

void RScanner::ShowError ( const std::string &  msg,
const std::string &  location = "" 
) const
private

Definition at line 221 of file Scanner.cxx.

§ ShowInfo()

void RScanner::ShowInfo ( const std::string &  msg,
const std::string &  location = "" 
) const
private

Definition at line 195 of file Scanner.cxx.

Referenced by DeclInfo().

§ ShowTemplateInfo()

void RScanner::ShowTemplateInfo ( const std::string &  msg,
const std::string &  location = "" 
) const
private

Definition at line 233 of file Scanner.cxx.

§ ShowWarning()

void RScanner::ShowWarning ( const std::string &  msg,
const std::string &  location = "" 
) const
private

§ TraverseClassTemplatePartialSpecializationDecl()

bool RScanner::TraverseClassTemplatePartialSpecializationDecl ( clang::ClassTemplatePartialSpecializationDecl *  )
inline

Definition at line 88 of file Scanner.h.

§ TraverseDeclContextHelper()

bool RScanner::TraverseDeclContextHelper ( clang::DeclContext *  DC)

Definition at line 1069 of file Scanner.cxx.

§ TraverseStmt()

bool RScanner::TraverseStmt ( clang::Stmt *  )
inline

Definition at line 85 of file Scanner.h.

§ TreatRecordDeclOrTypedefNameDecl()

bool RScanner::TreatRecordDeclOrTypedefNameDecl ( clang::TypeDecl *  typeDecl)

Definition at line 723 of file Scanner.cxx.

Referenced by VisitRecordDecl(), and VisitTypedefNameDecl().

§ UnexpectedDecl()

void RScanner::UnexpectedDecl ( clang::Decl *  D,
const std::string &  txt = "" 
) const
private

unexpected - this kind of declaration is unexpected (in concrete place)

Definition at line 318 of file Scanner.cxx.

§ UnimplementedDecl()

void RScanner::UnimplementedDecl ( clang::Decl *  D,
const std::string &  txt = "" 
)
private

information about item, that should be implemented

Definition at line 347 of file Scanner.cxx.

Referenced by ConvTemplateName().

§ UnimplementedType() [1/2]

void RScanner::UnimplementedType ( clang::QualType  qual_type)
private

Definition at line 407 of file Scanner.cxx.

§ UnimplementedType() [2/2]

void RScanner::UnimplementedType ( const clang::Type *  T)
private

Definition at line 431 of file Scanner.cxx.

§ UnimportantDecl()

void RScanner::UnimportantDecl ( clang::Decl *  D,
const std::string &  txt = "" 
) const
private

unimportant - this kind of declaration is not stored into reflex

Definition at line 340 of file Scanner.cxx.

§ UnimportantType()

void RScanner::UnimportantType ( clang::QualType  qual_type) const
private

unimportant - this kind of declaration is not stored into reflex

Definition at line 401 of file Scanner.cxx.

§ UnknownDecl()

void RScanner::UnknownDecl ( clang::Decl *  D,
const std::string &  txt = "" 
) const
private

unknown - this kind of declaration was not known to programmer

Definition at line 307 of file Scanner.cxx.

Referenced by ConvTemplateName().

§ UnknownType()

void RScanner::UnknownType ( clang::QualType  qual_type) const
private

Definition at line 382 of file Scanner.cxx.

§ UnsupportedDecl()

void RScanner::UnsupportedDecl ( clang::Decl *  D,
const std::string &  txt = "" 
) const
private

unsupported - this kind of declaration is probably not used (in current version of C++)

Definition at line 329 of file Scanner.cxx.

§ UnsupportedType()

void RScanner::UnsupportedType ( clang::QualType  qual_type) const
private

Definition at line 391 of file Scanner.cxx.

§ VarModifiers()

unsigned int RScanner::VarModifiers ( clang::VarDecl *  D) const
private

§ Visibility()

unsigned int RScanner::Visibility ( clang::Decl *  D) const
private

§ VisibilityModifiers()

unsigned int RScanner::VisibilityModifiers ( clang::AccessSpecifier  access) const
private

§ VisitEnumDecl()

bool RScanner::VisitEnumDecl ( clang::EnumDecl *  D)

Definition at line 993 of file Scanner.cxx.

§ VisitFieldDecl()

bool RScanner::VisitFieldDecl ( clang::FieldDecl *  D)

Nothing to be done here.

Definition at line 1024 of file Scanner.cxx.

§ VisitFunctionDecl()

bool RScanner::VisitFunctionDecl ( clang::FunctionDecl *  D)

Definition at line 1052 of file Scanner.cxx.

§ VisitNamespaceDecl()

bool RScanner::VisitNamespaceDecl ( clang::NamespaceDecl *  D)

This method visits a namespace node.

Definition at line 664 of file Scanner.cxx.

§ VisitRecordDecl()

bool RScanner::VisitRecordDecl ( clang::RecordDecl *  D)

Definition at line 713 of file Scanner.cxx.

§ VisitTypedefNameDecl()

bool RScanner::VisitTypedefNameDecl ( clang::TypedefNameDecl *  D)

Visitor for every TypedefNameDecl, i.e.

aliases and typedefs We check three conditions before trying to match the name: 1) If we are creating a big PCM 2) If the underlying decl is a RecordDecl 3) If the typedef is eventually contained in the std namespace

Definition at line 970 of file Scanner.cxx.

§ VisitVarDecl()

bool RScanner::VisitVarDecl ( clang::VarDecl *  D)

Definition at line 1008 of file Scanner.cxx.

Member Data Documentation

§ fDeclSelRuleMap

DeclsSelRulesMap_t RScanner::fDeclSelRuleMap
private

Definition at line 185 of file Scanner.h.

Referenced by TreatRecordDeclOrTypedefNameDecl().

§ fDeclTable

bool RScanner::fDeclTable[fgDeclLast+1]
private

Definition at line 173 of file Scanner.h.

Referenced by RScanner(), and UnimplementedDecl().

§ fFirstPass

bool RScanner::fFirstPass
private

Definition at line 184 of file Scanner.h.

Referenced by Scan(), and TreatRecordDeclOrTypedefNameDecl().

§ fgAnonymousClassCounter

int RScanner::fgAnonymousClassCounter = 0
staticprivate

Definition at line 177 of file Scanner.h.

Referenced by GetClassName().

§ fgAnonymousClassMap

std::map< clang::Decl *, std::string > RScanner::fgAnonymousClassMap
staticprivate

Definition at line 156 of file Scanner.h.

Referenced by GetClassName().

§ fgAnonymousEnumCounter

int RScanner::fgAnonymousEnumCounter = 0
staticprivate

Definition at line 178 of file Scanner.h.

Referenced by GetEnumName().

§ fgAnonymousEnumMap

std::map< clang::Decl *, std::string > RScanner::fgAnonymousEnumMap
staticprivate

Definition at line 157 of file Scanner.h.

Referenced by GetEnumName().

§ fgBadClassCounter

int RScanner::fgBadClassCounter = 0
staticprivate

Definition at line 179 of file Scanner.h.

§ fgClangDeclKey

const char * RScanner::fgClangDeclKey = "ClangDecl"
static

Definition at line 115 of file Scanner.h.

§ fgClangFuncKey

const char * RScanner::fgClangFuncKey = "ClangFunc"
static

Definition at line 116 of file Scanner.h.

§ fgDeclLast

const int RScanner::fgDeclLast = clang::Decl::Var
staticprivate

Definition at line 171 of file Scanner.h.

Referenced by RScanner(), and UnimplementedDecl().

§ fgTypeLast

const int RScanner::fgTypeLast = clang::Type::TemplateTypeParm
staticprivate

Definition at line 172 of file Scanner.h.

Referenced by RScanner(), and UnimplementedType().

§ fInterpreter

const cling::Interpreter& RScanner::fInterpreter
private

Definition at line 170 of file Scanner.h.

Referenced by TreatRecordDeclOrTypedefNameDecl().

§ fLastDecl

clang::Decl* RScanner::fLastDecl
private

§ fNormCtxt

ROOT::TMetaUtils::TNormalizedCtxt& RScanner::fNormCtxt
private

Definition at line 180 of file Scanner.h.

Referenced by TreatRecordDeclOrTypedefNameDecl().

§ fRecordDeclCallback

DeclCallback RScanner::fRecordDeclCallback
private

Definition at line 175 of file Scanner.h.

Referenced by SetRecordDeclCallback(), and TreatRecordDeclOrTypedefNameDecl().

§ fScanType

EScanType RScanner::fScanType
private

§ fSelectedClasses

ClassColl_t RScanner::fSelectedClasses

Definition at line 118 of file Scanner.h.

Referenced by Scan(), and TreatRecordDeclOrTypedefNameDecl().

§ fSelectedEnums

EnumColl_t RScanner::fSelectedEnums

Definition at line 126 of file Scanner.h.

Referenced by Scan(), and VisitEnumDecl().

§ fSelectedFunctions

FunctionColl_t RScanner::fSelectedFunctions

Definition at line 124 of file Scanner.h.

Referenced by Scan(), and VisitFunctionDecl().

§ fSelectedNamespaces

NamespaceColl_t RScanner::fSelectedNamespaces

Definition at line 122 of file Scanner.h.

Referenced by VisitNamespaceDecl().

§ fselectedRecordDecls

std::set<clang::RecordDecl*> RScanner::fselectedRecordDecls
private

Definition at line 182 of file Scanner.h.

Referenced by Scan(), and TreatRecordDeclOrTypedefNameDecl().

§ fSelectedTypedefs

TypedefColl_t RScanner::fSelectedTypedefs

Definition at line 123 of file Scanner.h.

Referenced by Scan(), and TreatRecordDeclOrTypedefNameDecl().

§ fSelectedVariables

VariableColl_t RScanner::fSelectedVariables

Definition at line 125 of file Scanner.h.

Referenced by VisitVarDecl().

§ fSelectionRules

SelectionRules& RScanner::fSelectionRules
private

§ fSourceManager

const clang::SourceManager* RScanner::fSourceManager
private

Definition at line 169 of file Scanner.h.

Referenced by GetLocation(), GetSrcLocation(), and Scan().

§ fTypeTable

bool RScanner::fTypeTable[fgTypeLast+1]
private

Definition at line 176 of file Scanner.h.

Referenced by RScanner(), and UnimplementedType().

§ fVerboseLevel

unsigned int RScanner::fVerboseLevel
private

Definition at line 148 of file Scanner.h.

Referenced by Scan(), TreatRecordDeclOrTypedefNameDecl(), and VisitNamespaceDecl().


The documentation for this class was generated from the following files: