diff options
Diffstat (limited to 'c_compiler/src/declaration.cpp')
-rw-r--r-- | c_compiler/src/declaration.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/c_compiler/src/declaration.cpp b/c_compiler/src/declaration.cpp index 5341b5b..2fba9f9 100644 --- a/c_compiler/src/declaration.cpp +++ b/c_compiler/src/declaration.cpp @@ -4,7 +4,8 @@ // Declaration definition Declaration::Declaration(const std::string& _id) - : id(_id) {} + : id(_id) +{} void Declaration::print() const { @@ -20,15 +21,16 @@ void Declaration::printxml() const if(next_decl != nullptr) next_decl->printxml(); - if(decl_list != nullptr) { - decl_list->printxml(); + if(list_next_decl != nullptr) { + list_next_decl->printxml(); } if(id != "") std::cout << "<Variable id=\""<< id << "\" />" << std::endl; } -void Declaration::printasm() const {} +void Declaration::printasm() const +{} void Declaration::addDeclaration(Declaration* _next_decl) { @@ -37,7 +39,7 @@ void Declaration::addDeclaration(Declaration* _next_decl) void Declaration::addList(Declaration* _next_decl) { - decl_list = _next_decl; + list_next_decl = _next_decl; } Declaration* Declaration::getNext() const @@ -45,6 +47,11 @@ Declaration* Declaration::getNext() const return next_decl; } +Declaration* Declaration::getNextListItem() const +{ + return list_next_decl; +} + std::string Declaration::getId() const { return id; |