aboutsummaryrefslogtreecommitdiffstats
path: root/c_compiler/include/expression.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'c_compiler/include/expression.hpp')
-rw-r--r--c_compiler/include/expression.hpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/c_compiler/include/expression.hpp b/c_compiler/include/expression.hpp
new file mode 100644
index 0000000..d446972
--- /dev/null
+++ b/c_compiler/include/expression.hpp
@@ -0,0 +1,35 @@
+#ifndef AST_EXPRESSION_HPP
+#define AST_EXPRESSION_HPP
+
+#include "node.hpp"
+
+
+class Expression : public Node {
+public:
+ virtual void print() const;
+ virtual void printxml() const;
+ virtual VariableStackBindings printasm(VariableStackBindings bindings) const = 0;
+};
+
+
+class Identifier : public Expression {
+private:
+ std::string m_id;
+public:
+ Identifier(const std::string& id);
+
+ virtual VariableStackBindings printasm(VariableStackBindings bindings) const;
+};
+
+
+class Constant : public Expression {
+private:
+ int32_t m_constant;
+public:
+ Constant(const int32_t& constant);
+
+ virtual VariableStackBindings printasm(VariableStackBindings bindings) const;
+};
+
+
+#endif