Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- Input ---
- "(a 13)(defun a(b) (let ((c 8)) (write (* 2 (+ c b)))))"
- --- Tokens ---
- 0: (
- 1: string='a'
- 2: int=13
- 3: )
- 4: (
- 5: defun
- 6: string='a'
- 7: (
- 8: string='b'
- 9: )
- 10: (
- 11: let
- 12: (
- 13: (
- 14: string='c'
- 15: int=8
- 16: )
- 17: )
- 18: (
- 19: write
- 20: (
- 21: *
- 22: int=2
- 23: (
- 24: +
- 25: string='c'
- 26: string='b'
- 27: )
- 28: )
- 29: )
- 30: )
- 31: )
- --- Expressions ---
- Expression: pos=(0,32); depth=1
- VAR; name=a
- Expression: pos=(2,32); depth=2
- Int_Lit; value=13
- Expression: pos=(3,32); depth=2
- Expression: pos=(4,32); depth=1
- Defun
- Expression: pos=(10,32); depth=3
- Let
- Expression: pos=(13,32); depth=4
- VAR; name=c
- Expression: pos=(15,32); depth=5
- Int_Lit; value=8
- Expression: pos=(16,32); depth=5
- Expression: pos=(17,32); depth=4
- Expression: pos=(18,32); depth=3
- Write
- Expression: pos=(20,32); depth=4
- [+,-,*,/]
- Expression: pos=(22,32); depth=5
- Int_Lit; value=2
- Expression: pos=(23,32); depth=5
- [+,-,*,/]
- Expression: pos=(25,32); depth=6
- VAR; value=c
- Expression: pos=(26,32); depth=6
- VAR; value=b
- Expression: pos=(27,32); depth=6
- Expression: pos=(28,32); depth=5
- Expression: pos=(29,32); depth=4
- --- Tree ---
- [expressions
- [let_fun_var 'a'
- [13]]
- [return]
- [defun 'a'
- [bind_vars
- [bind_var 'b']]
- [expressions
- [let
- [let_fun_var 'c'
- [8]]
- [write
- [*
- [2]
- [+
- [c]
- [b]]]]]]]]
- --- Evaluate ---
- 42
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement