diff --git a/src/runtime/haskell-bind/PGF2.hsc b/src/runtime/haskell-bind/PGF2.hsc index 7fa5ca563..296390def 100644 --- a/src/runtime/haskell-bind/PGF2.hsc +++ b/src/runtime/haskell-bind/PGF2.hsc @@ -73,7 +73,7 @@ module PGF2 (-- * PGF MorphoAnalysis, lookupMorpho, fullFormLexicon, -- ** Visualizations GraphvizOptions(..), graphvizDefaults, - graphvizAbstractTree, graphvizParseTree, graphvizWordAlignment, + graphvizAbstractTree, graphvizParseTree, graphvizDependencyGraph, graphvizWordAlignment, -- * Exceptions PGFError(..), @@ -430,6 +430,17 @@ graphvizParseTree c opts e = touchExpr e peekUtf8CStringBufResult sb tmpPl +graphvizDependencyGraph :: PGF -> GraphvizOptions -> Expr -> String +graphvizDependencyGraph p opts e = + unsafePerformIO $ do + tmpPl <- gu_new_pool + (sb,out) <- newOut tmpPl + exn <- gu_new_exn tmpPl + c_opts <- newGraphvizOptions tmpPl opts + pgf_graphviz_dependency_graph (pgf p) (expr e) c_opts out exn tmpPl + touchExpr e + peekUtf8CStringBufResult sb tmpPl + graphvizWordAlignment :: [Concr] -> GraphvizOptions -> Expr -> String graphvizWordAlignment cs opts e = unsafePerformIO $ diff --git a/src/runtime/haskell-bind/PGF2/FFI.hsc b/src/runtime/haskell-bind/PGF2/FFI.hsc index ccad67480..d91c6305a 100644 --- a/src/runtime/haskell-bind/PGF2/FFI.hsc +++ b/src/runtime/haskell-bind/PGF2/FFI.hsc @@ -548,6 +548,9 @@ foreign import ccall "pgf/graphviz.h pgf_graphviz_abstract_tree" foreign import ccall "pgf/graphviz.h pgf_graphviz_parse_tree" pgf_graphviz_parse_tree :: Ptr PgfConcr -> PgfExpr -> Ptr PgfGraphvizOptions -> Ptr GuOut -> Ptr GuExn -> IO () + +foreign import ccall "pgf/graphviz.h pgf_graphviz_dependency_graph" + pgf_graphviz_dependency_graph :: Ptr PgfPGF -> PgfExpr -> Ptr PgfGraphvizOptions -> Ptr GuOut -> Ptr GuExn -> Ptr GuPool -> IO () foreign import ccall "pgf/graphviz.h pgf_graphviz_word_alignment" pgf_graphviz_word_alignment :: Ptr (Ptr PgfConcr) -> CSizeT -> PgfExpr -> Ptr PgfGraphvizOptions -> Ptr GuOut -> Ptr GuExn -> IO ()