aboutsummaryrefslogtreecommitdiff
path: root/src/interp/compiler.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-12-11 22:55:24 +0000
committerdos-reis <gdr@axiomatics.org>2008-12-11 22:55:24 +0000
commit747aae4a7e6de144f8692e68c04ba17bae47dc9d (patch)
tree3d35d18bd3f5955e9c3a0ddd60339b2dcfc937de /src/interp/compiler.boot
parent8f409fc75c64b9c486ec74419de9785c00629a17 (diff)
downloadopen-axiom-747aae4a7e6de144f8692e68c04ba17bae47dc9d.tar.gz
r12436@gauss: gdr | 2008-12-09 21:32:50 -0600
Modularize S-PROCESS.
Diffstat (limited to 'src/interp/compiler.boot')
-rw-r--r--src/interp/compiler.boot35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 5aa9e6cb..78a8145c 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -1874,6 +1874,41 @@ compMatch(["%Match",subject,altBlock],m,e) ==
code := ["LET",[[sn,se]],["COND",:nreverse altsCode]]
[code,m,savedEnv]
+
+--% Entry point to the compiler
+
+preprocessParseTree pt ==
+ $postStack := []
+ pf := parseTransform postTransform pt
+ $postStack = nil => pf
+ displayPreCompilationErrors()
+ nil
+
+++ Takes a parse tree `pt', typecheck it and compile it down
+++ to VM instructions.
+compileParseTree pt ==
+ pt = nil => nil
+ CURSTRM: local := $OutputStream
+ pf := preprocessParseTree pt
+ pf = nil => nil -- stop if preprocessing was a disaster.
+ -- Don't go further if only preprocessing was requested.
+ $PrintOnly =>
+ FORMAT(true,'"~S =====>~%",$currentLine)
+ PRETTYPRINT pf
+ -- Now start actual compilation.
+ $x: local := nil -- ???
+ $m: local := nil -- ???
+ $s: local := nil -- ???
+ $exitModeStack: local := [] -- Used by the compiler proper
+ -- We don't usually call the compiler to process interpreter
+ -- input, however attempt to second guess nevertheless.
+ if $InteractiveMode then
+ processInteractive(pf,nil)
+ else if T := compTopLevel(pf,$EmptyMode,$InteractiveFrame) then
+ [.,.,$InteractiveFrame] := T
+ TERPRI()
+
+
--% Register compilers for special forms.
-- Those compilers are on the `SPECIAL' property of the corresponding
-- special form operator symbol.