ICG 2
Electric Boogaloo
ASTInfo.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <map>
4 #include <vector>
5 #include <unordered_set>
6 
9 
10 // Just bundle together all the other things
11 
12 class ASTInfo {
13  public:
14  // default constructors
15 
21  void combine (const ASTInfo& other);
22 
28  void add_class_info(ClassInfo * class_info);
29 
35  void add_stl_decl(std::string stl_name);
36 
42  void add_stl_decl(std::unordered_set<std::string> stl_names);
43 
50  void add_typedef (std::string existing_name, std::string alias_name);
51 
58 
64  std::string toString() const;
65 
66  private:
68 
69  // In this one it's important that we don't define the same one twice, so keep it as a set until we're ready for output
70  std::unordered_set<std::string> stl_decls;
71 
72  static const std::string classes_key;
73  static const std::string stl_key;
74  static const std::string typedef_key;
75 };
Definition: ASTInfo.hpp:12
void add_stl_decl(std::string stl_name)
Add an STL declaration.
Definition: ASTInfo.cpp:70
std::string toString() const
toString
Definition: ASTInfo.cpp:16
void combine(const ASTInfo &other)
Pull info from another ASTInfo object into self.
Definition: ASTInfo.cpp:47
ICGTemplateEngine::ListTokenItems getItems()
Get the representation of this AST that is compatable with the ICGTemplateEngine.
Definition: ASTInfo.cpp:82
void add_class_info(ClassInfo *class_info)
Add a ClassInfo object.
Definition: ASTInfo.cpp:65
void add_typedef(std::string existing_name, std::string alias_name)
Register a typedef.
Definition: ASTInfo.cpp:78
Hold information about a class declaration.
Definition: ClassInfo.hpp:15
std::map< std::string, std::vector< const recursable * > > ListTokenItems
Lists that we can recurse into.
Definition: ICGTemplateEngine.hpp:23