aboutsummaryrefslogtreecommitdiffstats
path: root/c_compiler/include/node.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'c_compiler/include/node.hpp')
-rw-r--r--c_compiler/include/node.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/c_compiler/include/node.hpp b/c_compiler/include/node.hpp
new file mode 100644
index 0000000..584ed32
--- /dev/null
+++ b/c_compiler/include/node.hpp
@@ -0,0 +1,30 @@
+#ifndef NODE_HPP
+#define NODE_HPP
+
+#include <cstdint>
+#include <map>
+#include <string>
+
+struct VarLocation;
+class Type;
+
+typedef std::map<std::string, VarLocation> VariableStackBindings;
+
+
+struct VarLocation {
+ Type* type;
+ int32_t stack_position;
+};
+
+
+class Node {
+public:
+ virtual ~Node() {}
+
+ virtual void print() const = 0;
+ virtual void printxml() const = 0;
+ virtual VariableStackBindings printasm(VariableStackBindings bindings) const = 0;
+};
+
+
+#endif