Advertisement
Guest User

Untitled

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