aboutsummaryrefslogtreecommitdiff
path: root/source/20-codegen-compiler/CodegenModel.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/20-codegen-compiler/CodegenModel.hpp')
-rw-r--r--source/20-codegen-compiler/CodegenModel.hpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/source/20-codegen-compiler/CodegenModel.hpp b/source/20-codegen-compiler/CodegenModel.hpp
new file mode 100644
index 0000000..31ca04f
--- /dev/null
+++ b/source/20-codegen-compiler/CodegenModel.hpp
@@ -0,0 +1,35 @@
+#pragma once
+
+#include "CodegenConfig.hpp"
+#include "CodegenDecl.hpp"
+#include "CodegenUtils.hpp"
+
+#include <cinttypes>
+#include <string>
+#include <string_view>
+
+using namespace std::literals;
+
+class CodegenModel {
+private:
+ class Private;
+ Private* m;
+
+public:
+ CodegenModel();
+ ~CodegenModel();
+
+ // Implementation detail helper, don't use outside
+ Private& GetPimpl() const { return *m; }
+
+ DeclEnum* AddEnum(std::string fullname, DeclEnum decl);
+ DeclStruct* AddStruct(std::string fullname, DeclStruct decl);
+
+ const DeclEnum* FindEnum(std::string_view name) const;
+ const DeclStruct* FindStruct(std::string_view name) const;
+
+ DeclNamespace* AddNamespace(DeclNamespace ns);
+
+ const DeclNamespace* FindNamespace(std::string_view fullname) const;
+ DeclNamespace* FindNamespace(std::string_view name);
+};