Commit ff9f31b6 authored by bguillaum's avatar bguillaum

Adapt code to new dep2pict interface

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/semagramme/libcaml-grew/trunk@8811 7838e531-6607-4d57-9587-6c381814729c
parent e6c8118c
......@@ -11,6 +11,10 @@
open Log
open Printf
IFDEF DEP2PICT THEN
open Dep2pict
ENDIF
open Grew_base
open Grew_types
......@@ -70,17 +74,17 @@ module Instance = struct
IFDEF DEP2PICT THEN
let save_dep_png ?filter ?main_feat base t =
let (_,_,highlight_position) =
Dep2pict.Dep2pict.fromDepStringToPng_with_pos
(G_graph.to_dep ?filter ?main_feat t.graph) (base^".png") in
highlight_position
let dep = G_graph.to_dep ?filter ?main_feat t.graph in
let d2p = Dep2pict.from_dep ~dep in
let _ = Dep2pict.save_png ~filename: (base^".png") d2p in
Dep2pict.highlight_shift ()
let save_dep_svg ?filter ?main_feat base t =
let (_,_,highlight_position) =
Dep2pict.Dep2pict.fromDepStringToSvgFile_with_pos
(G_graph.to_dep ?filter ?main_feat t.graph) (base^".svg") in
highlight_position
let dep = G_graph.to_dep ?filter ?main_feat t.graph in
let d2p = Dep2pict.from_dep ~dep in
let _ = Dep2pict.save_svg ~filename: (base^".png") d2p in
Dep2pict.highlight_shift ()
ELSE
let save_dep_png ?filter ?main_feat base t = None
let save_dep_svg ?filter ?main_feat base t = None
......
......@@ -13,6 +13,10 @@ open Libgrew_types
open Printf
open Log
IFDEF DEP2PICT THEN
open Dep2pict
ENDIF
open Grew_fs
open Grew_base
open Grew_types
......@@ -76,7 +80,8 @@ let build_html_doc ?(corpus=false) dir grs =
let fct module_ rule_ =
let dep_code = Rule.to_dep rule_ in
let dep_png_file = sprintf "%s/%s_%s-patt.png" dir module_ (Rule.get_name rule_) in
ignore (Dep2pict.Dep2pict.fromDepStringToPng dep_code dep_png_file) in
let d2p = Dep2pict.from_dep ~dep:dep_code in
Dep2pict.save_png ~filename:dep_png_file d2p in
Grs.rule_iter fct grs;
Grs.filter_iter fct grs
) ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment