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 diff --git a/src/GF/UseGrammar/Custom.hs b/src/GF/UseGrammar/Custom.hs index 1db93bff3..75294ff4b 100644 --- a/src/GF/UseGrammar/Custom.hs +++ b/src/GF/UseGrammar/Custom.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/11/10 16:43:45 $ --- > CVS $Author: bringert $ --- > CVS $Revision: 1.84 $ +-- > CVS $Date: 2005/11/16 10:21:21 $ +-- > CVS $Author: peb $ +-- > CVS $Revision: 1.85 $ -- -- A database for customizable GF shell commands. -- @@ -294,8 +294,8 @@ customGrammarPrinter = ,(strCI "pinfo", Prt.prt . statePInfo) ,(strCI "abstract", Prt.prtAfter "\n" . Cnv.gfc2abstract . stateGrammarLang) - ,(strCI "functiongraph",CnvTypeGraph.prtFunctionGraph . uncurry Cnv.gfc2simple . stateGrammarLangOpts) - ,(strCI "typegraph", CnvTypeGraph.prtTypeGraph . uncurry Cnv.gfc2simple . stateGrammarLangOpts) + ,(strCI "functiongraph",CnvTypeGraph.prtFunctionGraph . Cnv.gfc2simple noOptions . stateGrammarLang) + ,(strCI "typegraph", CnvTypeGraph.prtTypeGraph . Cnv.gfc2simple noOptions . stateGrammarLang) ,(strCI "gfc-haskell", CnvHaskell.prtSGrammar . uncurry Cnv.gfc2simple . stateGrammarLangOpts) ,(strCI "mcfg-haskell", CnvHaskell.prtMGrammar . stateMCFG)