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 /sml/branches/SMLNJ/src/MLRISC/emit/asmStream.sml
ViewVC logotype

Annotation of /sml/branches/SMLNJ/src/MLRISC/emit/asmStream.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 245 - (view) (download)

1 : monnier 245 (* asmStream.sml
2 :     *
3 :     * COPYRIGHT (c) 1996 Bell Laboratories.
4 :     *
5 :     *)
6 :    
7 :     (* AsmStream - this structure is available to all codegenerators.
8 :     * Typically asmOutStream is rebound to a file.
9 :     *)
10 :    
11 :     signature ASM_STREAM = sig
12 :     val asmOutStream : TextIO.outstream ref
13 :     val withStream : TextIO.outstream -> ('a -> 'b) -> 'a -> 'b
14 :     end
15 :    
16 :     structure AsmStream : ASM_STREAM = struct
17 :     val asmOutStream = ref TextIO.stdOut
18 :     fun withStream stream body x = let
19 :     val s = !asmOutStream
20 :     val _ = asmOutStream := stream
21 :     in
22 :     (body x before asmOutStream := s)
23 :     handle e => (asmOutStream := s; raise e)
24 :     end
25 :     end
26 :    
27 :    
28 :    
29 :     (*
30 :     * $Log: asmStream.sml,v $
31 :     * Revision 1.1.1.1 1998/11/16 21:48:19 george
32 :     * Version 110.10
33 :     *
34 :     * Revision 1.2 1998/10/06 14:07:43 george
35 :     * Flowgraph has been removed from modules that do not need it.
36 :     * Changes to compiler/CodeGen/*/*{MLTree,CG}.sml necessary.
37 :     * [leunga]
38 :     *
39 :     * Revision 1.1.1.1 1998/04/08 18:39:01 george
40 :     * Version 110.5
41 :     *
42 :     *)

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