hetdg.hs revision 306763c67bb99228487345b32ab8c5c6cd41f23c
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder{- |
8b054cade993ef373d564b2d74c9c5a2da48f8b7Kristina SojakovaModule : $Header$
e9458b1a7a19a63aa4c179f9ab20f4d50681c168Jens ElknerCopyright : (c) Till Mossakowski, Uni Bremen 2002-2004
097b7fb3f8f90e87120d30bf37a1d89fe0ddfaf0Kristina SojakovaLicence : similar to LGPL, see HetCATS/LICENCE.txt or LIZENZ.txt
097b7fb3f8f90e87120d30bf37a1d89fe0ddfaf0Kristina Sojakova
94e2e03f6efde106de095ef4ea0ec87f74955a31Kristina SojakovaMaintainer : hets@tzi.de
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu ProdescuStability : provisional
211c5fb252e0a776baad9a4857ab198659289a4aKristina SojakovaPortability : non-portable(via imports
94e2e03f6efde106de095ef4ea0ec87f74955a31Kristina Sojakova
211c5fb252e0a776baad9a4857ab198659289a4aKristina Sojakova Temporary interface for displaying development graphs.
211c5fb252e0a776baad9a4857ab198659289a4aKristina Sojakova Should be replaced with hets in the future.
8b054cade993ef373d564b2d74c9c5a2da48f8b7Kristina Sojakova
8b054cade993ef373d564b2d74c9c5a2da48f8b7Kristina Sojakova-}
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova-- needs ghc and UniForM workbench
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova-- for the UniForM workbench:
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova-- cd into the folder where HetCATS lives
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova-- cvs co uni
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova-- configure
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova-- gmake boot
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova-- gmake packages
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakovamodule Main
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakovawhere
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakovaimport System.Environment
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakovaimport Comorphisms.LogicGraph
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakovaimport Static.AnalysisLibrary
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakovaimport System.IO
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakovaimport Static.DotGraph
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova
9d770d1ea15092156d65e2a89b081eeeb8c6b153Kristina Sojakovaimport GUI.ConvertDevToAbstractGraph
9d770d1ea15092156d65e2a89b081eeeb8c6b153Kristina Sojakova
9d770d1ea15092156d65e2a89b081eeeb8c6b153Kristina Sojakovaimport GUI.AbstractGraphView
9d770d1ea15092156d65e2a89b081eeeb8c6b153Kristina Sojakovaimport Options
9d770d1ea15092156d65e2a89b081eeeb8c6b153Kristina Sojakova
9d770d1ea15092156d65e2a89b081eeeb8c6b153Kristina Sojakovaimport Static.DevGraph
9d770d1ea15092156d65e2a89b081eeeb8c6b153Kristina Sojakova
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakovaimport Data.Char
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakovaimport DaVinciGraph
8b054cade993ef373d564b2d74c9c5a2da48f8b7Kristina Sojakovaimport GraphDisp
9d770d1ea15092156d65e2a89b081eeeb8c6b153Kristina Sojakovaimport Data.IORef
2ddc9d39235393dca2e40203dde20284db4c3deeKristina Sojakova
2c47bb55d963ff37dbae4a0a7701274fddb95fc8Christian Maederproceed fname showdg = do
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova res <- anaFile logicGraph defaultLogic defaultHetcatsOpts emptyLibEnv fname
8b054cade993ef373d564b2d74c9c5a2da48f8b7Kristina Sojakova case res of
8b054cade993ef373d564b2d74c9c5a2da48f8b7Kristina Sojakova Just (ln,_,dg,libenv) ->
9d770d1ea15092156d65e2a89b081eeeb8c6b153Kristina Sojakova if showdg then do
2c47bb55d963ff37dbae4a0a7701274fddb95fc8Christian Maeder graphMem <- initializeConverter
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder (gid,gv,cmaps) <- convertGraph graphMem ln libenv
2ddc9d39235393dca2e40203dde20284db4c3deeKristina Sojakova GUI.AbstractGraphView.redisplay gid gv
9d770d1ea15092156d65e2a89b081eeeb8c6b153Kristina Sojakova getLine
8b054cade993ef373d564b2d74c9c5a2da48f8b7Kristina Sojakova return ()
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova else do
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova h <- openFile (fname++".dot") WriteMode
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova sequence (map (hPutStrLn h) (dot dg))
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakova hClose h
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder _ -> return ()
2ddc9d39235393dca2e40203dde20284db4c3deeKristina Sojakova
b5702fcfbabcc2b13557bc96ed8376133420dc73Kristina Sojakovamain = do
4e3744376d584470e1342cbac9ac27032f2045c3Christian Maeder args <- getArgs
2ddc9d39235393dca2e40203dde20284db4c3deeKristina Sojakova proceed (head args) (not ((tail args)==["-dot"]))
4e3744376d584470e1342cbac9ac27032f2045c3Christian Maeder