diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet index d29044e..a13e07a 100644 --- a/books/bookvol5.pamphlet +++ b/books/bookvol5.pamphlet @@ -34563,6 +34563,86 @@ searchCurrentEnv(x,currentEnv) == \end{chunk} +\defun{spad-syntax-error}{spad-syntax-error} +\calls{spad-syntax-error}{bumperrorcount} +\calls{spad-syntax-error}{consoleinputp} +\calls{spad-syntax-error}{spad-long-error} +\calls{spad-syntax-error}{spad-short-error} +\calls{spad-syntax-error}{ioclear} +\uses{spad-syntax-error}{debugmode} +\throws{spad-syntax-error}{spad-reader} +\begin{chunk}{defun spad-syntax-error} +(defun spad-syntax-error (&rest byebye) + "Print syntax error indication, underline character, scrub line." + (declare (special debugmode)) + (bumperrorcount '|syntax|) + (cond ((and (eq debugmode 'yes) (not(consoleinputp in-stream))) + (spad_long_error)) + ((spad_short_error))) + (ioclear) + (throw 'spad_reader nil)) + +\end{chunk} + +\defun{spad-long-error}{spad-long-error} +\calls{spad-long-error}{spad-error-loc} +\calls{spad-long-error}{iostat} +\uses{spad-long-error}{out-stream} +\uses{spad-long-error}{spaderrorstream} +\begin{chunk}{defun spad-long-error} +(defun spad-long-error () + (spad-error-loc spaderrorstream) + (iostat) + (unless (equal out-stream spaderrorstream) + (spad-error-loc out-stream) + (terpri out-stream))) + +\end{chunk} + +\defun{spad-short-error}{spad-short-error} +\calls{spad-short-error}{line-past-end-p} +\calls{spad-short-error}{line-print} +\usesstruct{spad-short-error}{current-line} +\begin{chunk}{defun spad-short-error} +(defun spad-short-error () + (if (line-past-end-p Current-Line) + (format t "~&The current line is empty.~%") + (progn + (format t "~&The current line is:~%~%") + (line-print current-line)))) + +\end{chunk} + +\defun{spad-error-loc}{spad-error-loc} +\begin{chunk}{defun spad-error-loc} +(defun spad-error-loc (str) + (format str "******** Boot Syntax Error detected ********")) + +\end{chunk} + +\defun{iostat}{iostat} +\calls{iostat}{line-past-end-p} +\calls{iostat}{line-print} +\calls{iostat}{token-stack-show} +\calls{iostat}{next-lines-show} +\usesdollar{iostat}{boot} +\usesdollar{iostat}{spad} +\usesstruct{iostat}{current-line} +\begin{chunk}{defun iostat} +(defun iostat () + "Tell me what the current state of the parsing world is." + (declare (special $boot $spad)) + (if (line-past-end-p Current-Line) + (format t "~&The current line is empty.~%") + (progn + (format t "~&The current line is:~%~%") + (line-print current-line))) + (if (or $boot $spad) (next-lines-show)) + (token-stack-show) + nil) + +\end{chunk} + \defun{ioclear}{ioclear} The IO state manipulation routines assume that \begin{itemize} @@ -40204,6 +40284,7 @@ This needs to work off the internal exposure list, not the file. \getchunk{defun intProcessSynonyms} \getchunk{defun intSayKeyedMsg} \getchunk{defun ioclear} +\getchunk{defun iostat} \getchunk{defun isDomainOrPackage} \getchunk{defun isgenvar} \getchunk{defun isInterpOnlyMap} @@ -40890,14 +40971,18 @@ This needs to work off the internal exposure list, not the file. \getchunk{defun Skipping?} \getchunk{defun spad} \getchunk{defun spadClosure?} +\getchunk{defun spad-error-loc} \getchunk{defun SpadInterpretStream} +\getchunk{defun spad-long-error} \getchunk{defun spadReply} \getchunk{defun spadReply,printName} \getchunk{defun spadrread} \getchunk{defun spadrwrite} \getchunk{defun spadrwrite0} \getchunk{defun spad-save} +\getchunk{defun spad-short-error} \getchunk{defun spadStartUpMsgs} +\getchunk{defun spad-syntax-error} \getchunk{defun spadTrace} \getchunk{defun spadTraceAlias} \getchunk{defun spadTrace,g} diff --git a/changelog b/changelog index 0958637..bfbb7ed 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +20110503 tpd src/axiom-website/patches.html 20110503.01.tpd.patch +20110503 tpd src/interp/parsing.lisp treeshake interpreter +20110503 tpd books/bookvol5 treeshake interpreter 20110424 wxh src/axiom-website/patches.html 20110424.01.tpd.patch 20110424 wxh src/input/Makefile add erf.input 20110424 wxh src/input/erf.input add examples of erf integration diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 3e842c3..9d03be3 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -3462,5 +3462,7 @@ src/axiom-websilte/download.html add debian mar2011
src/axiom-websilte/download.html add opensuse mar2011
20110424.01.tpd.patch src/input/erf.input add examples of erf integration
+20110503.01.tpd.patch +books/bookvol5 treeshake interpreter
diff --git a/src/interp/parsing.lisp.pamphlet b/src/interp/parsing.lisp.pamphlet index ac85dc1..4c1a8b4 100644 --- a/src/interp/parsing.lisp.pamphlet +++ b/src/interp/parsing.lisp.pamphlet @@ -364,20 +364,6 @@ top \end{chunk} \section{Routines for inspecting and resetting total I/O system state} -\begin{chunk}{*} -(defun IOStat () - "Tell me what the current state of the parsing world is." - (if (line-past-end-p Current-Line) - (format t "~&The current line is empty.~%") - (progn - (format t "~&The current line is:~%~%") - (Line-Print Current-Line))) - (if (or $BOOT $SPAD) (next-lines-show)) - (token-stack-show) - nil) - -\end{chunk} - bootlex \begin{chunk}{*} @@ -607,31 +593,7 @@ or the chracters ?, !, ' or %" ; **** 5. BOOT Error Handling -(defun SPAD-SYNTAX-ERROR (&rest byebye) - "Print syntax error indication, underline character, scrub line." - (BUMPERRORCOUNT '|syntax|) - (COND ((AND (EQ DEBUGMODE 'YES) (NOT(CONSOLEINPUTP IN-STREAM))) - (SPAD_LONG_ERROR)) - ((SPAD_SHORT_ERROR))) - (IOClear) - (throw 'spad_reader nil)) - -(defun SPAD_LONG_ERROR () - (SPAD_ERROR_LOC SPADERRORSTREAM) - (iostat) - (unless (EQUAL OUT-STREAM SPADERRORSTREAM) - (SPAD_ERROR_LOC OUT-STREAM) - (TERPRI OUT-STREAM))) - -(defun SPAD_SHORT_ERROR () - (if (line-past-end-p Current-Line) - (format t "~&The current line is empty.~%") - (progn - (format t "~&The current line is:~%~%") - (Line-Print Current-Line)))) - -(defun SPAD_ERROR_LOC (STR) - (format str "******** Boot Syntax Error detected ********")) + ; NAME: Def