From 8ad89fc5eac6c4f851b1b44bda7f2be47f5c660b Mon Sep 17 00:00:00 2001 From: Valk Richard Li <48872266+ValKmjolnir@users.noreply.github.com> Date: Wed, 25 Sep 2019 20:40:59 +0800 Subject: [PATCH] Delete nasal_func.h --- version0.1/nasal_func.h | 156 ---------------------------------------- 1 file changed, 156 deletions(-) delete mode 100644 version0.1/nasal_func.h diff --git a/version0.1/nasal_func.h b/version0.1/nasal_func.h deleted file mode 100644 index f4d00a0..0000000 --- a/version0.1/nasal_func.h +++ /dev/null @@ -1,156 +0,0 @@ -#ifndef __NASAL_FUNC_H__ -#define __NASAL_FUNC_H__ - -#include -#include - -namespace nasal -{ - -struct func_unit -{ - std::string type; - std::string content; - int line; - func_unit *next; -}; - -class func -{ - private: - func_unit *head; - public: - func() - { - head=new func_unit; - head->type="Begin"; - head->content="__process_begin"; - head->line=0; - head->next=NULL; - } - ~func() - { - func_unit *temp=head; - func_unit *this_node=NULL; - while(temp->next) - { - this_node=temp; - temp=temp->next; - delete this_node; - } - delete temp; - } - void delete_all() - { - if(!head->next) - return; - func_unit *temp=head; - func_unit *this_node=NULL; - temp=temp->next; - head->next=NULL; - while(temp->next) - { - this_node=temp; - temp=temp->next; - delete this_node; - } - delete temp; - return; - } - void append(const char *_type,std::string &_content,const int _line) - { - func_unit *temp=head; - while(temp->next) - temp=temp->next; - temp->next=new func_unit; - temp=temp->next; - temp->next=NULL; - temp->type=_type; - temp->line=_line; - temp->content=_content; - return; - } - void print() - { - func_unit *temp=head; - std::cout<<"line "<line<<": "<<"( ProcessBegin | "<content<<" )"<next) - return; - while(temp->next) - { - temp=temp->next; - std::cout<<"line "<line<<": "; - if(temp->type=="Operator") - std::cout<<"( Operator | "; - else if(temp->type=="Identifier") - std::cout<<"( Identifier | "; - else if(temp->type=="Number") - std::cout<<"( Number | "; - else if(temp->type=="ReserveWord") - std::cout<<"( ReserveWord | "; - else if(temp->type=="String") - std::cout<<"( String | "; - std::cout<content<<" )"<next) - { - ptemp=ptemp->next; - temp=new func_unit; - temp->type=ptemp->type; - temp->content=ptemp->content; - temp->line=ptemp->line; - temp->next=NULL; - } - temp=new func_unit; - temp->type=ptemp->type; - temp->content=ptemp->content; - temp->line=ptemp->line; - temp->next=NULL; - return *this; - } - void run() - { - func_unit *temp=head; - if(!head->next) - { - std::cout<<"Running complete."<next) - { - temp=temp->next; - if(temp->type=="Operator") - { - ; - } - else if(temp->type=="Identifier") - { - ; - } - else if(temp->type=="Number") - { - ; - } - else if(temp->type=="ReserveWord") - { - ; - } - else if(temp->type=="String") - { - ; - } - } - return; - } -}; - -} - -#endif