Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- Input ---
- "(let ((x (+ 19 6)) (y 11)) (write (- x y)))"
- --- Tokens ---
- 0: '('
- 1: 'let'
- 2: '('
- 3: '('
- 4: 'x'
- 5: '('
- 6: '+'
- 7: '19'
- 8: '6'
- 9: ')'
- 10: ')'
- 11: '('
- 12: 'y'
- 13: '11'
- 14: ')'
- 15: ')'
- 16: '('
- 17: 'write'
- 18: '('
- 19: '-'
- 20: 'x'
- 21: 'y'
- 22: ')'
- 23: ')'
- 24: ')'
- --- Expressions ---
- Expression: pos=(0,25); depth=0
- Let
- Expression: pos=(3,25); depth=1
- Str_Lit; value=x
- Expression: pos=(5,25); depth=2
- [+,-,*,/]
- Expression: pos=(7,25); depth=3
- Int_Lit; value=19
- Expression: pos=(8,25); depth=3
- Int_Lit; value=6
- Expression: pos=(9,25); depth=3
- Expression: pos=(10,25); depth=2
- Expression: pos=(11,25); depth=1
- Str_Lit; value=y
- Expression: pos=(13,25); depth=2
- Int_Lit; value=11
- Expression: pos=(14,25); depth=2
- Expression: pos=(15,25); depth=1
- Expression: pos=(16,25); depth=0
- Write
- Expression: pos=(18,25); depth=1
- [+,-,*,/]
- Expression: pos=(20,25); depth=2
- Str_Lit; value=x
- Expression: pos=(21,25); depth=2
- Str_Lit; value=y
- Expression: pos=(22,25); depth=2
- Expression: pos=(23,25); depth=1
- --- Tree ---
- [let
- [let_dec 'x'
- [+
- [19]
- [6]]]
- [let_dec 'y'
- [11]]
- [write
- [-
- [x]
- [y]]]]
- --- Evaluate ---
- 14
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement