SCM Repository
Annotation of /sml/branches/SMLNJ/src/compiler/TopLevel/bootstrap/int-sys.sml
Parent Directory
|
Revision Log
Revision 172 - (view) (download)
1 : | monnier | 171 | (* Copyright 1997 by AT&T Bell Laboratories *) |
2 : | (* Copyright 1998 by Lucent Technologies *) | ||
3 : | (* int-sys.sml *) | ||
4 : | |||
5 : | (* | ||
6 : | * This is the interactive system; | ||
7 : | * At link-time (i.e., at bootstrap time) this code builds the boot | ||
8 : | * environments, sets default signal handlers, and then goes interactive. | ||
9 : | * | ||
10 : | * This code refers directly to structure Compiler, because by the time it | ||
11 : | * gets compiled, CM's conditional compilation facility has already | ||
12 : | * made sure that structure Compiler refers to the visible compiler | ||
13 : | * for the current architecture. | ||
14 : | *) | ||
15 : | structure InteractiveSystem : sig end = struct | ||
16 : | |||
17 : | (* environment initializations *) | ||
18 : | val pervasive = BootEnv.bootEnv () | ||
19 : | val _ = #set Compiler.EnvRef.pervasive (Compiler.CoerceEnv.b2e pervasive) | ||
20 : | |||
21 : | (* establish default signal handlers *) | ||
22 : | fun handleINT _ = !Unsafe.topLevelCont | ||
23 : | fun handleTERM _ = OS.Process.exit OS.Process.failure | ||
24 : | fun ifSignal (sigName, handler) = | ||
25 : | (case Signals.fromString sigName of | ||
26 : | SOME s => | ||
27 : | (Signals.overrideHandler (s, Signals.HANDLER handler); ()) | ||
28 : | | _ => ()) | ||
29 : | |||
30 : | val _ = | ||
31 : | (Signals.overrideHandler (Signals.sigINT, Signals.HANDLER handleINT); | ||
32 : | Signals.overrideHandler (Signals.sigTERM, Signals.HANDLER handleTERM); | ||
33 : | ifSignal ("QUIT", handleTERM)) | ||
34 : | |||
35 : | (* launch interactive loop *) | ||
36 : | val _ = (Compiler.Control.Print.say "Go for it\n"; | ||
37 : | Compiler.Interact.interact()) | ||
38 : | end | ||
39 : | |||
40 : | (* | ||
41 : | * $Log$ | ||
42 : | *) |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |