diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet index 1140d6d..10e6242 100644 --- a/books/bookvol5.pamphlet +++ b/books/bookvol5.pamphlet @@ -1639,12 +1639,6 @@ a top level command @ -\defdollar{useNewParser} -<>= -(defvar |$useNewParser| nil) - -@ - \defun{parseAndInterpret}{parseAndInterpret} \calls{parseAndInterpret}{ncParseAndInterpretString} \calls{parseAndInterpret}{oldParseAndInterpret} @@ -1652,21 +1646,42 @@ a top level command \usesdollar{parseAndInterpret}{boot} \usesdollar{parseAndInterpret}{spad} \usesdollar{parseAndInterpret}{e} -\usesdollar{parseAndInterpret}{useNewParser} \usesdollar{parseAndInterpret}{InteractiveFrame} <>= (defun |parseAndInterpret| (str) (let (|$InteractiveMode| $boot $spad |$e|) - (declare (special |$InteractiveMode| $boot $spad |$e| |$useNewParser| + (declare (special |$InteractiveMode| $boot $spad |$e| |$InteractiveFrame|)) (setq |$InteractiveMode| t) (setq $boot nil) (setq $spad t) (setq |$e| |$InteractiveFrame|) - (if |$useNewParser| - (|ncParseAndInterpretString| str)) - (|oldParseAndInterpret| str))) + (|ncParseAndInterpretString| str))) + +@ + +\defun{ncParseAndInterpretString}{ncParseAndInterpretString} +\calls{ncParseAndInterpretString}{processInteractive} +\calls{ncParseAndInterpretString}{packageTran} +\calls{ncParseAndInterpretString}{parseFromString} +<>= +(defun |ncParseAndInterpretString| (s) + (|processInteractive| (|packageTran| (|parseFromString| s)) nil)) +@ + +\defun{parseFromString}{parseFromString} +\calls{parseFromString}{next} +\calls{parseFromString}{ncloopParse} +\calls{parseFromString}{lineoftoks} +\calls{parseFromString}{incString} +\calls{parseFromString}{StreamNull} +\calls{parseFromString}{pf2Sex} +\calls{parseFromString}{macroExpanded} +<>= +(defun |parseFromString| (s) + (setq s (|next| #'|ncloopParse| (|next| #'|lineoftoks| (|incString| s)))) + (unless (|StreamNull| s) (|pf2Sex| (|macroExpanded| (cadar s))))) @ @@ -16216,6 +16231,17 @@ The \verb|$msgdbPrims| variable is set to: @ +\defun{displayParserMacro}{displayParserMacro} +\calls{displayParserMacro}{pfPrintSrcLines} +\usesdollar{displayParserMacro}{pfMacros} +<>= +(defun |displayParserMacro| (m) + (let ((m (assq m |$pfMacros|))) + (declare (special |$pfMacros|)) + (when m (|pfPrintSrcLines| (caddr m))))) + +@ + \defun{displayCondition}{displayCondition} \calls{displayCondition}{bright} \calls{displayCondition}{sayBrightly} @@ -34547,7 +34573,6 @@ Compile with noisy output \defun{/rf-1}{/rf-1} \calls{/rf-1}{ncINTERPFILE} -\usesdollar{/rf-1}{useNewParser} \uses{/rf-1}{/editfile} \uses{/rf-1}{echo-meta} <>= @@ -34555,11 +34580,10 @@ Compile with noisy output (declare (ignore ignore)) (let* ((input-file (makeInputFilename /editfile)) (type (pathname-type input-file))) - (declare (special |$useNewParser| echo-meta /editfile)) + (declare (special echo-meta /editfile)) (cond ((string= type "lisp") (load input-file)) - ((and (string= type "input") |$useNewParser|) - (|ncINTERPFILE| input-file echo-meta)) + ((string= type "input") (|ncINTERPFILE| input-file echo-meta)) (t (spad input-file))))) @ @@ -38030,6 +38054,10 @@ equality predicate associated with the domain. If found then Table will use a HashTable representation, otherwise it will use an AssociationList representation \calls{hashable}{knownEqualPred} +\calls{hashable}{compiledLookup} +\calls{hashable}{Boolean} +\calls{hashable}{bpiname} +\calls{hashable}{knownEqualPred} <>= (defun |hashable| (dom) (labels ( @@ -40088,6 +40116,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -40464,6 +40493,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -40680,6 +40710,7 @@ This needs to work off the internal exposure list, not the file. <> <> +<> <> <> <> @@ -41153,7 +41184,6 @@ This needs to work off the internal exposure list, not the file. <> <> <> -<> <> <> <> diff --git a/books/bookvol9.pamphlet b/books/bookvol9.pamphlet index 2cad8ab..989e680 100644 --- a/books/bookvol9.pamphlet +++ b/books/bookvol9.pamphlet @@ -884,266 +884,38 @@ Compile a library quietly @ \defun{compileAsharpCmd}{compileAsharpCmd} -\calls{compileAsharpCmd}{terminateSystemCommand(5)} -\calls{compileAsharpCmd}{compileAsharpCmd1} -\calls{compileAsharpCmd}{spadPrompt} <>= (defun |compileAsharpCmd| (args) - (|compileAsharpCmd1| args) - (|terminateSystemCommand|) - (|spadPrompt|)) + (error "compileAsharpCmd is no longer supported")) @ \defun{compileAsharpCmd1}{compileAsharpCmd1} -\calls{compileAsharpCmd1}{pathname(5)} -\calls{compileAsharpCmd1}{pathnameType(5)} -\calls{compileAsharpCmd1}{fnameMake(5)} -\calls{compileAsharpCmd1}{namestring(5)} -\calls{compileAsharpCmd1}{selectOptionLC(5)} -\calls{compileAsharpCmd1}{pathnameName(5)} -\calls{compileAsharpCmd1}{fnameReadable?(5)} -\calls{compileAsharpCmd1}{updateSourceFiles(5)} -\calls{compileAsharpCmd1}{getenviron(5)} -\calls{compileAsharpCmd1}{nequal} -\calls{compileAsharpCmd1}{throwKeyedMsg} -\calls{compileAsharpCmd1}{error} -\calls{compileAsharpCmd1}{strconc} -\calls{compileAsharpCmd1}{object2String} -\calls{compileAsharpCmd1}{sayKeyedMsg} -\calls{compileAsharpCmd1}{obey} -\calls{compileAsharpCmd1}{compileFileQuietly} -\calls{compileAsharpCmd1}{withAsharpCmd} -\calls{compileAsharpCmd1}{extendLocalLibdb} -\usesdollar{compileAsharpCmd1}{options} -\usesdollar{compileAsharpCmd1}{asharpCmdlineFlags} -\usesdollar{compileAsharpCmd1}{newConlist} -\uses{compileAsharpCmd1}{/editfile} <>= (defun |compileAsharpCmd1| (args) - (let (path pathtype optlist optname optargs bequiet docompilelisp - moreargs onlyargs dolibrary p tempargs s asharpargs command rc lsp) - (declare (special |$options| |$asharpCmdlineFlags| |$newConlist| - /editfile)) - (setq path (|pathname| args)) - (setq pathtype (|pathnameType| path)) - (cond - ((and (nequal pathtype "as") (nequal pathtype "ao")) - (|throwKeyedMsg| 's2iz0083 nil)) - ((null (probe-file path)) - (|throwKeyedMsg| 's2il0003 (cons (|namestring| args) nil))) - (t - (setq /editfile path) - (|updateSourceFiles| path) - (setq optlist - '(|new| |old| |translate| |onlyargs| |moreargs| |quiet| - |nolispcompile| |noquiet| |library| |nolibrary|)) - (setq bequiet nil) - (setq dolibrary t) - (setq docompilelisp t) - (setq moreargs nil) - (setq onlyargs nil) - (dolist (opt |$options|) - (setq optname (car opt)) - (setq optargs (cdr opt)) - (case (|selectOptionLC| optname optlist nil) - (|new| nil) - (|old| (|error| '|Internal error: compileAsharpCmd got )old|)) - (|translate| - (|error| '|Internal error: compileAsharpCmd got )translate|)) - (|quiet| (setq bequiet t)) - (|noquiet| (setq bequiet nil)) - (|nolispcompile| (setq docompilelisp nil)) - (|moreargs| (setq moreargs optargs)) - (|onlyargs| (setq onlyargs optargs)) - (|library| (setq dolibrary t)) - (|nolibrary| (setq dolibrary nil)) - (t - (|throwKeyedMsg| 's2iz0036 - (cons (strconc ")" (|object2String| optname)) nil))))) - (setq tempargs - (if (string= pathtype "ao") - (if (setq p (strpos "-Fao" |$asharpCmdlineFlags| 0 nil)) - (if (eql p 0) - (substring |$asharpCmdlineFlags| 5 nil) - (strconc (substring |$asharpCmdlineFlags| 0 p) - " " (substring |$asharpCmdlineFlags| (plus p 5) nil))) - |$asharpCmdlineFlags|) - |$asharpCmdlineFlags|)) - (setq asharpargs - (cond - (onlyargs - (setq s '||) - (do ((t1 onlyargs (cdr t1)) (|a| nil)) - ((or (atom t1) (progn (setq |a| (car t1)) nil)) nil) - (setq s (strconc s " " (|object2String| |a|)))) - s) - (moreargs - (setq s tempargs) - (do ((t2 moreargs (cdr t2)) (|a| nil)) - ((or (atom t2) (progn (setq |a| (car t2)) nil)) nil) - (setq s (strconc s " " (|object2String| |a|)))) - s) - (t tempargs))) - (unless bequiet - (|sayKeyedMsg| 's2iz0038a (list (|namestring| args) asharpargs ))) - (setq command - (strconc - (strconc (getenviron "ALDORROOT") "/bin/") - '|aldor | asharpargs " " (|namestring| args))) - (setq rc (obey command)) - (cond - ((and (eql rc 0) docompilelisp) - (setq lsp (|fnameMake| "." (|pathnameName| args) "lsp")) - (cond - ((|fnameReadable?| lsp) - (unless bequiet - (|sayKeyedMsg| 's2iz0089 (cons (|namestring| lsp) nil))) - (|compileFileQuietly| lsp)) - (t (|sayKeyedMsg| 's2il0003 (cons (|namestring| lsp) nil)))))) - (cond - ((and (eql rc 0) dolibrary) - (unless bequiet - (|sayKeyedMsg| 's2iz0090 (cons (|pathnameName| path) nil))) - (|withAsharpCmd| (cons (|pathnameName| path) nil))) - ((null bequiet) (|sayKeyedMsg| 's2iz0084 nil)) - (t nil)) - (|extendLocalLibdb| |$newConlist|))))) + (error "compileAsharpCmd1 is no longer supported")) @ \defun{compileAsharpArchiveCmd}{compileAsharpArchiveCmd} -\calls{compileAsharpArchiveCmd}{pathname(5)} -\calls{compileAsharpArchiveCmd}{terminateSystemCommand(5)} -\calls{compileAsharpArchiveCmd}{namestring(5)} -\calls{compileAsharpArchiveCmd}{fnameMake(5)} -\calls{compileAsharpArchiveCmd}{pathnameName(5)} -\calls{compileAsharpArchiveCmd}{throwKeyedMsg} -\calls{compileAsharpArchiveCmd}{directoryp} -\calls{compileAsharpArchiveCmd}{nequal} -\calls{compileAsharpArchiveCmd}{strconc} -\calls{compileAsharpArchiveCmd}{obey} -\calls{compileAsharpArchiveCmd}{object2Identifier} -\calls{compileAsharpArchiveCmd}{cd} -\calls{compileAsharpArchiveCmd}{compileAsharpCmd1} -\calls{compileAsharpArchiveCmd}{spadPrompt} -\usesdollar{compileAsharpArchiveCmd}{current-directory} <>= (defun |compileAsharpArchiveCmd| (args) - (let (path dir exists isdir curdir cmd rc asos) - (declare (special $current-directory)) - (setq path (|pathname| args)) - (if (null (probe-file path)) - (|throwKeyedMsg| 's2il0003 (cons (|namestring| args) nil)) - (progn - (setq dir (|fnameMake| "." (|pathnameName| path) "axldir")) - (setq exists (probe-file dir)) - (setq isdir (|directoryp| (|namestring| dir))) - (if (and exists (nequal isdir 1)) - (|throwKeyedMsg| 's2il0027 (list (|namestring| dir) (|namestring| args))) - (progn - (when (nequal isdir 1) - (setq cmd (strconc "mkdir " (|namestring| dir))) - (setq rc (obey cmd)) - (when (nequal rc 0) - (|throwKeyedMsg| 's2il0027 - (list (|namestring| dir) (|namestring| args))))) - (setq curdir $current-directory) - (|cd| (cons (|object2Identifier| (|namestring| dir)) nil)) - (setq cmd (strconc "ar x " (|namestring| path))) - (setq rc (obey cmd)) - (cond - ((nequal rc 0) - (|cd| (cons (|object2Identifier| (|namestring| curdir)) nil)) - (|throwKeyedMsg| 's2il0028 - (cons (|namestring| dir) (cons (|namestring| args) nil)))) - (t - (setq asos (directory "*.ao")) - (if (null asos) - (progn - (|cd| (cons (|object2Identifier| (|namestring| curdir)) nil)) - (|throwKeyedMsg| 's2il0029 - (cons (|namestring| dir) (cons (|namestring| args) nil)))) - (progn - (dolist (aso asos) - (|compileAsharpCmd1| (list (|namestring| aso)))) - (|cd| (list (|object2Identifier| (|namestring| curdir)))) - (|terminateSystemCommand|) - (|spadPrompt|))))))))))) + (error "compileAsharpArchiveCmd is no longer supported")) @ \defun{compileAsharpLispCmd}{compileAsharpLispCmd} -\calls{compileAsharpLispCmd}{pathname(5)} -\calls{compileAsharpLispCmd}{namestring(5)} -\calls{compileAsharpLispCmd}{selectOptionLC(5)} -\calls{compileAsharpLispCmd}{terminateSystemCommand(5)} -\calls{compileAsharpLispCmd}{pathnameType(5)} -\calls{compileAsharpLispCmd}{fnameMake(5)} -\calls{compileAsharpLispCmd}{pathnameDirectory(5)} -\calls{compileAsharpLispCmd}{pathnameName(5)} -\calls{compileAsharpLispCmd}{fnameReadable?(5)} -\calls{compileAsharpLispCmd}{throwKeyedMsg} -\calls{compileAsharpLispCmd}{strconc} -\calls{compileAsharpLispCmd}{object2String} -\calls{compileAsharpLispCmd}{sayKeyedMsg} -\calls{compileAsharpLispCmd}{compileFileQuietly} -\calls{compileAsharpLispCmd}{withAsharpCmd} -\calls{compileAsharpLispCmd}{spadPrompt} -\usesdollar{compileAsharpLispCmd}{options} +\calls{compileAsharpLispCmd}{error} <>= (defun |compileAsharpLispCmd| (args) - (let (path optlist optname optargs bequiet dolibrary lsp) - (declare (special |$options|)) - (setq path (|pathname| args)) - (if (null (probe-file path)) - (|throwKeyedMsg| 's2il0003 (cons (|namestring| args) nil)) - (progn - (setq optlist '(|quiet| |noquiet| |library| |nolibrary|)) - (setq bequiet nil) - (setq dolibrary t) - (dolist (opt |$options|) - (setq optname (car opt)) - (setq optargs (cdr opt)) - (case (|selectOptionLC| optname optlist nil) - (|quiet| (setq bequiet t)) - (|noquiet| (setq bequiet nil)) - (|library| (setq dolibrary t)) - (|nolibrary| (setq dolibrary nil)) - (t - (|throwKeyedMsg| 's2iz0036 - (list (strconc ")" (|object2String| optname))))))) - (setq lsp - (|fnameMake| - (|pathnameDirectory| path) - (|pathnameName| path) - (|pathnameType| path))) - (cond - ((|fnameReadable?| lsp) - (unless bequiet - (|sayKeyedMsg| 's2iz0089 (cons (|namestring| lsp) nil))) - (|compileFileQuietly| lsp)) - (t (|sayKeyedMsg| 's2il0003 (cons (|namestring| lsp) nil)))) - (cond - (dolibrary - (unless bequiet - (|sayKeyedMsg| 's2iz0090 (cons (|pathnameName| path) nil))) - (|withAsharpCmd| (cons (|pathnameName| path) nil))) - ((null bequiet) (|sayKeyedMsg| 's2iz0084 nil)) - (t nil)) - (|terminateSystemCommand|) - (|spadPrompt|))))) + (error "compileAsharpLispCmd is no longer supported")) @ \defun{withAsharpCmd}{withAsharpCmd} -\calls{withAsharpCmd}{localdatabase(5)} -\usesdollar{withAsharpCmd}{options} <>= (defun |withAsharpCmd| (args) - (let (|$options|) - (declare (special |$options|)) - (localdatabase args |$options|))) + (error "withAsharpCmd is no longer supported")) @ diff --git a/changelog b/changelog index e0de596..ebab493 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,9 @@ +20100815 tpd src/axiom-website/patches.html 20100815.02.tpd.patch +20100815 tpd src/interp/varini.lisp treeshake +20100815 tpd src/interp/nci.lisp treeshake +20100815 tpd src/interp/ht-util.lisp treeshake +20100815 tpd books/bookvol5 treeshake, remove $useNewParser +20100815 tpd books/bookvol9 treeshake, remove $useNewParser 20100815 tpd src/axiom-website/patches.html 20100815.01.tpd.patch 20100815 tpd src/interp/vmlisp.lisp treeshake the compiler code 20100815 tpd src/interp/parsing.lisp treeshake the compiler code diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 4fabe41..8809cd7 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -3067,5 +3067,7 @@ books/bookvol9 cross-reference functions and variables
books/bookvol9 treeshake the compiler code
20100815.01.tpd.patch books/bookvol9 treeshake the compiler code
+20100815.02.tpd.patch +books/bookvol5 treeshake, remove $useNewParser
diff --git a/src/interp/cparse.lisp.pamphlet b/src/interp/cparse.lisp.pamphlet deleted file mode 100644 index f0d7311..0000000 --- a/src/interp/cparse.lisp.pamphlet +++ /dev/null @@ -1,52 +0,0 @@ -\documentclass{article} -\usepackage{axiom} -\begin{document} -\title{\$SPAD/src/interp cparse.boot} -\author{The Axiom Team} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject -<<*>>= - -(IN-PACKAGE "BOOT") - -;-- Parsing functions - -;npAssignVariableName()==npApplication() and -; a:=npPop1() -; if pfId? a -; then -; (npPush a and npDecl() or npPush pfTyped(npPop1(),pfNothing())) -; else npPush a -(DEFUN |npAssignVariableName| () - (PROG (|a|) - (RETURN - (AND - (|npApplication|) - (PROGN - (SETQ |a| (|npPop1|)) - (COND - ((|pfId?| |a|) - (OR - (AND (|npPush| |a|) (|npDecl|)) - (|npPush| (|pfTyped| (|npPop1|) (|pfNothing|))))) - ((QUOTE T) - (|npPush| |a|)))))))) -(trace npAssignVariableName|) - -;npAssignVariablelist()== npListing function npAssignVariableName -(DEFUN |npAssignVariablelist| () - (PROG NIL - (RETURN - (|npListing| (FUNCTION |npAssignVariableName|))))) -(trace |npAssignVariablelist|) - -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/interp/ht-util.lisp.pamphlet b/src/interp/ht-util.lisp.pamphlet index 7ea68bf..cc91590 100644 --- a/src/interp/ht-util.lisp.pamphlet +++ b/src/interp/ht-util.lisp.pamphlet @@ -1829,7 +1829,7 @@ (PROGN (PRINC |command|) (TERPRI) - (|ncSetCurrentLine| |command|) + (|setCurrentLine| |command|) (CATCH 'SPAD_READER (|parseAndInterpret| |command|)) (PRINC (MKPROMPT)) (FINISH-OUTPUT))) @@ -2091,50 +2091,26 @@ (SPADLET |$QuietCommand| 'T) (|parseAndEval1| |string|))))) -;parseAndEval1 string == -; syntaxError := false -; pform := -; $useNewParser => -; v := applyWithOutputToString('ncParseFromString, [string]) -; CAR v => CAR v -; syntaxError := true -; CDR v -; oldParseString string -; syntaxError => -; '"Syntax Error " -; pform => -; val := applyWithOutputToString('processInteractive, [pform, nil]) -; CAR val => CAR val -; '"Type Analysis Error" -; nil - -(DEFUN |parseAndEval1| (|string|) - (PROG (|v| |syntaxError| |pform| |val|) - (declare (special |$useNewParser|)) - (RETURN - (PROGN - (SPADLET |syntaxError| NIL) - (SPADLET |pform| - (COND - (|$useNewParser| - (SPADLET |v| - (|applyWithOutputToString| - '|ncParseFromString| - (CONS |string| NIL))) - (COND - ((CAR |v|) (CAR |v|)) - ('T (SPADLET |syntaxError| 'T) (CDR |v|)))) - ('T (|oldParseString| |string|)))) - (COND - (|syntaxError| "Syntax Error ") - (|pform| (SPADLET |val| - (|applyWithOutputToString| - '|processInteractive| - (CONS |pform| (CONS NIL NIL)))) - (COND - ((CAR |val|) (CAR |val|)) - ('T "Type Analysis Error"))) - ('T NIL)))))) +(defun |parseAndEval1| (|string|) + (let (|v| |syntaxError| |pform| |val|) + (setq |syntaxError| nil) + (setq |pform| + (progn + (setq |v| + (|applyWithOutputToString| '|ncParseFromString| (cons |string| nil))) + (cond + ((car |v|) (car |v|)) + (t (setq |syntaxError| t) (cdr |v|))))) + (cond + (|syntaxError| "Syntax Error ") + (|pform| + (setq |val| + (|applyWithOutputToString| '|processInteractive| + (cons |pform| (list nil)))) + (cond + ((car |val|) (car |val|)) + (t "Type Analysis Error"))) + (t nil)))) ;oldParseString string == ; tree := applyWithOutputToString('string2SpadTree, [string]) diff --git a/src/interp/nci.lisp.pamphlet b/src/interp/nci.lisp.pamphlet index 28afa58..6e5fba6 100644 --- a/src/interp/nci.lisp.pamphlet +++ b/src/interp/nci.lisp.pamphlet @@ -15,14 +15,6 @@ ;; Interpreter interface to new compiler -(defun |ncParseAndInterpretString| (s) - (|processInteractive| - (|packageTran| (|parseFromString| s)) - NIL )) - -(defun |parseFromString| (s) - (setq s (|next| #'|ncloopParse| (|next| #'|lineoftoks| (|incString| s)))) - (unless (|StreamNull| s) (|pf2Sex| (|macroExpanded| (cadar s))))) (defun |ncParseFromString| (s) (|zeroOneTran| (|packageTran| @@ -41,20 +33,11 @@ (setq *package* (find-package (string package))) (|packageTran| sex))) -(defun |ncSetCurrentLine| (c) - (|setCurrentLine| c)) - (defun |applyInPackage| (fun args package) (let ((*package* (find-package (string package)))) (declare (special *package*)) (apply fun args))) -(defun |displayParserMacro| (m) - (let ((m (assq m |$pfMacros|))) - (declare (special |$pfMacros|)) - (cond ((null m) nil) - (t (|pfPrintSrcLines| (CADDR m)))))) - @ \eject diff --git a/src/interp/varini.lisp.pamphlet b/src/interp/varini.lisp.pamphlet index 2ea8944..4dc3895 100644 --- a/src/interp/varini.lisp.pamphlet +++ b/src/interp/varini.lisp.pamphlet @@ -13,11 +13,6 @@ (IN-PACKAGE "BOOT") -;-- Variables to control whether old software calls the new compiler. - -(EVAL-WHEN (EVAL LOAD) -(setq |$useNewParser| t) - (defvar |$ncConverse| NIL) (defvar |$newcompMode| NIL ")comp means new compiler.") (defvar |$newComp| T "Start workspace in new compiler.")