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

SCM Repository

[smlnj] View of /sml/trunk/src/MLRISC/visualization/graphViewer.sml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 245 - (download) (annotate)
Sat Apr 17 18:47:12 1999 UTC (20 years, 7 months ago) by monnier
Original Path: sml/branches/SMLNJ/src/MLRISC/visualization/graphViewer.sml
File size: 936 byte(s)
version 110.16
functor GraphViewerFn(D : GRAPH_DISPLAY) : GRAPH_VIEWER =
struct

   structure L = GraphLayout
   structure G = Graph
   structure FileSys = OS.FileSys

   fun display exec (layout as G.GRAPH l) filename = 
      let val filename  = filename ^ D.suffix()
	  val _     = print("[ "^ #name l^": "^ 
                            D.program() ^ " " ^ filename ^ " ]\n")
          val file  = TextIO.openOut filename
          val out   = fn s => TextIO.output(file,s)
          val _     = D.visualize out layout
          val _     = TextIO.closeOut file
          val _     = exec filename
      in  
          ()
      end handle e => 
        (print("[Uncaught exception in "^exnName e^" graph viewer]\n"); raise e)

   fun system filename = (OS.Process.system 
			   ((D.program()) ^ " " ^ filename);
                          FileSys.remove filename)

   fun view layout = display system layout (FileSys.tmpName())
end

(*
 * $Log$
 *)

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