1 |
(* export-lex.sml |
(* export-lex.sml |
2 |
* |
* |
3 |
* $Log$ |
* $Log$ |
4 |
|
* Revision 1.2 2000/03/07 04:01:05 blume |
5 |
|
* - size info in BOOTLIST |
6 |
|
* * no fixed upper limits for number of bootfiles or length of |
7 |
|
* bootfile names in runtime |
8 |
|
* * falling back to old behavior if no BOOTLIST size info found |
9 |
|
* - allocation size heuristics in .run-sml |
10 |
|
* * tries to read cache size from /proc/cpuinfo (this is important for |
11 |
|
* small-cache Celeron systems!) |
12 |
|
* - install.sh robustified |
13 |
|
* - CM manual updates |
14 |
|
* - paranoid mode |
15 |
|
* * no more CMB.deliver() (i.e., all done by CMB.make()) |
16 |
|
* * can re-use existing sml.boot.* files |
17 |
|
* * init.cmi now treated as library |
18 |
|
* * library stamps for consistency checks |
19 |
|
* - sml.boot.<arch>-<os>/PIDMAP file |
20 |
|
* * This file is read by the CM startup code. This is used to minimize |
21 |
|
* the amount of dynamic state that needs to be stowed away for the |
22 |
|
* purpose of sharing between interactive system and user code. |
23 |
|
* - CM.Anchor.anchor instead of CM.Anchor.{set,cancel} |
24 |
|
* * Upon request by Elsa. Anchors now controlled by get-set-pair |
25 |
|
* like most other CM state variables. |
26 |
|
* - Compiler.CMSA eliminated |
27 |
|
* * No longer supported by CM anyway. |
28 |
|
* - fixed bugs in pickler that kept biting Stefan |
29 |
|
* * past refs to past refs (was caused by the possibility that |
30 |
|
* ad-hoc sharing is more discriminating than hash-cons sharing) |
31 |
|
* * integer overflow on LargeInt.minInt |
32 |
|
* - ml-{lex,yacc} build scripts now use new mechanism |
33 |
|
* for building standalone programs |
34 |
|
* - fixed several gcc -Wall warnings that were caused by missing header |
35 |
|
* files, missing initializations, etc., in runtime (not all warnings |
36 |
|
* eliminated, though) |
37 |
|
* |
38 |
|
* Revision 1.1.1.9.4.1 2000/02/20 14:44:33 blume |
39 |
|
* CMB.deliver merged with CMB.make; runtime boot code made more flexible |
40 |
|
* |
41 |
* Revision 1.1.1.9 1999/12/07 15:40:25 monnier |
* Revision 1.1.1.9 1999/12/07 15:40:25 monnier |
42 |
* version 110.25 |
* version 110.25 |
43 |
* |
* |
61 |
*) |
*) |
62 |
|
|
63 |
structure ExportLexGen : sig |
structure ExportLexGen : sig |
|
|
|
|
val export : string -> unit |
|
64 |
val lexGen : (string * string list) -> OS.Process.status |
val lexGen : (string * string list) -> OS.Process.status |
|
|
|
65 |
end = struct |
end = struct |
66 |
|
|
67 |
exception Interrupt |
exception Interrupt |
87 |
fun err msg = TextIO.output(TextIO.stdErr, String.concat msg) |
fun err msg = TextIO.output(TextIO.stdErr, String.concat msg) |
88 |
|
|
89 |
fun lexGen (name, args) = let |
fun lexGen (name, args) = let |
90 |
fun lex_gen () = (case args |
fun lex_gen () = |
91 |
of [] => ( |
case args of |
92 |
err [name, ": missing filename\n"]; |
[] => (err [name, ": missing filename\n"]; |
93 |
OS.Process.exit OS.Process.failure) |
OS.Process.exit OS.Process.failure) |
94 |
| files => List.app LexGen.lexGen files |
| files => List.app LexGen.lexGen files |
|
(* end case *)) |
|
95 |
in |
in |
96 |
(handleInterrupt lex_gen; OS.Process.success) |
(handleInterrupt lex_gen; OS.Process.success) |
97 |
handle Interrupt => ( |
handle Interrupt => (err [name, ": Interrupt\n"]; OS.Process.failure) |
98 |
err [name, ": Interrupt\n"]; |
| any => (err [name, ": uncaught exception ", |
99 |
OS.Process.failure) |
exnMessage any, "\n"]; |
|
| any => ( |
|
|
err [ |
|
|
name, ": uncaught exception ", exnMessage any, "\n" |
|
|
]; |
|
100 |
OS.Process.failure) |
OS.Process.failure) |
101 |
end |
end |
|
|
|
|
fun export name = SMLofNJ.exportFn (name, lexGen); |
|
102 |
end |
end |