From c4ea37db0a9dd19b27d8febee1f901b1a9b74d39 Mon Sep 17 00:00:00 2001 From: Valk Richard Li <48872266+ValKmjolnir@users.noreply.github.com> Date: Thu, 26 Sep 2019 19:56:32 +0800 Subject: [PATCH] Delete nasal_func_stack.h --- version0.2/nasal_func_stack.h | 115 ---------------------------------- 1 file changed, 115 deletions(-) delete mode 100644 version0.2/nasal_func_stack.h diff --git a/version0.2/nasal_func_stack.h b/version0.2/nasal_func_stack.h deleted file mode 100644 index ee11dfe..0000000 --- a/version0.2/nasal_func_stack.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef __NASAL_FUNC_STACK_H__ -#define __NASAL_FUNC_STACK_H__ - -#include "nasal_functional.h" - - -struct func_stack_unit -{ - std::string func_name; - func func_statement; - func_stack_unit *next; -}; - -class func_stack -{ - private: - func_stack_unit *head; - public: - func_stack() - { - head=new func_stack_unit; - head->func_name="null"; - head->next=NULL; - } - ~func_stack() - { - func_stack_unit *temp=head; - func_stack_unit *this_node=NULL; - while(temp->next) - { - this_node=temp; - temp=temp->next; - delete this_node; - } - delete temp; - } - void append_function(std::string &function_name,func &temp_func) - { - func_stack_unit *temp=head; - while(temp->next) - { - temp=temp->next; - if(temp->func_name==function_name) - { - std::cout<<"[Error] Redeclaration of function \""<next=new func_stack_unit; - temp=temp->next; - temp->next=NULL; - temp->func_name=function_name; - temp->func_statement=temp_func; - return; - } -// void run_function(std::string &function_name) -// { -// func_stack_unit *temp=head; -// while(temp->next) -// { -// temp=temp->next; -// if(temp->func_name==function_name) -// { -// temp->func_statement.run(); -// return; -// } -// } -// std::cout<<"[Error] Could not find this function."<next) - { - temp=temp->next; - std::cout<<"function: "<func_name; - temp->func_statement.print_info(); - } - return; - } - void pop_function() - { - func_stack_unit *temp=head; - func_stack_unit *end_temp; - if(!head->next) - return; - while(temp->next) - { - end_temp=temp; - temp=temp->next; - } - end_temp->next=NULL; - delete temp; - } - void delete_all() - { - func_stack_unit *temp=head->next; - func_stack_unit *this_node=NULL; - head->next=NULL; - if(!temp) - return; - while(temp->next) - { - this_node=temp; - temp=temp->next; - delete this_node; - } - delete temp; - return; - } -}; -func_stack nasal_func_stack; - -#endif