summaryrefslogtreecommitdiff
path: root/src/GF/Conversion
diff options
context:
space:
mode:
authorpeb <unknown>2005-11-16 09:21:21 +0000
committerpeb <unknown>2005-11-16 09:21:21 +0000
commit01c9d9ebf2211acccfacf82356d364db27274840 (patch)
treef1c7edb8d2251af16fb3c569ab03b8e35e636576 /src/GF/Conversion
parent2cea1a25bb9082953aa4e9c1a8ac41db09b5c761 (diff)
"Committed_by_peb"
Diffstat (limited to 'src/GF/Conversion')
-rw-r--r--src/GF/Conversion/TypeGraph.hs19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/GF/Conversion/TypeGraph.hs b/src/GF/Conversion/TypeGraph.hs
index 3a8d9f2d4..d527c6598 100644
--- a/src/GF/Conversion/TypeGraph.hs
+++ b/src/GF/Conversion/TypeGraph.hs
@@ -4,9 +4,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/10/05 11:56:42 $
+-- > CVS $Date: 2005/11/16 10:21:21 $
-- > CVS $Author: peb $
--- > CVS $Revision: 1.1 $
+-- > CVS $Revision: 1.2 $
--
-- Printing the type hierarchy of an abstract module in GraphViz format
-----------------------------------------------------------------------------
@@ -35,8 +35,9 @@ prtTypeGraph rules = "digraph TypeGraph {" ++++
"}"
prtTypeGraphRule :: SRule -> String
-prtTypeGraphRule (Rule (Abs cat cats (Name fun _prof)) _)
- = unlines [ prtSCat c ++ " -> " ++ prtSCat cat ++ ";" | c <- cats ]
+prtTypeGraphRule (Rule abs@(Abs cat cats (Name fun _prof)) _)
+ = "// " ++ prt abs ++++
+ unlines [ prtSCat c ++ " -> " ++ prtSCat cat ++ ";" | c <- cats ]
prtFunctionGraph :: SGrammar -> String
prtFunctionGraph rules = "digraph FunctionGraph {" ++++
@@ -45,10 +46,12 @@ prtFunctionGraph rules = "digraph FunctionGraph {" ++++
"}"
prtFunctionGraphRule :: SRule -> String
-prtFunctionGraphRule (Rule (Abs cat cats (Name fun _prof)) _)
- = prt fun ++ " [shape=box, style=dashed];" ++++
- prt fun ++ " -> " ++ prtSCat cat ++ ";" ++++
- unlines [ prtSCat c ++ " -> " ++ prt fun ++ ";" | c <- cats ]
+prtFunctionGraphRule (Rule abs@(Abs cat cats (Name fun _prof)) _)
+ = "// " ++ prt abs ++++
+ pfun ++ " [label=\"" ++ prt fun ++ "\", shape=box, style=dashed];" ++++
+ pfun ++ " -> " ++ prtSCat cat ++ ";" ++++
+ unlines [ prtSCat c ++ " -> " ++ pfun ++ ";" | c <- cats ]
+ where pfun = "GF_FUNCTION_" ++ prt fun
prtSCat (Decl var cat args) = prt cat