Logo ROOT   6.08/02
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | 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 46 of file Scanner.h.

Classes

class  AnnotatedNamespaceDecl
 

Public Types

typedef std::vector
< ROOT::TMetaUtils::AnnotatedRecordDecl > 
ClassColl_t
 
typedef void(* DeclCallback )(const char *type)
 
typedef std::map< clang::Decl
*, const BaseSelectionRule * > 
DeclsSelRulesMap_t
 
typedef std::vector
< clang::EnumDecl * > 
EnumColl_t
 
enum  EScanType : char { EScanType::kNormal, EScanType::kTwoPasses, EScanType::kOnePCM }
 
typedef std::vector
< clang::FunctionDecl * > 
FunctionColl_t
 
typedef std::vector
< AnnotatedNamespaceDecl > 
NamespaceColl_t
 
typedef std::vector
< clang::TypedefNameDecl * > 
TypedefColl_t
 
typedef std::vector
< clang::VarDecl * > 
VariableColl_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...
 
virtual ~RScanner ()
 
bool GetDeclName (clang::Decl *D, std::string &name) const
 
bool GetDeclQualName (const clang::Decl *D, std::string &qual_name) const
 
const DeclsSelRulesMap_t & GetDeclsSelRulesMap () const
 
bool GetFunctionPrototype (clang::Decl *D, std::string &prototype) const
 
void Scan (const clang::ASTContext &C)
 
DeclCallback SetRecordDeclCallback (DeclCallback callback)
 Set the callback to the RecordDecl and return the previous one. More...
 
bool shouldVisitTemplateInstantiations () const
 
bool TraverseClassTemplatePartialSpecializationDecl (clang::ClassTemplatePartialSpecializationDecl *)
 
bool TraverseDeclContextHelper (clang::DeclContext *DC)
 
bool TraverseStmt (clang::Stmt *)
 
bool TreatRecordDeclOrTypedefNameDecl (clang::TypeDecl *typeDecl)
 
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)
 

Public Attributes

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

Static Public Attributes

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

Private Member Functions

void AddAnnotatedRecordDecl (const ClassSelectionRule *, const clang::Type *, const clang::RecordDecl *, const std::string &, const clang::TypedefNameDecl *, unsigned int indexOffset=0)
 
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
 
unsigned int FuncModifiers (clang::FunctionDecl *D) const
 
std::string FuncParameterList (clang::FunctionDecl *D) const
 
std::string FuncParameters (clang::FunctionDecl *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
 
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 UnimportantDecl (clang::Decl *D, const std::string &txt="") 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
 
unsigned int VarModifiers (clang::VarDecl *D) const
 
unsigned int Visibility (clang::Decl *D) const
 
unsigned int VisibilityModifiers (clang::AccessSpecifier access) const
 

Private Attributes

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

Static Private Attributes

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

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

Inheritance diagram for RScanner:
[legend]

Member Typedef Documentation

Definition at line 66 of file Scanner.h.

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

Definition at line 71 of file Scanner.h.

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

Definition at line 72 of file Scanner.h.

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

Definition at line 70 of file Scanner.h.

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

Definition at line 68 of file Scanner.h.

Definition at line 65 of file Scanner.h.

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

Definition at line 67 of file Scanner.h.

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

Definition at line 69 of file Scanner.h.

Member Enumeration Documentation

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

Definition at line 74 of file Scanner.h.

Constructor & Destructor Documentation

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 71 of file Scanner.cxx.

RScanner::~RScanner ( )
virtual

Definition at line 99 of file Scanner.cxx.

Member Function Documentation

void RScanner::AddAnnotatedRecordDecl ( const ClassSelectionRule *  selected,
const clang::Type *  req_type,
const clang::RecordDecl *  recordDecl,
const std::string &  attr_name,
const clang::TypedefNameDecl *  typedefNameDecl,
unsigned int  indexOffset = 0 
)
private

Definition at line 501 of file Scanner.cxx.

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

Definition at line 390 of file Scanner.cxx.

std::string RScanner::ConvTemplateParameterList ( clang::TemplateParameterList *  list) const
private
std::string RScanner::ConvTemplateParams ( clang::TemplateDecl *  D) const
private
void RScanner::DeclInfo ( clang::Decl *  D) const
private

Definition at line 249 of file Scanner.cxx.

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

Definition at line 375 of file Scanner.cxx.

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

Definition at line 432 of file Scanner.cxx.

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

Definition at line 405 of file Scanner.cxx.

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

Definition at line 909 of file Scanner.cxx.

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

Definition at line 925 of file Scanner.cxx.

const DeclsSelRulesMap_t& RScanner::GetDeclsSelRulesMap ( ) const
inline

Definition at line 118 of file Scanner.h.

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

Definition at line 351 of file Scanner.cxx.

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

Definition at line 941 of file Scanner.cxx.

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

Definition at line 208 of file Scanner.cxx.

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

Definition at line 225 of file Scanner.cxx.

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

Definition at line 198 of file Scanner.cxx.

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

Definition at line 977 of file Scanner.cxx.

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

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

Definition at line 1003 of file Scanner.cxx.

bool RScanner::shouldVisitTemplateInstantiations ( ) const
inline

Definition at line 83 of file Scanner.h.

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

Definition at line 180 of file Scanner.cxx.

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

Definition at line 164 of file Scanner.cxx.

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

Definition at line 188 of file Scanner.cxx.

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

Definition at line 172 of file Scanner.cxx.

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

Definition at line 89 of file Scanner.h.

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

Definition at line 879 of file Scanner.cxx.

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

Definition at line 86 of file Scanner.h.

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

Definition at line 559 of file Scanner.cxx.

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 271 of file Scanner.cxx.

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

information about item, that should be implemented

Definition at line 300 of file Scanner.cxx.

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 293 of file Scanner.cxx.

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 260 of file Scanner.cxx.

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

Definition at line 333 of file Scanner.cxx.

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 282 of file Scanner.cxx.

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

Definition at line 342 of file Scanner.cxx.

unsigned int RScanner::VarModifiers ( clang::VarDecl *  D) const
private
unsigned int RScanner::Visibility ( clang::Decl *  D) const
private
unsigned int RScanner::VisibilityModifiers ( clang::AccessSpecifier  access) const
private
bool RScanner::VisitEnumDecl ( clang::EnumDecl *  D)

Definition at line 809 of file Scanner.cxx.

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

Nothing to be done here.

Definition at line 840 of file Scanner.cxx.

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

Definition at line 862 of file Scanner.cxx.

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

This method visits a namespace node.

Definition at line 452 of file Scanner.cxx.

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

Definition at line 491 of file Scanner.cxx.

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 786 of file Scanner.cxx.

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

Definition at line 824 of file Scanner.cxx.

Member Data Documentation

DeclsSelRulesMap_t RScanner::fDeclSelRuleMap
private

Definition at line 187 of file Scanner.h.

bool RScanner::fDeclTable[fgDeclLast+1]
private

Definition at line 175 of file Scanner.h.

bool RScanner::fFirstPass
private

Definition at line 186 of file Scanner.h.

int RScanner::fgAnonymousClassCounter = 0
staticprivate

Definition at line 179 of file Scanner.h.

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

Definition at line 161 of file Scanner.h.

int RScanner::fgAnonymousEnumCounter = 0
staticprivate

Definition at line 180 of file Scanner.h.

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

Definition at line 162 of file Scanner.h.

int RScanner::fgBadClassCounter = 0
staticprivate

Definition at line 181 of file Scanner.h.

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

Definition at line 115 of file Scanner.h.

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

Definition at line 116 of file Scanner.h.

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

Definition at line 173 of file Scanner.h.

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

Definition at line 174 of file Scanner.h.

const cling::Interpreter& RScanner::fInterpreter
private

Definition at line 172 of file Scanner.h.

clang::Decl* RScanner::fLastDecl
private

Definition at line 176 of file Scanner.h.

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

Definition at line 182 of file Scanner.h.

DeclCallback RScanner::fRecordDeclCallback
private

Definition at line 177 of file Scanner.h.

EScanType RScanner::fScanType
private

Definition at line 185 of file Scanner.h.

ClassColl_t RScanner::fSelectedClasses

Definition at line 118 of file Scanner.h.

EnumColl_t RScanner::fSelectedEnums

Definition at line 126 of file Scanner.h.

FunctionColl_t RScanner::fSelectedFunctions

Definition at line 124 of file Scanner.h.

NamespaceColl_t RScanner::fSelectedNamespaces

Definition at line 122 of file Scanner.h.

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

Definition at line 184 of file Scanner.h.

TypedefColl_t RScanner::fSelectedTypedefs

Definition at line 123 of file Scanner.h.

VariableColl_t RScanner::fSelectedVariables

Definition at line 125 of file Scanner.h.

SelectionRules& RScanner::fSelectionRules
private

Definition at line 183 of file Scanner.h.

const clang::SourceManager* RScanner::fSourceManager
private

Definition at line 171 of file Scanner.h.

bool RScanner::fTypeTable[fgTypeLast+1]
private

Definition at line 178 of file Scanner.h.

unsigned int RScanner::fVerboseLevel
private

Definition at line 153 of file Scanner.h.


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