Logo ROOT  
Reference Guide
LinkdefReader.h
Go to the documentation of this file.
1// @(#)root/core/utils:$Id: LinkdefReader.h 28529 2009-05-11 16:43:35Z pcanal $
2// Author: Velislava Spasova September 2010
3
4/*************************************************************************
5 * Copyright (C) 1995-2011, Rene Brun, Fons Rademakers and al. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef R__LINKDEFREADER_H
13#define R__LINKDEFREADER_H
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// LinkdefReader //
18// //
19// Linkdef.h parsing class //
20// //
21//////////////////////////////////////////////////////////////////////////
22
23#include <fstream>
24#include <vector>
25#include <string>
26#include <map>
27#include "llvm/ADT/StringRef.h"
28
29#include "TClingUtils.h"
30
31namespace cling {
32 class Interpreter;
33}
34
35class SelectionRules;
36class PragmaCreateCollector;
37class PragmaLinkCollector;
38class LinkdefReaderPragmaHandler;
39class PragmaExtraInclude;
40
42
43public:
44 LinkdefReader(cling::Interpreter &interp,
45 ROOT::TMetaUtils::RConstructorTypes &IOConstructorTypes);
46
47 bool LoadIncludes(std::string &extraInclude);
48 bool Parse(SelectionRules &sr, llvm::StringRef code, const std::vector<std::string> &parserArgs, const char *llvmdir);
49
50
51private:
52
54 friend class PragmaLinkCollector;
56 friend class PragmaExtraInclude;
57
58 long fLine; // lines count - for error messages
59 long fCount; // Number of rules created so far.
60 SelectionRules *fSelectionRules; // set of rules being filleed.
61 std::string fIncludes; // Extra set of file to be included by the intepreter.
62 ROOT::TMetaUtils::RConstructorTypes *fIOConstructorTypesPtr; // List of values of #pragma ioctortype
63 cling::Interpreter &fInterp; // Our interpreter
64
65 enum EPragmaNames { // the processed pragma attributes
81 };
82
83 enum ECppNames { // the processes pre-processor directives
90 };
91
92 // used to create string to tag kind association to use in switch constructions
93 static std::map<std::string, EPragmaNames> fgMapPragmaNames;
94 static std::map<std::string, ECppNames> fgMapCppNames;
95
96 static void PopulatePragmaMap();
97 static void PopulateCppMap();
98
99 struct Options;
100
101 bool AddInclude(const std::string& include);
102 bool AddRule(const std::string& ruletype,
103 const std::string& identifier,
104 bool linkOn,
105 bool requestOnlyTClass,
106 Options *option = 0);
107
108 bool ProcessFunctionPrototype(std::string &proto, bool &name); // transforms the function prototypes to a more unified form
109 bool ProcessOperators(std::string &pattern); // transforms the operators statement to the suitable function pattern
110
111 bool IsPatternRule(const std::string &rule_token); // is it name or pattern
112};
113
114#endif
115
char name[80]
Definition: TGX11.cxx:109
const char * proto
Definition: civetweb.c:16604
bool ProcessOperators(std::string &pattern)
bool LoadIncludes(std::string &extraInclude)
SelectionRules * fSelectionRules
Definition: LinkdefReader.h:60
friend class PragmaLinkCollector
Definition: LinkdefReader.h:54
LinkdefReader(cling::Interpreter &interp, ROOT::TMetaUtils::RConstructorTypes &IOConstructorTypes)
bool ProcessFunctionPrototype(std::string &proto, bool &name)
static std::map< std::string, ECppNames > fgMapCppNames
Definition: LinkdefReader.h:94
friend class LinkdefReaderPragmaHandler
Definition: LinkdefReader.h:55
cling::Interpreter & fInterp
Definition: LinkdefReader.h:63
bool IsPatternRule(const std::string &rule_token)
bool AddInclude(const std::string &include)
std::string fIncludes
Definition: LinkdefReader.h:61
friend class PragmaCreateCollector
Definition: LinkdefReader.h:53
bool Parse(SelectionRules &sr, llvm::StringRef code, const std::vector< std::string > &parserArgs, const char *llvmdir)
bool AddRule(const std::string &ruletype, const std::string &identifier, bool linkOn, bool requestOnlyTClass, Options *option=0)
friend class PragmaExtraInclude
Definition: LinkdefReader.h:56
static std::map< std::string, EPragmaNames > fgMapPragmaNames
Definition: LinkdefReader.h:93
static void PopulatePragmaMap()
static void PopulateCppMap()
ROOT::TMetaUtils::RConstructorTypes * fIOConstructorTypesPtr
Definition: LinkdefReader.h:62
The class representing the collection of selection rules.
static const std::string pattern("pattern")
std::list< RConstructorType > RConstructorTypes
Definition: TClingUtils.h:318
static constexpr double sr