Advertisement
objeckive

Untitled

Apr 23rd, 2021
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. --- Input ---
  2. "(let ((x (+ 19 6)) (y 11)) (write (- x y)))"
  3.  
  4. --- Tokens ---
  5. 0: '('
  6. 1: 'let'
  7. 2: '('
  8. 3: '('
  9. 4: 'x'
  10. 5: '('
  11. 6: '+'
  12. 7: '19'
  13. 8: '6'
  14. 9: ')'
  15. 10: ')'
  16. 11: '('
  17. 12: 'y'
  18. 13: '11'
  19. 14: ')'
  20. 15: ')'
  21. 16: '('
  22. 17: 'write'
  23. 18: '('
  24. 19: '-'
  25. 20: 'x'
  26. 21: 'y'
  27. 22: ')'
  28. 23: ')'
  29. 24: ')'
  30.  
  31. --- Expressions ---
  32. Expression: pos=(0,25); depth=0
  33. Let
  34. Expression: pos=(3,25); depth=1
  35. Str_Lit; value=x
  36. Expression: pos=(5,25); depth=2
  37. [+,-,*,/]
  38. Expression: pos=(7,25); depth=3
  39. Int_Lit; value=19
  40. Expression: pos=(8,25); depth=3
  41. Int_Lit; value=6
  42. Expression: pos=(9,25); depth=3
  43. Expression: pos=(10,25); depth=2
  44. Expression: pos=(11,25); depth=1
  45. Str_Lit; value=y
  46. Expression: pos=(13,25); depth=2
  47. Int_Lit; value=11
  48. Expression: pos=(14,25); depth=2
  49. Expression: pos=(15,25); depth=1
  50. Expression: pos=(16,25); depth=0
  51. Write
  52. Expression: pos=(18,25); depth=1
  53. [+,-,*,/]
  54. Expression: pos=(20,25); depth=2
  55. Str_Lit; value=x
  56. Expression: pos=(21,25); depth=2
  57. Str_Lit; value=y
  58. Expression: pos=(22,25); depth=2
  59. Expression: pos=(23,25); depth=1
  60.  
  61. --- Tree ---
  62. [let
  63. [let_dec 'x'
  64. [+
  65. [19]
  66. [6]]]
  67. [let_dec 'y'
  68. [11]]
  69. [write
  70. [-
  71. [x]
  72. [y]]]]
  73.  
  74. --- Evaluate ---
  75. 14
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement