diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-03-07 16:15:51 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-03-07 16:15:51 +0000 |
commit | fed691abddc2b242a6bcb81d87e18797b95bbe80 (patch) | |
tree | 28cb4c0ea9facfa7cc8642c778708f4e038c2aef /c_compiler/include/expression.hpp | |
parent | 15789d04e85806745c4c2e1cb3fdc891c34ab21f (diff) | |
download | Compiler-fed691abddc2b242a6bcb81d87e18797b95bbe80.tar.gz Compiler-fed691abddc2b242a6bcb81d87e18797b95bbe80.zip |
Can compile simplest program
Diffstat (limited to 'c_compiler/include/expression.hpp')
-rw-r--r-- | c_compiler/include/expression.hpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/c_compiler/include/expression.hpp b/c_compiler/include/expression.hpp index 9e57fd4..71d993f 100644 --- a/c_compiler/include/expression.hpp +++ b/c_compiler/include/expression.hpp @@ -5,11 +5,31 @@ class Expression : public Node { public: - Expression(const Node* expr = nullptr); - + virtual void printasm() const = 0; + virtual void print() const; virtual void printxml() const; +}; + + +class Identifier : public Expression { +private: + std::string m_id; +public: + Identifier(const std::string& id); + virtual void printasm() const; }; + +class Constant : public Expression { +private: + int32_t m_constant; +public: + Constant(const int32_t& constant); + + virtual void printasm() const; +}; + + #endif |