Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Cleaner (Tree_node * Top_node)
- {
- cout <<"\n~~\n"<<Top_node -> Name_of_node << Top_node -> Down.size() << Top_node -> Work.size() <<Top_node -> IsAHum_<<"~~\n";
- for (int n = 0; n < (Top_node -> Down.size()); ++n)
- {
- Cleaner (Top_node -> Down[n]);
- }
- delete Top_node;
- cout << "*********\n";
- }
- Tree_node * Construction_tree(string Node, ifstream &file)
- {
- cout<<"soqa ";
- string Simbol_;
- Tree_node *Top_node = new Tree_node;
- Top_node->Name_of_node = Node;
- Top_node->IsAHum_ = 0;
- getline (file, Simbol_);
- if (Simbol_ == "{")
- {
- getline (file, Simbol_);
- while (Simbol_ != "}" && file)
- {
- Top_node -> Down.insert(Top_node -> Down.end(), Construction_tree(Simbol_, file));
- getline (file, Simbol_);
- }
- }
- else if (Simbol_ == "[")
- {
- getline (file, Simbol_);
- string Name_of_work;
- Name_of_work = Simbol_.substr(0,Simbol_.find("~"));
- Simbol_ = Simbol_.substr(Simbol_.find("~")+1);
- Top_node->Work[Name_of_work] = Simbol_;
- Top_node->IsAHum_ = 1;
- }
- return Top_node;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement