ROSE 2.20.0
Loading...
Searching...
No Matches
SymbolScanner.h
1#ifndef ROSE_Source_Generation_SymbolScanner_H
2#define ROSE_Source_Generation_SymbolScanner_H
3
4#include <Rose/Source/Generation/Object.h>
5
6#include <vector>
7#include <map>
8#include <string>
9
10namespace Rose { namespace Source { namespace Generation {
11
12template <typename CRT>
14
15 constexpr inline CRT * crt() { return static_cast<CRT*>(this); }
16 constexpr inline CRT const * crt() const { return static_cast<CRT const *>(this); }
17
18 void visit(SgNode * node);
19};
20
21template <typename API>
22struct SymbolScanner : public SymbolScannerBase<SymbolScanner<API>> {
24 API & api;
25
26 SymbolScanner(API & api_) : api(api_) {}
27
28 template <typename SymT>
29 void visit(SymT * sym, std::map<std::string, SymT * API::* > const & objmap);
30};
31
32
33template <>
34struct SymbolScanner<void> : public SymbolScannerBase<SymbolScanner<void>> {
36 struct api_t {
37 std::map<std::string, std::set<SgNamespaceSymbol *> > namespaces;
38 std::map<std::string, std::set<SgClassSymbol *> > classes;
39 std::map<std::string, std::set<SgTypedefSymbol *> > typedefs;
40 std::map<std::string, std::set<SgVariableSymbol *> > variables;
41 std::map<std::string, std::set<SgFunctionSymbol *> > functions;
42 } api;
43
45
46 template <typename SymT>
47 void visit(SymT * sym, std::map<std::string, std::set<SymT *> > & objmap);
48};
49
50} } }
51
52#include "Rose/Source/Generation/SymbolScanner.txx"
53
54#endif /* ROSE_Source_Generation_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.