diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-03-03 22:19:32 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-03-03 22:19:32 +0000 |
commit | 46c70f9c2dca832ba84472dbbe09064b57710b45 (patch) | |
tree | d5c0ac0f1bc53a7f26b760b8ab63f1fc163a378b /c_compiler/include/declaration.hpp | |
parent | ee069912377bf8f5069489e527af642953d5883d (diff) | |
download | Compiler-46c70f9c2dca832ba84472dbbe09064b57710b45.tar.gz Compiler-46c70f9c2dca832ba84472dbbe09064b57710b45.zip |
Kind of working
Diffstat (limited to 'c_compiler/include/declaration.hpp')
-rw-r--r-- | c_compiler/include/declaration.hpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/c_compiler/include/declaration.hpp b/c_compiler/include/declaration.hpp index 7fdee1c..82bf157 100644 --- a/c_compiler/include/declaration.hpp +++ b/c_compiler/include/declaration.hpp @@ -13,15 +13,19 @@ protected: Declaration* decl; public: - Declaration(const Type* _type = nullptr, - const std::string _id = "", - const Initializer* _init = nullptr); + Declaration(const std::string& _id = "") : id(_id) {} - virtual void print() const; - virtual void printxml() const; - virtual void printasm() const; + virtual void print() const { + std::cout << id << std::endl; + if(decl != nullptr) + decl->print(); + } + virtual void printxml() const {} + virtual void printasm() const {} - + void addDeclaration(Declaration* _decl) { + decl = _decl; + } }; #endif |