File tree Expand file tree Collapse file tree 1 file changed +25
-16
lines changed Expand file tree Collapse file tree 1 file changed +25
-16
lines changed Original file line number Diff line number Diff line change 2
2
3
3
# Po = m(Co, Ps)
4
4
# Co = m(Co, Cs)
5
+ #
6
+ # Po = Program object
7
+ # Co = Compiler object
8
+ # Cs = Compiler source
9
+ # Ps = Program source
5
10
6
11
LISPKIT=./lispkit
12
+ COMPILER=compiler.secd
13
+ SOURCE=compiler.lisp
7
14
8
15
function m {
9
- Co=$1
10
- Ps=$2
11
- Po=$3
16
+ local Co=$1
17
+ local Ps=$2
18
+ local Po=$3
12
19
$LISPKIT $Co $Ps | fmt -w 80 > $Po
13
20
}
14
21
@@ -20,18 +27,20 @@ function d {
20
27
fi
21
28
}
22
29
23
- cat compiler.lisp | tr ' \n' ' ' | fmt -w 80 > compiler1.lisp
24
- cat compiler.secd | tr ' \n' ' ' | fmt -w 80 > compiler1.secd
30
+ function bootstrap {
31
+ local Co=$1
32
+ local Ps=$2
33
+ local Po=${Ps/ .lisp/ .secd}
34
+ local CPo=${Po} .bootstrap
35
+ m $Co $Ps $Po
36
+ m $Po $Ps $CPo
37
+ d $Po $CPo
38
+ echo " Bootstrap OK"
39
+ }
25
40
26
- m " compiler1.secd" " compiler1.lisp" " compiler1.secd.out"
27
- d " compiler1.secd" " compiler1.secd.out"
28
- echo " 1 OK"
29
- m " compiler1.secd" " compiler2.lisp" " compiler2.secd"
30
- m " compiler2.secd" " compiler2.lisp" " compiler2.secd.out"
31
- d " compiler2.secd" " compiler2.secd.out"
32
- echo " 2 OK"
33
- m " compiler2.secd" " compiler3.lisp" " compiler3.secd"
34
- m " compiler3.secd" " compiler3.lisp" " compiler3.secd.out"
35
- d " compiler3.secd" " compiler3.secd.out"
36
- echo " 3 OK"
41
+ cat $COMPILER | tr ' \n' ' ' | fmt -w 80 > compiler0.secd
42
+ cat $SOURCE | tr ' \n' ' ' | fmt -w 80 > compiler1.lisp
37
43
44
+ bootstrap compiler0.secd compiler1.lisp
45
+ bootstrap compiler1.secd compiler2.lisp
46
+ bootstrap compiler2.secd compiler3.lisp
You can’t perform that action at this time.
0 commit comments