Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #include "Tree.h"
  2. User::User(Tree_node * Top)
  3. {
  4. Start_source_tree = Top;
  5. Top_ = *Top;
  6. }
  7. void User::Select(Tree_node Top_node_source, string Rule)
  8. {
  9. if (Top_node_source.Name_of_node == Rule)
  10. {
  11. Buf_.Down.insert(Buf_.Down.end(), &Top_node_source);
  12. }
  13. else
  14. {
  15. for (int n =0; n < Top_node_source.Down.size(); ++n)
  16. {
  17. Select(*Top_node_source.Down[n], Rule);
  18. }
  19. }
  20.  
  21.  
  22. }
  23. void User::Print(Tree_node Tree_node_source, vector<string> Rule_print)
  24. {
  25. if(Tree_node_source.IsAHum_ == 1)
  26. {
  27.  
  28. }
  29. for(int n = 0; n < Tree_node_source.Down.size(); n++)
  30. {
  31. Print(*Tree_node_source.Down[n], Rule_print);
  32. }
  33. }
  34. int User::Parse (string Inp_str)
  35. {
  36. Buf_ = Empty;
  37. Select(Top_, "pravilo");
  38. vector<string> sooqa;
  39. sooqa.insert(sooqa.end(), "sooqa");
  40. Print (Top_, sooqa);
  41. Top_ = Buf_;
  42. return 1;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement