Advertisement
Test_Runner

branching splits

Apr 14th, 2015
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. Branching logic:
  2.  
  3. getSplits:
  4. list[]
  5.  
  6. for pointer in splits:
  7. if pointer had a condjump/altbranch in branches:
  8. continue until pointer is of condjump/altbranch
  9.  
  10. if branch of pointer is in branches:
  11. add pointer to list
  12.  
  13. return list
  14.  
  15. on init:
  16. branches = [A]
  17. list = getSplits()
  18. curSplit = 0
  19. prevalt = null
  20.  
  21. on nextsplit:
  22. skip to list[++cursplit]
  23. prevalt = null
  24.  
  25. on switch branch:
  26. if split had a altbranch:
  27. prevalt = split
  28. add altbranch to branches
  29. list = getSplits()
  30. skip to list[curSplit]
  31.  
  32. else if prevalt != null:
  33. remove branch of prevalt from branches
  34. prevalt = null
  35. list = getSplits()
  36. undosplit to list[curSplit]
  37.  
  38. on display:
  39. display list
  40.  
  41.  
  42.  
  43.  
  44. alternate method:
  45.  
  46. on init:
  47. branches = [A]
  48. prevsplit = firstsplit
  49.  
  50. on nextsplit:
  51. prevsplit = split
  52.  
  53. if split has a condjump and branchcond is in branches:
  54. skip to the next split of branchcond
  55. else
  56. skip to next split of any in branches
  57.  
  58. on switch branch:
  59. if split had a altbranch:
  60. prevsplit = split
  61. skip to next split of branchcond
  62. add altbranch to branches
  63. else if prevsplit had a altbranch and split is of altbranch:
  64. undosplit to prevsplit
  65. remove altbranch from branches
  66.  
  67. on display:
  68. list[]
  69.  
  70. for pointer in splits:
  71. if pointer had a condjump/altbranch in branches:
  72. continue until pointer is of condjump/altbranch
  73.  
  74. if pointer.branch is in branches:
  75. add pointer to list
  76.  
  77. display list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement