diff --git a/books/bookvol9.pamphlet b/books/bookvol9.pamphlet index cfd7560..36c7650 100644 --- a/books/bookvol9.pamphlet +++ b/books/bookvol9.pamphlet @@ -2624,6 +2624,109 @@ It is pretty much just a translation of DEF-IS-REV @ +\chapter{PARSE forms} +\defun{PARSE-NewExpr}{PARSE-NewExpr} +\calls{PARSE-NewExpr}{match-string} +\calls{PARSE-NewExpr}{action} +\calls{PARSE-NewExpr}{processSynonyms} +\calls{PARSE-NewExpr}{must} +\calls{PARSE-NewExpr}{current-symbol} +\calls{PARSE-NewExpr}{PARSE-Statement} +\uses{PARSE-NewExpr}{definition-name} +<>= +(defun |PARSE-NewExpr| () + (or (and (match-string ")") (action (|processSynonyms|)) + (must (|PARSE-Command|))) + (and (action (setq definition_name (current-symbol))) + (|PARSE-Statement|)))) + +@ + +\defun{PARSE-Command}{PARSE-Command} +\calls{PARSE-Command}{match-advance-string} +\calls{PARSE-Command}{must} +\calls{PARSE-Command}{PARSE-SpecialKeyWord} +\calls{PARSE-Command}{PARSE-SpecialCommand} +\calls{PARSE-Command}{push-reduction} +<>= +(defun |PARSE-Command| () + (and (match-advance-string ")") (must (|PARSE-SpecialKeyWord|)) + (must (|PARSE-SpecialCommand|)) + (push-reduction '|PARSE-Command| nil))) + +@ + +\defun{PARSE-SpecialKeyWord}{PARSE-SpecialKeyWord} +\calls{PARSE-SpecialKeyWord}{match-current-token} +\calls{PARSE-SpecialKeyWord}{action} +\calls{PARSE-SpecialKeyWord}{token-symbol} +\calls{PARSE-SpecialKeyWord}{current-token} +\calls{PARSE-SpecialKeyWord}{unAbbreviateKeyword} +\calls{PARSE-SpecialKeyWord}{current-symbol} +<>= +(defun |PARSE-SpecialKeyWord| () + (and (match-current-token 'identifier) + (action (setf (token-symbol (current-token)) + (|unAbbreviateKeyword| (current-symbol)))))) + +@ + +\defun{PARSE-SpecialCommand}{PARSE-SpecialCommand} +\calls{PARSE-SpecialCommand}{match-advance-string} +\calls{PARSE-SpecialCommand}{bang} +\calls{PARSE-SpecialCommand}{optional} +\calls{PARSE-SpecialCommand}{PARSE-Expression} +\calls{PARSE-SpecialCommand}{push-reduction} +\calls{PARSE-SpecialCommand}{PARSE-SpecialCommand} +\calls{PARSE-SpecialCommand}{pop-stack-1} +\calls{PARSE-SpecialCommand}{PARSE-CommandTail} +\calls{PARSE-SpecialCommand}{must} +\calls{PARSE-SpecialCommand}{current-symbol} +\calls{PARSE-SpecialCommand}{action} +\calls{PARSE-SpecialCommand}{PARSE-TokenList} +\calls{PARSE-SpecialCommand}{PARSE-TokenCommandTail} +\calls{PARSE-SpecialCommand}{star} +\calls{PARSE-SpecialCommand}{PARSE-PrimaryOrQM} +\calls{PARSE-SpecialCommand}{PARSE-CommandTail} +\usesdollar{PARSE-SpecialCommand}{noParseCommands} +\usesdollar{PARSE-SpecialCommand}{tokenCommands} +<>= +(defun |PARSE-SpecialCommand| () + (declare (special $noParseCommands $tokenCommands)) + (or (and (match-advance-string "show") + (bang fil_test + (optional + (or (match-advance-string "?") + (|PARSE-Expression|)))) + (push-reduction '|PARSE-SpecialCommand| + (cons '|show| (cons (pop-stack-1) nil))) + (must (|PARSE-CommandTail|))) + (and (member (current-symbol) |$noParseCommands|) + (action (funcall (current-symbol)))) + (and (member (current-symbol) |$tokenCommands|) + (|PARSE-TokenList|) (must (|PARSE-TokenCommandTail|))) + (and (star repeator (|PARSE-PrimaryOrQM|)) + (must (|PARSE-CommandTail|))))) + +@ + +\defun{PARSE-TokenList}{PARSE-TokenList} +\calls{PARSE-TokenList}{star} +\calls{PARSE-TokenList}{isTokenDelimiter} +\calls{PARSE-TokenList}{push-reduction} +\calls{PARSE-TokenList}{current-symbol} +\calls{PARSE-TokenList}{action} +\calls{PARSE-TokenList}{advance-token} +<>= +(defun |PARSE-TokenList| () + (star repeator + (and (not (|isTokenDelimiter|)) + (push-reduction '|PARSE-TokenList| (current-symbol)) + (action (advance-token))))) + +@ + + \chapter{The Compiler} \section{Compiling EQ.spad} @@ -5782,6 +5885,11 @@ if \verb|$InteractiveMode| then use a null outputstream <> <> +<> +<> +<> +<> +<> <> <> <> diff --git a/changelog b/changelog index 3c41619..d3dd704 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,9 @@ +20101015 tpd src/axiom-website/patches.html 20101015.03.tpd.patch +20101015 tpd src/interp/parsing.lisp treeshake compiler +20101015 tpd books/bookvol9 treeshake compiler 20101015 tpd src/axiom-website/patches.html 20101015.02.tpd.patch 20101015 tpd src/interp/parsing.lisp treeshake compiler -20101014 tpd books/bookvol9 treeshake compiler +20101015 tpd books/bookvol9 treeshake compiler 20101015 tpd src/axiom-website/patches.html 20101015.01.tpd.patch 20101015 tpd books/bookvol5 latex cleanup 20101014 tpd src/axiom-website/patches.html 20101014.01.tpd.patch diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 4f61283..1e68beb 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -3216,5 +3216,7 @@ books/bookvol9 treeshake compiler
books/bookvol5 latex cleanup
20101015.02.tpd.patch books/bookvol9 treeshake compiler
+20101015.03.tpd.patch +books/bookvol9 treeshake compiler
diff --git a/src/interp/parsing.lisp.pamphlet b/src/interp/parsing.lisp.pamphlet index 50ad7d5..bccff1c 100644 --- a/src/interp/parsing.lisp.pamphlet +++ b/src/interp/parsing.lisp.pamphlet @@ -1928,54 +1928,6 @@ fnewmeta (DEFPARAMETER LABLASOC NIL) -(DEFUN |PARSE-NewExpr| () - (OR (AND (MATCH-STRING ")") (ACTION (|processSynonyms|)) - (MUST (|PARSE-Command|))) - (AND (ACTION (SETQ DEFINITION_NAME (CURRENT-SYMBOL))) - (|PARSE-Statement|)))) -(trace |PARSE-NewExpr|) - - -(DEFUN |PARSE-Command| () - (AND (MATCH-ADVANCE-STRING ")") (MUST (|PARSE-SpecialKeyWord|)) - (MUST (|PARSE-SpecialCommand|)) - (PUSH-REDUCTION '|PARSE-Command| NIL))) -(trace |PARSE-Command|) - - -(DEFUN |PARSE-SpecialKeyWord| () - (AND (MATCH-CURRENT-TOKEN 'IDENTIFIER) - (ACTION (SETF (TOKEN-SYMBOL (CURRENT-TOKEN)) - (|unAbbreviateKeyword| (CURRENT-SYMBOL)))))) -(trace |PARSE-SpecialKeyWord|) - - -(DEFUN |PARSE-SpecialCommand| () - (OR (AND (MATCH-ADVANCE-STRING "show") - (BANG FIL_TEST - (OPTIONAL - (OR (MATCH-ADVANCE-STRING "?") - (|PARSE-Expression|)))) - (PUSH-REDUCTION '|PARSE-SpecialCommand| - (CONS '|show| (CONS (POP-STACK-1) NIL))) - (MUST (|PARSE-CommandTail|))) - (AND (MEMBER (CURRENT-SYMBOL) |$noParseCommands|) - (ACTION (FUNCALL (CURRENT-SYMBOL)))) - (AND (MEMBER (CURRENT-SYMBOL) |$tokenCommands|) - (|PARSE-TokenList|) (MUST (|PARSE-TokenCommandTail|))) - (AND (STAR REPEATOR (|PARSE-PrimaryOrQM|)) - (MUST (|PARSE-CommandTail|))))) -(trace |PARSE-SpecialCommand|) - - -(DEFUN |PARSE-TokenList| () - (STAR REPEATOR - (AND (NOT (|isTokenDelimiter|)) - (PUSH-REDUCTION '|PARSE-TokenList| (CURRENT-SYMBOL)) - (ACTION (ADVANCE-TOKEN))))) -(trace |PARSE-TokenList|) - - (DEFUN |PARSE-TokenCommandTail| () (AND (BANG FIL_TEST (OPTIONAL (STAR REPEATOR (|PARSE-TokenOption|)))) (|atEndOfLine|)