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.hpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/c_compiler/include/node.hpp b/c_compiler/include/node.hpp
index 940a948..584ed32 100644
--- a/c_compiler/include/node.hpp
+++ b/c_compiler/include/node.hpp
@@ -1,7 +1,20 @@
-#ifndef AST_BASE_HPP
-#define AST_BASE_HPP
+#ifndef NODE_HPP
+#define NODE_HPP
-#include "ast.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 {
@@ -10,7 +23,7 @@ public:
virtual void print() const = 0;
virtual void printxml() const = 0;
- virtual void printasm() const = 0;
+ virtual VariableStackBindings printasm(VariableStackBindings bindings) const = 0;
};