Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. void Cleaner (Tree_node * Top_node)
  2. {
  3. cout <<"\n~~\n"<<Top_node -> Name_of_node << Top_node -> Down.size() << Top_node -> Work.size() <<Top_node -> IsAHum_<<"~~\n";
  4. for (int n = 0; n < (Top_node -> Down.size()); ++n)
  5. {
  6. Cleaner (Top_node -> Down[n]);
  7. }
  8. delete Top_node;
  9. cout << "*********\n";
  10. }
  11. Tree_node * Construction_tree(string Node, ifstream &file)
  12. {
  13. cout<<"soqa ";
  14. string Simbol_;
  15. Tree_node *Top_node = new Tree_node;
  16. Top_node->Name_of_node = Node;
  17. Top_node->IsAHum_ = 0;
  18. getline (file, Simbol_);
  19. if (Simbol_ == "{")
  20. {
  21. getline (file, Simbol_);
  22. while (Simbol_ != "}" && file)
  23. {
  24. Top_node -> Down.insert(Top_node -> Down.end(), Construction_tree(Simbol_, file));
  25. getline (file, Simbol_);
  26. }
  27. }
  28. else if (Simbol_ == "[")
  29. {
  30. getline (file, Simbol_);
  31. string Name_of_work;
  32. Name_of_work = Simbol_.substr(0,Simbol_.find("~"));
  33. Simbol_ = Simbol_.substr(Simbol_.find("~")+1);
  34. Top_node->Work[Name_of_work] = Simbol_;
  35. Top_node->IsAHum_ = 1;
  36. }
  37. return Top_node;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement