Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /ml-lex/releases/release-110.78/export-lex.sml
ViewVC logotype

Annotation of /ml-lex/releases/release-110.78/export-lex.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 569 - (view) (download)
Original Path: sml/trunk/src/ml-lex/export-lex.sml

1 : monnier 249 (* export-lex.sml
2 :     *
3 :     * $Log$
4 : blume 569 * 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 : monnier 498 * Revision 1.1.1.9 1999/12/07 15:40:25 monnier
42 :     * version 110.25
43 : monnier 249 *
44 :     * Revision 1.2 1997/03/03 17:10:35 george
45 :     * moved callcc related functions to SMLofNJ.Cont
46 :     *
47 :     # Revision 1.1.1.1 1997/01/14 01:38:01 george
48 :     # Version 109.24
49 :     #
50 :     * Revision 1.3 1996/02/26 16:55:18 jhr
51 :     * Moved exportFn/exportML to SMLofNJ structure.
52 :     *
53 :     * Revision 1.2 1996/02/26 15:02:26 george
54 :     * print no longer overloaded.
55 :     * use of makestring has been removed and replaced with Int.toString ..
56 :     * use of IO replaced with TextIO
57 :     *
58 :     * Revision 1.1.1.1 1996/01/31 16:01:15 george
59 :     * Version 109
60 :     *
61 :     *)
62 :    
63 :     structure ExportLexGen : sig
64 :     val lexGen : (string * string list) -> OS.Process.status
65 : blume 569 end = struct
66 : monnier 249
67 :     exception Interrupt
68 :    
69 :     (* This function applies operation to (). If it handles an interrupt
70 :     * signal (Control-C), it raises the exception Interrupt. Example:
71 :     * (handleInterrupt foo) handle Interrupt => print "Bang!\n"
72 :     *)
73 :     fun handleInterrupt (operation : unit -> unit) =
74 :     let exception Done
75 :     val old'handler = Signals.inqHandler(Signals.sigINT)
76 :     fun reset'handler () =
77 :     Signals.setHandler(Signals.sigINT, old'handler)
78 :     in (SMLofNJ.Cont.callcc (fn k =>
79 :     (Signals.setHandler(Signals.sigINT, Signals.HANDLER(fn _ => k));
80 :     operation ();
81 :     raise Done));
82 :     raise Interrupt)
83 :     handle Done => (reset'handler ())
84 :     | exn => (reset'handler (); raise exn)
85 :     end
86 :    
87 :     fun err msg = TextIO.output(TextIO.stdErr, String.concat msg)
88 :    
89 :     fun lexGen (name, args) = let
90 : blume 569 fun lex_gen () =
91 :     case args of
92 :     [] => (err [name, ": missing filename\n"];
93 :     OS.Process.exit OS.Process.failure)
94 :     | files => List.app LexGen.lexGen files
95 :     in
96 :     (handleInterrupt lex_gen; OS.Process.success)
97 :     handle Interrupt => (err [name, ": Interrupt\n"]; OS.Process.failure)
98 :     | any => (err [name, ": uncaught exception ",
99 :     exnMessage any, "\n"];
100 :     OS.Process.failure)
101 :     end
102 :     end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0