sobinist

Untitled

Jul 13th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. Example:
  2.  
  3. If(1)
  4. Dot(12)
  5. PersoRef: fix|0x00010C84 ([World] GlobalActorModel | global)
  6. DsgVarRef: 38
  7. Then(8)
  8. If(0)
  9. fn_p_stBooleanCondition(1)
  10. fn_p_stBooleanCondition(1)
  11. Dot(12)
  12. PersoRef: fix|0x00010C84 ([World] GlobalActorModel | global)
  13. DsgVarRef: 32
  14. Dot(12)
  15. PersoRef: fix|0x00010C84 ([World] GlobalActorModel | global)
  16. DsgVarRef: 33
  17. fn_p_stBooleanCondition(1)
  18. Dot(12)
  19. PersoRef: fix|0x00010C84 ([World] GlobalActorModel | global)
  20. DsgVarRef: 34
  21. Dot(12)
  22. PersoRef: fix|0x00010C84 ([World] GlobalActorModel | global)
  23. DsgVarRef: 35
  24.  
  25.  
  26.  
  27. create rootnode
  28.  
  29. parentStack = new List
  30. parentStack.push(rootnode);
  31.  
  32. var lastline = null;
  33.  
  34. foreach(line) {
  35.  
  36. create node for line
  37.  
  38. node.parent = parentStack.top();
  39.  
  40. if (lastLine) {
  41. if (line.indent > lastLine.indent) {
  42. parentStack.push(node);
  43. }
  44. if (line.indent < lastLine.indent) {
  45. indentDiff = lastLine.indent - line.indent
  46. repeat (indentDiff) {
  47. parentStack.pop();
  48. }
  49. }
  50. } else { // first line always
  51. parentStack.push(node);
  52. }
  53.  
  54. lastLine = line;
  55. }
  56.  
  57. A
  58. B
  59. C
  60. D
  61. E
Add Comment
Please, Sign In to add comment