blob: e2ca8da9d097abf3daac60b4a09f47cc9d848bc4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
(define-module (modules ast syntax-tree)
#:use-module (srfi srfi-9)
#:export (make-program
program?
program-function
make-function
function?
function-id
function-stmt
make-stmt
stmt?
stmt-expr
make-unary
unary?
unary-operator
unary-expr
make-const
const?
const-int
make-id
id?
id-symbol))
(define-record-type <program>
(make-program func)
program?
(func program-function))
(define-record-type <function>
(make-function id stmt)
function?
(id function-id)
(stmt function-stmt))
(define-record-type <stmt>
(make-stmt expr)
stmt?
(expr stmt-expr))
(define-record-type <unary>
(make-unary op expr)
unary?
(op unary-operator)
(expr unary-expr))
(define-record-type <const>
(make-const int)
const?
(int const-int))
(define-record-type <id>
(make-id symbol)
id?
(symbol id-symbol))
|