diff --git a/books/bookvol9.pamphlet b/books/bookvol9.pamphlet index 8d14dd7..c886fd6 100644 --- a/books/bookvol9.pamphlet +++ b/books/bookvol9.pamphlet @@ -569,6 +569,102 @@ with a {\tt .lsp} file, the Lisp file is compiled and {\tt )library} is called. For Aldor, You must also have present a {\tt .asy} generated from the same source file. +\defunsec{compiler}{The top level compiler command} +<>= +(defun |compiler| (args) + "The top level compiler command" + (let (|$newConlist| optlist optname optargs havenew haveold aft ef af af1) + (declare (special |$newConlist| |$options| /editfile)) + (setq |$newConlist| nil) + (cond + ((and (null args) (null |$options|) (null /editfile)) + (|helpSpad2Cmd| '(|compiler|))) + (t + (cond ((null args) (setq args (cons /editfile nil)))) + (setq optlist '(|new| |old| |translate| |constructor|)) + (setq havenew nil) + (setq haveold nil) + (do ((t0 |$options| (cdr t0)) (opt nil)) + ((or (atom t0) + (progn (setq opt (car t0)) nil) + (null (null (and havenew haveold)))) + nil) + (setq optname (car opt)) + (setq optargs (cdr opt)) + (case (|selectOptionLC| optname optlist nil) + (|new| (setq havenew t)) + (|translate| (setq haveold t)) + (|constructor| (setq haveold t)) + (|old| (setq haveold t)))) + (cond + ((and havenew haveold) (|throwKeyedMsg| 's2iz0081 nil)) + (t + (setq af (|pathname| args)) + (setq aft (|pathnameType| af)) + (cond + ((or havenew (string= aft "as")) + (if (null (setq af1 ($findfile af '(|as|)))) + (|throwKeyedMsg| 's2il0003 (cons (namestring af) nil)) + (|compileAsharpCmd| (cons af1 nil)))) + ((or haveold (string= aft "spad")) + (if (null (setq af1 ($findfile af '(|spad|)))) + (|throwKeyedMsg| 's2il0003 (cons (namestring af) nil)) + (|compileSpad2Cmd| (cons af1 nil)))) + ((string= aft "lsp") + (if (null (setq af1 ($findfile af '(|lsp|)))) + (|throwKeyedMsg| 's2il0003 (cons (namestring af) nil)) + (|compileAsharpLispCmd| (cons af1 nil)))) + ((string= aft "nrlib") + (if (null (setq af1 ($findfile af '(|nrlib|)))) + (|throwKeyedMsg| 'S2IL0003 (cons (namestring af) nil)) + (|compileSpadLispCmd| (cons af1 nil)))) + ((string= aft "ao") + (if (null (setq af1 ($findfile af '(|ao|)))) + (|throwKeyedMsg| 's2il0003 (cons (namestring af) nil)) + (|compileAsharpCmd| (cons af1 nil)))) + ((string= aft "al") + (if (null (setq af1 ($findfile af '(|al|)))) + (|throwKeyedMsg| 's2il0003 (cons (namestring af) nil)) + (|compileAsharpArchiveCmd| (cons af1 nil)))) + (t + (setq af1 ($findfile af '(|as| |spad| |ao| |asy|))) + (cond + ((and af1 (string= (|pathnameType| af1) "as")) + (|compileAsharpCmd| (cons af1 nil))) + ((and af1 (string= (|pathnameType| af1) "ao")) + (|compileAsharpCmd| (cons af1 nil))) + ((and af1 (string= (|pathnameType| af1) "spad")) + (|compileSpad2Cmd| (cons af1 nil))) + ((and af1 (string= (|pathnameType| af1) "asy")) + (|compileAsharpArchiveCmd| (cons af1 nil))) + (t + (setq ef (|pathname| /editfile)) + (setq ef (|mergePathnames| af ef)) + (cond + ((boot-equal ef af) (|throwKeyedMsg| 's2iz0039 nil)) + (t + (setq af ef) + (cond + ((string= (|pathnameType| af) "as") + (|compileAsharpCmd| args)) + ((string= (|pathnameType| af) "ao") + (|compileAsharpCmd| args)) + ((string= (|pathnameType| af) "spad") + (|compileSpad2Cmd| args)) + (t + (setq af1 ($findfile af '(|as| |spad| |ao| |asy|))) + (cond + ((and af1 (string= (|pathnameType| af1) "as")) + (|compileAsharpCmd| (cons af1 nil))) + ((and af1 (string= (|pathnameType| af1) "ao")) + (|compileAsharpCmd| (cons af1 nil))) + ((and af1 (string= (|pathnameType| af1) "spad")) + (|compileSpad2Cmd| (cons af1 nil))) + ((and af1 (string= (|pathnameType| af1) "asy")) + (|compileAsharpArchiveCmd| (cons af1 nil))) + (t (|throwKeyedMsg| 's2iz0039 nil))))))))))))))))) + +@ \defunsec{compileSpad2Cmd}{The Spad compiler top level function} This is the old compiler. Assume we entered from the "compiler" function, so args is diff --git a/changelog b/changelog index 99c01ad..3dbaa1e 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,5 @@ +20090419 tpd src/axiom-website/patches.html 20090419.01.tpd.patch +20090419 tpd books/bookvol9 move portions of the compiler 20090418 tpd src/axiom-website/patches.html 20090418.02.tpd.patch 20090418 tpd books/bookvol9 move portions of the compiler 20090418 tpd src/axiom-website/patches.html 20090418.01.tpd.patch diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index a66659b..f730fea 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -1102,5 +1102,7 @@ compiler use waldek +-> syntax
bookvol10.4 convert EF to +-> syntax
20090418.02.tpd.patch bookvol9 move portions of the compiler
+20090419.01.tpd.patch +bookvol9 move portions of the compiler
diff --git a/src/interp/setq.lisp.pamphlet b/src/interp/setq.lisp.pamphlet index 86bf635..11cb965 100644 --- a/src/interp/setq.lisp.pamphlet +++ b/src/interp/setq.lisp.pamphlet @@ -67,6 +67,10 @@ (SETQ |$newConlist| nil) (SETQ |$createLocalLibDb| 't) +;; These are duplicates of definitions in bookvol9 + +(defvar |$byConstructors| () "list of constructors to be compiled") +(defvar |$constructorsSeen| () "list of constructors found") ;; These were originally in SPAD LISP @@ -193,11 +197,6 @@ (SETQ $cacheAlist NIL) (SETQ $streamAlist NIL) -;; following 2 variables are referenced by PREPARSE1 - -(defvar |$byConstructors| () "list of constructors to be compiled") -(defvar |$constructorsSeen| () "list of constructors found") - ;; These are for the output routines in OUT BOOT (SETQ $LINELENGTH 77)