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/trunk/src/MLRISC/visualization/graphViewer.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/visualization/graphViewer.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 245 - (view) (download)
Original Path: sml/branches/SMLNJ/src/MLRISC/visualization/graphViewer.sml

1 : monnier 245 functor GraphViewerFn(D : GRAPH_DISPLAY) : GRAPH_VIEWER =
2 :     struct
3 :    
4 :     structure L = GraphLayout
5 :     structure G = Graph
6 :     structure FileSys = OS.FileSys
7 :    
8 :     fun display exec (layout as G.GRAPH l) filename =
9 :     let val filename = filename ^ D.suffix()
10 :     val _ = print("[ "^ #name l^": "^
11 :     D.program() ^ " " ^ filename ^ " ]\n")
12 :     val file = TextIO.openOut filename
13 :     val out = fn s => TextIO.output(file,s)
14 :     val _ = D.visualize out layout
15 :     val _ = TextIO.closeOut file
16 :     val _ = exec filename
17 :     in
18 :     ()
19 :     end handle e =>
20 :     (print("[Uncaught exception in "^exnName e^" graph viewer]\n"); raise e)
21 :    
22 :     fun system filename = (OS.Process.system
23 :     ((D.program()) ^ " " ^ filename);
24 :     FileSys.remove filename)
25 :    
26 :     fun view layout = display system layout (FileSys.tmpName())
27 :     end
28 :    
29 :     (*
30 :     * $Log$
31 :     *)

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