Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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;
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 = nullptr);
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
Option_t Option_t option
char name[80]
Definition TGX11.cxx:110
const char * proto
Definition civetweb.c:17535
bool ProcessOperators(std::string &pattern)
bool LoadIncludes(std::string &extraInclude)
SelectionRules * fSelectionRules
bool ProcessFunctionPrototype(std::string &proto, bool &name)
static std::map< std::string, ECppNames > fgMapCppNames
cling::Interpreter & fInterp
bool IsPatternRule(const std::string &rule_token)
bool AddInclude(const std::string &include)
std::string fIncludes
bool Parse(SelectionRules &sr, llvm::StringRef code, const std::vector< std::string > &parserArgs, const char *llvmdir)
static std::map< std::string, EPragmaNames > fgMapPragmaNames
static void PopulatePragmaMap()
static void PopulateCppMap()
bool AddRule(const std::string &ruletype, const std::string &identifier, bool linkOn, bool requestOnlyTClass, Options *option=nullptr)
ROOT::TMetaUtils::RConstructorTypes * fIOConstructorTypesPtr
The class representing the collection of selection rules.
std::list< RConstructorType > RConstructorTypes