aboutsummaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-05-04 20:56:18 +0000
committerdos-reis <gdr@axiomatics.org>2011-05-04 20:56:18 +0000
commitaccf24b495a8de5bac09572e588d9b696a130e1a (patch)
treef88693858ed460c9b92a97effd0b4fac5dca234b /src/boot
parent7c728cac1d19bad7ed597c881fa6c1c0588e0e2c (diff)
downloadopen-axiom-accf24b495a8de5bac09572e588d9b696a130e1a.tar.gz
* boot/initial-env.lisp (shoeOpenOutputFile): Remove. Adjust
callers to use outputTextFile.
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/strap/translator.clisp94
-rw-r--r--src/boot/translator.boot46
2 files changed, 79 insertions, 61 deletions
diff --git a/src/boot/strap/translator.clisp b/src/boot/strap/translator.clisp
index d0fe10fd..3ad025ec 100644
--- a/src/boot/strap/translator.clisp
+++ b/src/boot/strap/translator.clisp
@@ -159,26 +159,28 @@
(|closeFile| |a|)))))
(DEFUN |shoeClLines| (|a| |fn| |lines| |outfn|)
- (PROG (|$GenVarCounter|)
+ (PROG (|$GenVarCounter| |stream|)
(DECLARE (SPECIAL |$GenVarCounter|))
(RETURN
(COND
((NULL |a|) (|shoeNotFound| |fn|))
(T (SETQ |$GenVarCounter| 0)
- (|shoeOpenOutputFile| |stream| |outfn|
- (PROGN
- (|genOptimizeOptions| |stream|)
- (LET ((|bfVar#7| |lines|) (|line| NIL))
- (LOOP
- (COND
- ((OR (ATOM |bfVar#7|)
- (PROGN (SETQ |line| (CAR |bfVar#7|)) NIL))
- (RETURN NIL))
- (T (|shoeFileLine| |line| |stream|)))
- (SETQ |bfVar#7| (CDR |bfVar#7|))))
- (|shoeFileTrees| (|shoeTransformStream| |a|) |stream|)
- (|genModuleFinalization| |stream|)))
- |outfn|)))))
+ (UNWIND-PROTECT
+ (PROGN
+ (SETQ |stream| (|outputTextFile| |outfn|))
+ (|genOptimizeOptions| |stream|)
+ (LET ((|bfVar#7| |lines|) (|line| NIL))
+ (LOOP
+ (COND
+ ((OR (ATOM |bfVar#7|)
+ (PROGN (SETQ |line| (CAR |bfVar#7|)) NIL))
+ (RETURN NIL))
+ (T (|shoeFileLine| |line| |stream|)))
+ (SETQ |bfVar#7| (CDR |bfVar#7|))))
+ (|shoeFileTrees| (|shoeTransformStream| |a|) |stream|)
+ (|genModuleFinalization| |stream|)
+ |outfn|)
+ (|closeFile| |stream|)))))))
(DEFUN BOOTTOCLC (|fn| |out|)
(PROG (|result| |callingPackage|)
@@ -203,31 +205,32 @@
(|closeFile| |a|)))))
(DEFUN |shoeClCLines| (|a| |fn| |lines| |outfn|)
- (PROG (|$GenVarCounter|)
+ (PROG (|$GenVarCounter| |stream|)
(DECLARE (SPECIAL |$GenVarCounter|))
(RETURN
(COND
((NULL |a|) (|shoeNotFound| |fn|))
(T (SETQ |$GenVarCounter| 0)
- (|shoeOpenOutputFile| |stream| |outfn|
- (PROGN
- (|genOptimizeOptions| |stream|)
- (LET ((|bfVar#8| |lines|) (|line| NIL))
- (LOOP
- (COND
- ((OR (ATOM |bfVar#8|)
- (PROGN (SETQ |line| (CAR |bfVar#8|)) NIL))
- (RETURN NIL))
- (T (|shoeFileLine| |line| |stream|)))
- (SETQ |bfVar#8| (CDR |bfVar#8|))))
- (|shoeFileTrees|
- (|shoeTransformToFile| |stream|
- (|shoeInclude|
- (|bAddLineNumber| (|bRgen| |a|)
- (|bIgen| 0))))
- |stream|)
- (|genModuleFinalization| |stream|)))
- |outfn|)))))
+ (UNWIND-PROTECT
+ (PROGN
+ (SETQ |stream| (|outputTextFile| |outfn|))
+ (|genOptimizeOptions| |stream|)
+ (LET ((|bfVar#8| |lines|) (|line| NIL))
+ (LOOP
+ (COND
+ ((OR (ATOM |bfVar#8|)
+ (PROGN (SETQ |line| (CAR |bfVar#8|)) NIL))
+ (RETURN NIL))
+ (T (|shoeFileLine| |line| |stream|)))
+ (SETQ |bfVar#8| (CDR |bfVar#8|))))
+ (|shoeFileTrees|
+ (|shoeTransformToFile| |stream|
+ (|shoeInclude|
+ (|bAddLineNumber| (|bRgen| |a|) (|bIgen| 0))))
+ |stream|)
+ (|genModuleFinalization| |stream|)
+ |outfn|)
+ (|closeFile| |stream|)))))))
(DECLAIM (FTYPE (FUNCTION (|%String|) |%Thing|) BOOTTOMC))
@@ -535,7 +538,7 @@
(SETQ |$bpParenCount| 0)
(|bpFirstTok|)
(SETQ |found|
- (LET ((#0=#:G1362
+ (LET ((#0=#:G1364
(CATCH :OPEN-AXIOM-CATCH-POINT (|bpOutItem|))))
(COND
((AND (CONSP #0#)
@@ -832,7 +835,7 @@
(DEFUN |shoeDfu| (|a| |fn|)
(PROG (|$bfClamming| |$GenVarCounter| |$bootDefinedTwice| |$bootUsed|
- |$bootDefined| |$lispWordTable| |out|)
+ |$bootDefined| |$lispWordTable| |stream|)
(DECLARE (SPECIAL |$bfClamming| |$GenVarCounter|
|$bootDefinedTwice| |$bootUsed| |$bootDefined|
|$lispWordTable|))
@@ -847,10 +850,12 @@
(SETQ |$bootDefinedTwice| NIL) (SETQ |$GenVarCounter| 0)
(SETQ |$bfClamming| NIL)
(|shoeDefUse| (|shoeTransformStream| |a|))
- (SETQ |out| (CONCAT |fn| ".defuse"))
- (|shoeOpenOutputFile| |stream| |out|
+ (UNWIND-PROTECT
+ (PROGN
+ (SETQ |stream|
+ (|outputTextFile| (CONCAT |fn| ".defuse")))
(|shoeReport| |stream|))
- |out|)))))
+ (|closeFile| |stream|)))))))
(DEFUN |shoeReport| (|stream|)
(PROG (|b| |a|)
@@ -1147,9 +1152,12 @@
(SETQ |$GenVarCounter| 0) (SETQ |$bfClamming| NIL)
(|shoeDefUse| (|shoeTransformStream| |a|))
(SETQ |out| (CONCAT |fn| ".xref"))
- (|shoeOpenOutputFile| |stream| |out|
- (|shoeXReport| |stream|))
- |out|)))))
+ (UNWIND-PROTECT
+ (PROGN
+ (SETQ |out| (|outputTextFile| |out|))
+ (|shoeXReport| |stream|)
+ |out|)
+ (|closeFile| |stream|)))))))
(DEFUN |shoeXReport| (|stream|)
(PROG (|a| |c|)
diff --git a/src/boot/translator.boot b/src/boot/translator.boot
index 4b4e4181..2ec71dfc 100644
--- a/src/boot/translator.boot
+++ b/src/boot/translator.boot
@@ -113,12 +113,15 @@ BOOTTOCLLINES(lines, fn, outfn)==
shoeClLines(a,fn,lines,outfn)==
a=nil => shoeNotFound fn
$GenVarCounter: local := 0
- shoeOpenOutputFile(stream,outfn,_
- (genOptimizeOptions stream;
- (for line in lines repeat shoeFileLine(line,stream);
- shoeFileTrees(shoeTransformStream a,stream));
- genModuleFinalization(stream)))
- outfn
+ try
+ stream := outputTextFile outfn
+ genOptimizeOptions stream
+ for line in lines repeat
+ shoeFileLine(line,stream)
+ shoeFileTrees(shoeTransformStream a,stream)
+ genModuleFinalization stream
+ outfn
+ finally closeFile stream
++ (boottoclc "filename") translates the file "filename.boot" to
++ the common lisp file "filename.clisp" with the original boot
@@ -142,13 +145,16 @@ BOOTTOCLCLINES(lines, fn, outfn)==
shoeClCLines(a,fn,lines,outfn)==
a=nil => shoeNotFound fn
$GenVarCounter: local := 0
- shoeOpenOutputFile(stream,outfn,
- (genOptimizeOptions stream;
- for line in lines repeat shoeFileLine (line,stream);
- shoeFileTrees(shoeTransformToFile(stream,
- shoeInclude bAddLineNumber(bRgen a,bIgen 0)),stream);
- genModuleFinalization(stream)))
- outfn
+ try
+ stream := outputTextFile outfn
+ genOptimizeOptions stream
+ for line in lines repeat
+ shoeFileLine(line,stream)
+ shoeFileTrees(shoeTransformToFile(stream,
+ shoeInclude bAddLineNumber(bRgen a,bIgen 0)),stream)
+ genModuleFinalization(stream)
+ outfn
+ finally closeFile stream
++ (boottomc "filename") translates the file "filename.boot"
++ to machine code and loads it one item at a time
@@ -527,9 +533,10 @@ shoeDfu(a,fn)==
$GenVarCounter: local := 0
$bfClamming: local := false
shoeDefUse shoeTransformStream a
- out := strconc(fn,'".defuse")
- shoeOpenOutputFile(stream,out,shoeReport stream)
- out
+ try
+ stream := outputTextFile strconc(fn,'".defuse")
+ shoeReport stream
+ finally closeFile stream
shoeReport stream==
shoeFileLine('"DEFINED and not USED",stream)
@@ -643,8 +650,11 @@ shoeXref(a,fn)==
$bfClamming: local := false
shoeDefUse shoeTransformStream a
out := strconc(fn,'".xref")
- shoeOpenOutputFile(stream,out,shoeXReport stream)
- out
+ try
+ out := outputTextFile out
+ shoeXReport stream
+ out
+ finally closeFile stream
shoeXReport stream==