-
Notifications
You must be signed in to change notification settings - Fork 0
/
LOADER
90 lines (73 loc) · 2.39 KB
/
LOADER
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
;;; -*- mode: lisp -*-
;;; +---------------------------------------------------------------+
;;; | etaoin-shrdlu: LISP interpreter for the SHRDLU project |
;;; | |
;;; | Original source code is published in github resository: |
;;; | https://github.com/pcerman/etaoin-shrdlu. |
;;; | |
;;; | Copyright (c) 2021 Peter Cerman (https://github.com/pcerman) |
;;; | |
;;; | This source code is released under Mozilla Public License 2.0 |
;;; +---------------------------------------------------------------+
;;; SHRDLU loader
(LOAD 'pdp-6//compatibility.lisp)
(LOAD 'pdp-6//read-hook.lisp)
(DEFUN LOADER (*!?KEY)
(OR (ERRSET (EVAL (LIST 'UREAD
*!?KEY
'>
'DSK
'SHRDLU))
NIL)
(AND (PRINT *!?KEY)
(PRINC 'NOT-FOUND)
(RETURN NIL)))
(LOADX))
(DEFUN LOADX ()
(PROG (*!?H *!?F *!?EOF)
(SETQ *!?EOF (GENSYM))
(PRINT 'READING)
(PRINC *!?KEY)
(SETQ VERSION-FILES (CONS (STATUS UREAD) VERSION-FILES))
LOOP
((LAMBDA (^Q) (SETQ *!?H (READ *!?EOF))) T)
(AND (EQ *!?H *!?EOF) (RETURN T))
(OR (ERRSET ((LAMBDA (^W ^Q) (EVAL *!?H)) T T))
(PROG2 (PRINT 'ERROR-IN-FILE) (PRINT *!?H)))
(GO LOOP)))
(SETQ VERSION-FILES NIL)
(DEFUN LOADSHRDLU ()
(SSTATUS CXR T)
(SSTATUS READ-HOOK THSVAR)
(SETQ PURE NIL)
(MAPC 'LOADER '(PLNR THTRAC))
(THINIT)
(SETQ THINF NIL THTREE NIL THLEVEL NIL)
(MAPC 'LOADER '(SYSCOM MORPHO SHOW))
(MAPC 'LOADER '(PROGMR GINTER CGRAM DICTIO))
(MAPC 'LOADER '(SMSPEC SMASS SMUTIL))
(LOADER 'NEWANS)
(MAPC 'LOADER '(BLOCKL BLOCKP DATA MOVER))
(LOADER 'SETUP)
(TERPRI)
(TERPRI)
(PRINC "*** CONSTRUCTION COMPLETED ***")
(TERPRI))
(DEFUN RUN ()
;; Set either (DEBUGMODE) or (USERMODE) here.
(USERMODE)
;;(DEBUGMODE)
;;(LABELTRACE CLAUSE NG VG ADJG PREPG CONJOIN)
;;(SETQ LABELTRACE T)
;;(PARSETRACE)
;;(SMNTRACE)
(SETQ ANNOYANCE T)
;;(SETQ NEVERSTOP NIL)
(SETQ SH-STANDARD-PRINTOUT NIL)
(TOTALTIME NIL)
;; Start the program
(INITIALSTUFF 'UMR-1.0 NIL))
(LOADSHRDLU)
(PRINC "*** To run SHRDLU do: (RUN)")
(TERPRI)
(TERPRI)