diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2013-04-19 11:13:07 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2013-04-19 11:13:07 +0000 |
| commit | 4e2044ab99a2ce6dcff86989f1e3e565ba5ac9e0 (patch) | |
| tree | 3aa643022a4b9fc8514c7683f1d51d49e2ca5f5d /src/runtime | |
| parent | a591160b947dac1e524dc0b5a98907ba6aa1ebbe (diff) | |
remove the dead code left behind by Peter Ljunglöf in VisualizeTree
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/haskell/PGF/VisualizeTree.hs | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/src/runtime/haskell/PGF/VisualizeTree.hs b/src/runtime/haskell/PGF/VisualizeTree.hs index d0fc3a9e3..6bfee1f39 100644 --- a/src/runtime/haskell/PGF/VisualizeTree.hs +++ b/src/runtime/haskell/PGF/VisualizeTree.hs @@ -1,18 +1,12 @@ ---------------------------------------------------------------------- -- | -- Module : VisualizeTree --- Maintainer : AR +-- Maintainer : KA -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: --- > CVS $Author: --- > CVS $Revision: --- -- Print a graph of an abstract syntax tree in Graphviz DOT format -- Based on BB's VisualizeGrammar --- FIXME: change this to use GF.Visualization.Graphviz, --- instead of rolling its own. ----------------------------------------------------------------------------- module PGF.VisualizeTree @@ -20,7 +14,6 @@ module PGF.VisualizeTree , graphvizDefaults , graphvizAbstractTree , graphvizParseTree - , graphvizParseTreeOld , graphvizDependencyTree , graphvizBracketedString , graphvizAlignment @@ -290,50 +283,6 @@ graphvizBracketedString opts bs = render graphviz_code space - -graphvizParseTreeOld :: PGF -> Language -> Tree -> String -graphvizParseTreeOld pgf lang = graphvizBracketedStringOld . bracketedLinearize pgf lang - - -graphvizBracketedStringOld :: BracketedString -> String -graphvizBracketedStringOld = render . lin2tree - where - lin2tree bs = - text "graph {" $$ - space $$ - nest 2 (text "rankdir=BU ;" $$ - text "node [shape = record, color = white] ;" $$ - space $$ - vcat (nodes bs)) $$ - text "}" - where - nodes bs = zipWith mkStruct [0..] (interns ++ [zipWith (\i (l,p,w) -> (l,p,i,w)) [99990..] leaves]) - - nil = -1 - - leaves = getLeaves 0 nil bs - interns = getInterns 0 [(nil,bs)] - - getLeaves level parent bs = - case bs of - Leaf w -> [(level-1,parent,w)] - Bracket _ fid i _ _ bss -> concatMap (getLeaves (level+1) fid) bss - - getInterns level [] = [] - getInterns level nodes = - nub [(level-1,parent,fid,showCId cat) | (parent,Bracket cat fid _ _ _ _) <- nodes] : - getInterns (level+1) [(fid,child) | (_,Bracket _ fid _ _ _ children) <- nodes, child <- children] - - mkStruct l cs = struct l <> text "[label = \"" <> fields cs <> text "\"] ;" $$ - vcat [link pl pid l id | (pl,pid,id,_) <- cs] - link pl pid l id - | pl < 0 = empty - | otherwise = struct pl <> colon <> tag pid <> colon <> char 's' <+> - text "--" <+> - struct l <> colon <> tag id <> colon <> char 'n' <+> semi - fields cs = hsep (intersperse (char '|') [tbrackets (tag id) <> text c | (_,_,id,c) <- cs]) - - type Rel = (Int,[Int]) -- possibly needs changes after clearing about many-to-many on this level |
