aboutsummaryrefslogtreecommitdiff
path: root/src/boot/strap/translator.clisp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2012-05-29 23:50:08 +0000
committerdos-reis <gdr@axiomatics.org>2012-05-29 23:50:08 +0000
commit6c9b37fd68b558bced11d67cfc798ca96800bc79 (patch)
treeccc64628c69ca1d1fcb71c7b20c030d896d62d05 /src/boot/strap/translator.clisp
parentd310a5d012161a4515d5c9e96e992fc6977d8f6b (diff)
downloadopen-axiom-6c9b37fd68b558bced11d67cfc798ca96800bc79.tar.gz
* boot/parser.boot (%ParserState): New.
(makeParserState): Likewise. (%Translator): Likewise. (makeTranslator): Likewise. Make all parsing functions take a parser state argument. * boot/translator.boot (shoeOutParse): Adjust. * interp/spad-parser.boot (stringPrefix?): Remove redudant definition.
Diffstat (limited to 'src/boot/strap/translator.clisp')
-rw-r--r--src/boot/strap/translator.clisp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/boot/strap/translator.clisp b/src/boot/strap/translator.clisp
index 37d7aa38..d71a5351 100644
--- a/src/boot/strap/translator.clisp
+++ b/src/boot/strap/translator.clisp
@@ -431,13 +431,14 @@
(DEFUN |shoeAddComment| (|l|) (CONCAT "; " (CAR |l|)))
-(DEFUN |shoeOutParse| (|stream|)
- (LET* (|found|)
+(DEFUN |shoeOutParse| (|toks|)
+ (LET* (|found| |ps|)
(DECLARE
(SPECIAL |$bpParenCount| |$bpCount| |$returns| |$typings| |$wheredefs|
|$op| |$ttok| |$stok| |$stack| |$inputStream|))
(PROGN
- (SETQ |$inputStream| |stream|)
+ (SETQ |$inputStream| |toks|)
+ (SETQ |ps| (|makeParserState| |toks|))
(SETQ |$stack| NIL)
(SETQ |$stok| NIL)
(SETQ |$ttok| NIL)
@@ -449,7 +450,8 @@
(SETQ |$bpParenCount| 0)
(|bpFirstTok|)
(SETQ |found|
- (LET ((#1=#:G729 (CATCH :OPEN-AXIOM-CATCH-POINT (|bpOutItem|))))
+ (LET ((#1=#:G729
+ (CATCH :OPEN-AXIOM-CATCH-POINT (|bpOutItem| |ps|))))
(COND
((AND (CONSP #1#) (EQUAL (CAR #1#) :OPEN-AXIOM-CATCH-POINT))
(COND
@@ -1196,23 +1198,25 @@
(DEFUN BOOTLOOP ()
(LET* (|stream| |a|)
+ (DECLARE (SPECIAL |$stdio| |$stdin|))
(PROGN
- (SETQ |a| (|readLine| *STANDARD-INPUT*))
+ (SETQ |a| (|readLine| |$stdin|))
(COND
((EQL (LENGTH |a|) 0) (WRITE-LINE "Boot Loop; to exit type ] ")
(BOOTLOOP))
- ((|shoePrefix?| ")console" |a|) (SETQ |stream| *TERMINAL-IO*)
+ ((|shoePrefix?| ")console" |a|) (SETQ |stream| |$stdio|)
(PSTTOMC (|bRgen| |stream|)) (BOOTLOOP))
((CHAR= (SCHAR |a| 0) (|char| '])) NIL)
(T (PSTTOMC (LIST |a|)) (BOOTLOOP))))))
(DEFUN BOOTPO ()
(LET* (|stream| |a|)
+ (DECLARE (SPECIAL |$stdio| |$stdin|))
(PROGN
- (SETQ |a| (|readLine| *STANDARD-INPUT*))
+ (SETQ |a| (|readLine| |$stdin|))
(COND
((EQL (LENGTH |a|) 0) (WRITE-LINE "Boot Loop; to exit type ] ") (BOOTPO))
- ((|shoePrefix?| ")console" |a|) (SETQ |stream| *TERMINAL-IO*)
+ ((|shoePrefix?| ")console" |a|) (SETQ |stream| |$stdio|)
(PSTOUT (|bRgen| |stream|)) (BOOTPO))
((CHAR= (SCHAR |a| 0) (|char| '])) NIL)
(T (PSTOUT (LIST |a|)) (BOOTPO))))))