Advertisement
objeckive

Untitled

Aug 15th, 2022 (edited)
438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | Source Code | 0 0
  1. --- Input ---
  2. "(a 13)(defun a(b) (let ((c 8)) (write (* 2 (+ c b)))))"
  3.  
  4. --- Tokens ---
  5. 0: (
  6. 1: string='a'
  7. 2: int=13
  8. 3: )
  9. 4: (
  10. 5: defun
  11. 6: string='a'
  12. 7: (
  13. 8: string='b'
  14. 9: )
  15. 10: (
  16. 11: let
  17. 12: (
  18. 13: (
  19. 14: string='c'
  20. 15: int=8
  21. 16: )
  22. 17: )
  23. 18: (
  24. 19: write
  25. 20: (
  26. 21: *
  27. 22: int=2
  28. 23: (
  29. 24: +
  30. 25: string='c'
  31. 26: string='b'
  32. 27: )
  33. 28: )
  34. 29: )
  35. 30: )
  36. 31: )
  37.  
  38. --- Expressions ---
  39. Expression: pos=(0,32); depth=1
  40. VAR; name=a
  41. Expression: pos=(2,32); depth=2
  42. Int_Lit; value=13
  43. Expression: pos=(3,32); depth=2
  44. Expression: pos=(4,32); depth=1
  45. Defun
  46. Expression: pos=(10,32); depth=3
  47. Let
  48. Expression: pos=(13,32); depth=4
  49. VAR; name=c
  50. Expression: pos=(15,32); depth=5
  51. Int_Lit; value=8
  52. Expression: pos=(16,32); depth=5
  53. Expression: pos=(17,32); depth=4
  54. Expression: pos=(18,32); depth=3
  55. Write
  56. Expression: pos=(20,32); depth=4
  57. [+,-,*,/]
  58. Expression: pos=(22,32); depth=5
  59. Int_Lit; value=2
  60. Expression: pos=(23,32); depth=5
  61. [+,-,*,/]
  62. Expression: pos=(25,32); depth=6
  63. VAR; value=c
  64. Expression: pos=(26,32); depth=6
  65. VAR; value=b
  66. Expression: pos=(27,32); depth=6
  67. Expression: pos=(28,32); depth=5
  68. Expression: pos=(29,32); depth=4
  69.  
  70. --- Tree ---
  71. [expressions
  72. [let_fun_var 'a'
  73. [13]]
  74. [return]
  75. [defun 'a'
  76. [bind_vars
  77. [bind_var 'b']]
  78. [expressions
  79. [let
  80. [let_fun_var 'c'
  81. [8]]
  82. [write
  83. [*
  84. [2]
  85. [+
  86. [c]
  87. [b]]]]]]]]
  88.  
  89. --- Evaluate ---
  90. 42
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement