forked from GitHub/gf-core
"Committed_by_peb"
This commit is contained in:
@@ -4,9 +4,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/10/05 11:56:42 $
|
-- > CVS $Date: 2005/11/16 10:21:21 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: peb $
|
||||||
-- > CVS $Revision: 1.1 $
|
-- > CVS $Revision: 1.2 $
|
||||||
--
|
--
|
||||||
-- Printing the type hierarchy of an abstract module in GraphViz format
|
-- Printing the type hierarchy of an abstract module in GraphViz format
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -35,8 +35,9 @@ prtTypeGraph rules = "digraph TypeGraph {" ++++
|
|||||||
"}"
|
"}"
|
||||||
|
|
||||||
prtTypeGraphRule :: SRule -> String
|
prtTypeGraphRule :: SRule -> String
|
||||||
prtTypeGraphRule (Rule (Abs cat cats (Name fun _prof)) _)
|
prtTypeGraphRule (Rule abs@(Abs cat cats (Name fun _prof)) _)
|
||||||
= unlines [ prtSCat c ++ " -> " ++ prtSCat cat ++ ";" | c <- cats ]
|
= "// " ++ prt abs ++++
|
||||||
|
unlines [ prtSCat c ++ " -> " ++ prtSCat cat ++ ";" | c <- cats ]
|
||||||
|
|
||||||
prtFunctionGraph :: SGrammar -> String
|
prtFunctionGraph :: SGrammar -> String
|
||||||
prtFunctionGraph rules = "digraph FunctionGraph {" ++++
|
prtFunctionGraph rules = "digraph FunctionGraph {" ++++
|
||||||
@@ -45,10 +46,12 @@ prtFunctionGraph rules = "digraph FunctionGraph {" ++++
|
|||||||
"}"
|
"}"
|
||||||
|
|
||||||
prtFunctionGraphRule :: SRule -> String
|
prtFunctionGraphRule :: SRule -> String
|
||||||
prtFunctionGraphRule (Rule (Abs cat cats (Name fun _prof)) _)
|
prtFunctionGraphRule (Rule abs@(Abs cat cats (Name fun _prof)) _)
|
||||||
= prt fun ++ " [shape=box, style=dashed];" ++++
|
= "// " ++ prt abs ++++
|
||||||
prt fun ++ " -> " ++ prtSCat cat ++ ";" ++++
|
pfun ++ " [label=\"" ++ prt fun ++ "\", shape=box, style=dashed];" ++++
|
||||||
unlines [ prtSCat c ++ " -> " ++ prt fun ++ ";" | c <- cats ]
|
pfun ++ " -> " ++ prtSCat cat ++ ";" ++++
|
||||||
|
unlines [ prtSCat c ++ " -> " ++ pfun ++ ";" | c <- cats ]
|
||||||
|
where pfun = "GF_FUNCTION_" ++ prt fun
|
||||||
|
|
||||||
prtSCat (Decl var cat args) = prt cat
|
prtSCat (Decl var cat args) = prt cat
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/11/10 16:43:45 $
|
-- > CVS $Date: 2005/11/16 10:21:21 $
|
||||||
-- > CVS $Author: bringert $
|
-- > CVS $Author: peb $
|
||||||
-- > CVS $Revision: 1.84 $
|
-- > CVS $Revision: 1.85 $
|
||||||
--
|
--
|
||||||
-- A database for customizable GF shell commands.
|
-- A database for customizable GF shell commands.
|
||||||
--
|
--
|
||||||
@@ -294,8 +294,8 @@ customGrammarPrinter =
|
|||||||
,(strCI "pinfo", Prt.prt . statePInfo)
|
,(strCI "pinfo", Prt.prt . statePInfo)
|
||||||
,(strCI "abstract", Prt.prtAfter "\n" . Cnv.gfc2abstract . stateGrammarLang)
|
,(strCI "abstract", Prt.prtAfter "\n" . Cnv.gfc2abstract . stateGrammarLang)
|
||||||
|
|
||||||
,(strCI "functiongraph",CnvTypeGraph.prtFunctionGraph . uncurry Cnv.gfc2simple . stateGrammarLangOpts)
|
,(strCI "functiongraph",CnvTypeGraph.prtFunctionGraph . Cnv.gfc2simple noOptions . stateGrammarLang)
|
||||||
,(strCI "typegraph", CnvTypeGraph.prtTypeGraph . uncurry Cnv.gfc2simple . stateGrammarLangOpts)
|
,(strCI "typegraph", CnvTypeGraph.prtTypeGraph . Cnv.gfc2simple noOptions . stateGrammarLang)
|
||||||
|
|
||||||
,(strCI "gfc-haskell", CnvHaskell.prtSGrammar . uncurry Cnv.gfc2simple . stateGrammarLangOpts)
|
,(strCI "gfc-haskell", CnvHaskell.prtSGrammar . uncurry Cnv.gfc2simple . stateGrammarLangOpts)
|
||||||
,(strCI "mcfg-haskell", CnvHaskell.prtMGrammar . stateMCFG)
|
,(strCI "mcfg-haskell", CnvHaskell.prtMGrammar . stateMCFG)
|
||||||
|
|||||||
Reference in New Issue
Block a user