ROSE 0.11.145.247
SymbolScanner.h
1#ifndef ROSE_CodeGen_SymbolScanner_H
2#define ROSE_CodeGen_SymbolScanner_H
3
4#include <Rose/CodeGen/Object.h>
5
6#include <vector>
7#include <map>
8#include <string>
9
10namespace Rose { namespace CodeGen {
11
12#define DEBUG_Rose_CodeGen_SymbolScanner_void 0
13
14template <typename CRT>
16
17 constexpr inline CRT * crt() { return static_cast<CRT*>(this); }
18 constexpr inline CRT const * crt() const { return static_cast<CRT const *>(this); }
19
20 void visit(SgNode * node);
21};
22
23template <typename API>
24struct SymbolScanner : public SymbolScannerBase<SymbolScanner<API>> {
25 API & api;
26
27 SymbolScanner(API & api_) : api(api_) {}
28
29 template <typename SymT>
30 void visit(SymT * sym, std::map<std::string, SymT * API::* > const & objmap);
31};
32
33#define DEBUG_Rose_CodeGen_SymbolScanner_void 0
34
35template <>
36struct SymbolScanner<void> : public SymbolScannerBase<SymbolScanner<void>> {
37 struct api_t {
38 std::map<std::string, std::set<SgNamespaceSymbol *> > namespaces;
39 std::map<std::string, std::set<SgClassSymbol *> > classes;
40 std::map<std::string, std::set<SgTypedefSymbol *> > typedefs;
41 std::map<std::string, std::set<SgVariableSymbol *> > variables;
42 std::map<std::string, std::set<SgFunctionSymbol *> > functions;
43 } api;
44
46
47 template <typename SymT>
48 void visit(SymT * sym, std::map<std::string, std::set<SymT *> > & objmap);
49};
50
51} }
52
53#include "Rose/CodeGen/SymbolScanner.txx"
54
55#endif /* ROSE_CodeGen_SymbolScanner_H */
permits to gather types and symbols to extract an API from a set of headers.
Definition API.h:17
This class represents the base class for all IR nodes within Sage III.
The ROSE library.