summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2013-04-19 11:13:07 +0000
committerkr.angelov <kr.angelov@gmail.com>2013-04-19 11:13:07 +0000
commit4e2044ab99a2ce6dcff86989f1e3e565ba5ac9e0 (patch)
tree3aa643022a4b9fc8514c7683f1d51d49e2ca5f5d /src
parenta591160b947dac1e524dc0b5a98907ba6aa1ebbe (diff)
remove the dead code left behind by Peter Ljunglöf in VisualizeTree
Diffstat (limited to 'src')
-rw-r--r--src/compiler/GF/Command/Commands.hs8
-rw-r--r--src/runtime/haskell/PGF/VisualizeTree.hs53
2 files changed, 4 insertions, 57 deletions
diff --git a/src/compiler/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs
index 802b36a81..7311443f6 100644
--- a/src/compiler/GF/Command/Commands.hs
+++ b/src/compiler/GF/Command/Commands.hs
@@ -988,11 +988,9 @@ allCommands = Map.fromList [
nodeEdgeStyle = valStrOpts "nodeedgestyle" "solid" opts,
leafEdgeStyle = valStrOpts "leafedgestyle" "dashed" opts
}
- let grph = if null es then []
- else if isOpt "old" opts then
- graphvizParseTreeOld pgf lang (head es)
- else
- graphvizParseTree pgf lang gvOptions (head es)
+ let grph = if null es
+ then []
+ else graphvizParseTree pgf lang gvOptions (head es)
if isFlag "view" opts || isFlag "format" opts then do
let file s = "_grph." ++ s
let view = optViewGraph opts
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