aboutsummaryrefslogtreecommitdiffstats
path: root/c_compiler/include/translation_unit.hpp
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-03-03 22:19:32 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-03-03 22:19:32 +0000
commit46c70f9c2dca832ba84472dbbe09064b57710b45 (patch)
treed5c0ac0f1bc53a7f26b760b8ab63f1fc163a378b /c_compiler/include/translation_unit.hpp
parentee069912377bf8f5069489e527af642953d5883d (diff)
downloadCompiler-46c70f9c2dca832ba84472dbbe09064b57710b45.tar.gz
Compiler-46c70f9c2dca832ba84472dbbe09064b57710b45.zip
Kind of working
Diffstat (limited to 'c_compiler/include/translation_unit.hpp')
-rw-r--r--c_compiler/include/translation_unit.hpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/c_compiler/include/translation_unit.hpp b/c_compiler/include/translation_unit.hpp
index 6601994..dd8ff03 100644
--- a/c_compiler/include/translation_unit.hpp
+++ b/c_compiler/include/translation_unit.hpp
@@ -6,9 +6,23 @@
class TranslationUnit : public Node {
protected:
- // TODO includes all the variable declarations and function definitions
+ std::vector<Node* > m_transUnit;
public:
- TranslationUnit() {}
+ TranslationUnit(Node* decl) {
+ m_transUnit.push_back(decl);
+ }
+
+ virtual void print() const {
+ for(auto& i : m_transUnit) {
+ i->print();
+ }
+ }
+ virtual void printxml() const {}
+ virtual void printasm() const {}
+
+ void push(Node* decl) {
+ m_transUnit.push_back(decl);
+ }
};