ROSE 0.11.145.321
SymbolScanner.h
1#ifndef ROSE_SourceCode_CodeGen_SymbolScanner_H
2#define ROSE_SourceCode_CodeGen_SymbolScanner_H
3
4#include <Rose/SourceCode/CodeGen/Object.h>
5
6#include <vector>
7#include <map>
8#include <string>
9
10namespace Rose { namespace SourceCode { namespace CodeGen {
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>> {
23 API & api;
24
25 SymbolScanner(API & api_) : api(api_) {}
26
27 template <typename SymT>
28 void visit(SymT * sym, std::map<std::string, SymT * API::* > const & objmap);
29};
30
31
32template <>
33struct SymbolScanner<void> : public SymbolScannerBase<SymbolScanner<void>> {
34 struct api_t {
35 std::map<std::string, std::set<SgNamespaceSymbol *> > namespaces;
36 std::map<std::string, std::set<SgClassSymbol *> > classes;
37 std::map<std::string, std::set<SgTypedefSymbol *> > typedefs;
38 std::map<std::string, std::set<SgVariableSymbol *> > variables;
39 std::map<std::string, std::set<SgFunctionSymbol *> > functions;
40 } api;
41
43
44 template <typename SymT>
45 void visit(SymT * sym, std::map<std::string, std::set<SymT *> > & objmap);
46};
47
48} } }
49
50#include "Rose/SourceCode/CodeGen/SymbolScanner.txx"
51
52#endif /* ROSE_SourceCode_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.