ICG 2
Electric Boogaloo
ASTFilter.hpp
Go to the documentation of this file.
1 #include <regex>
2 #include <iostream>
3 #include <set>
4 #include <algorithm>
5 #include <iostream>
6 #include <fstream>
7 #include <string>
8 
9 #include <nlohmann/json.hpp>
10 
12 
13 namespace ASTFilter {
14 
19  class SourceManager {
20  public:
26  SourceManager(std::string file);
27 
35  bool isSystem(std::string file);
36 
41  void print();
42 
43  private:
44 
50  void init (std::string file);
51 
52  std::set<std::string> system_includes;
53  };
54 
55  json generateFullAST (std::string file);
56  json generateFilteredAST (std::string file);
57 
58  void filter_ast(json& full_ast, SourceManager& source_manager);
59 }
60 
nlohmann::json json
Definition: ASTFilter.hpp:11
Keep track of what is a system header by pulling system include directories from clang -### <file
Definition: ASTFilter.hpp:19
SourceManager(std::string file)
Construct a new Source Manager object.
Definition: ASTFilter.cpp:4
bool isSystem(std::string file)
Determine whether a given full file path is a system header or not.
Definition: ASTFilter.cpp:8
void print()
Print out the system header directories.
Definition: ASTFilter.cpp:20
Definition: ASTFilter.hpp:13
void filter_ast(json &full_ast, SourceManager &source_manager)
Definition: ASTFilter.cpp:89
json generateFilteredAST(std::string file)
Definition: ASTFilter.cpp:58
json generateFullAST(std::string file)
Definition: ASTFilter.cpp:66