Commit bd968d07 authored by bguillaum's avatar bguillaum

add link to rule in html corpus file

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/semagramme/libcaml-grew/trunk@7017 7838e531-6607-4d57-9587-6c381814729c
parent 5b8229b7
...@@ -185,6 +185,8 @@ module AST_HTML = struct ...@@ -185,6 +185,8 @@ module AST_HTML = struct
match u_feature.Ast.kind with match u_feature.Ast.kind with
| Ast.Equality values -> | Ast.Equality values ->
sprintf "%s=%s" u_feature.Ast.name (List_.to_string (fun x->x) "|" values) sprintf "%s=%s" u_feature.Ast.name (List_.to_string (fun x->x) "|" values)
| Ast.Disequality [] ->
sprintf "%s=*" u_feature.Ast.name
| Ast.Disequality values -> | Ast.Disequality values ->
sprintf "%s<>%s" u_feature.Ast.name (List_.to_string (fun x->x) "|" values) sprintf "%s<>%s" u_feature.Ast.name (List_.to_string (fun x->x) "|" values)
| Ast.Param index -> | Ast.Param index ->
...@@ -216,14 +218,14 @@ module AST_HTML = struct ...@@ -216,14 +218,14 @@ module AST_HTML = struct
let buff_html_pos_pattern buff pos_pattern = let buff_html_pos_pattern buff pos_pattern =
bprintf buff " <font color=\"purple\">match</font> <b>{</b>\n"; bprintf buff " <font color=\"purple\">match</font> <b>{</b>\n";
List.iter (buff_html_node buff) pos_pattern.Ast.pat_nodes; List.iter (buff_html_node buff) pos_pattern.Ast.pat_nodes;
List.iter (buff_html_edge buff) pos_pattern.Ast.pat_edges; List.iter (buff_html_edge buff) pos_pattern.Ast.pat_edges;
List.iter (buff_html_const buff) pos_pattern.Ast.pat_const; List.iter (buff_html_const buff) pos_pattern.Ast.pat_const;
bprintf buff " <b>}</b>\n" bprintf buff " <b>}</b>\n"
let buff_html_neg_pattern buff neg_pattern = let buff_html_neg_pattern buff neg_pattern =
bprintf buff " <font color=\"purple\">without</font> <b>{</b>\n"; bprintf buff " <font color=\"purple\">without</font> <b>{</b>\n";
List.iter (buff_html_node buff) neg_pattern.Ast.pat_nodes; List.iter (buff_html_node buff) neg_pattern.Ast.pat_nodes;
List.iter (buff_html_edge buff) neg_pattern.Ast.pat_edges; List.iter (buff_html_edge buff) neg_pattern.Ast.pat_edges;
List.iter (buff_html_const buff) neg_pattern.Ast.pat_const; List.iter (buff_html_const buff) neg_pattern.Ast.pat_const;
...@@ -233,7 +235,7 @@ module AST_HTML = struct ...@@ -233,7 +235,7 @@ module AST_HTML = struct
let buff = Buffer.create 32 in let buff = Buffer.create 32 in
List.iter List.iter
(fun rule -> (fun rule ->
bprintf buff " <font color=\"purple\">rule</font> %s <b>{</b>\n" rule.Ast.rule_id; bprintf buff "<font color=\"purple\">rule</font> %s <b>{</b>\n" rule.Ast.rule_id;
(* the match part *) (* the match part *)
buff_html_pos_pattern buff rule.Ast.pos_pattern; buff_html_pos_pattern buff rule.Ast.pos_pattern;
...@@ -242,11 +244,11 @@ module AST_HTML = struct ...@@ -242,11 +244,11 @@ module AST_HTML = struct
List.iter (buff_html_neg_pattern buff) rule.Ast.neg_patterns; List.iter (buff_html_neg_pattern buff) rule.Ast.neg_patterns;
(* the commands part *) (* the commands part *)
bprintf buff " <font color=\"purple\">commands</font> <b>{</b>\n"; bprintf buff " <font color=\"purple\">commands</font> <b>{</b>\n";
List.iter (buff_html_command buff) rule.Ast.commands; List.iter (buff_html_command buff) rule.Ast.commands;
bprintf buff " <b>}</b>\n";
bprintf buff " <b>}</b>\n"; bprintf buff " <b>}</b>\n";
bprintf buff "<b>}</b>\n";
) rules; ) rules;
Buffer.contents buff Buffer.contents buff
end end
......
...@@ -571,7 +571,9 @@ module Corpus_stat = struct ...@@ -571,7 +571,9 @@ module Corpus_stat = struct
let file_num = StringSet.cardinal file_set in let file_num = StringSet.cardinal file_set in
fprintf out_ch "<tr>\n"; fprintf out_ch "<tr>\n";
fprintf out_ch " <td class=\"first_stats\" valign=top>%s</td>\n" rule; fprintf out_ch " <td class=\"first_stats\" valign=top><a href=\"doc/%s.html\">%s</a></td>\n"
id
rule;
fprintf out_ch " <td class=\"stats\" valign=top>%d/%d</td>\n" min_occ max_occ; fprintf out_ch " <td class=\"stats\" valign=top>%d/%d</td>\n" min_occ max_occ;
fprintf out_ch " <td class=\"stats\" valign=top>%d</td>\n" file_num; fprintf out_ch " <td class=\"stats\" valign=top>%d</td>\n" file_num;
fprintf out_ch " <td class=\"stats\" valign=top>%.2f%%</td>\n" (ratio file_num); fprintf out_ch " <td class=\"stats\" valign=top>%.2f%%</td>\n" (ratio file_num);
......
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