-let register_trace t x = Hashtbl.add h_trace (Tree.id t) x
-let h_fname = Hashtbl.create 401
+let r_trace = Hashtbl.create 4096
+let register_trace tree t x =
+ Hashtbl.add h_trace (Tree.id tree t) x
-let register_funname f s = Hashtbl.add h_fname (Hashtbl.hash f) s
-let get_funname f = try Hashtbl.find h_fname (Hashtbl.hash f) with _ -> "[anon_fun]"
+module HFname = Hashtbl.Make (struct
+ type t = Obj.t
+ let hash = Hashtbl.hash
+ let equal = (==)
+ end)
+
+let h_fname = HFname.create 401
+
+let register_funname f s =
+ HFname.add h_fname (Obj.repr f) s
+let get_funname f = try HFname.find h_fname (Obj.repr f) with _ -> "[anon_fun]"
let h_auto = 6+ (Hashtbl.fold (fun _ l a -> (List.length l)+a) a.trans 0) in
let max_tt = ref 0 in
let outc = open_out file in
let h_auto = 6+ (Hashtbl.fold (fun _ l a -> (List.length l)+a) a.trans 0) in
let max_tt = ref 0 in
let outc = open_out file in
let tooltip,selected = try
let (inconf,outconf,trans,first_fun,next_fun,ctx) = Hashtbl.find h_trace id in
let selected = IntSet.mem id results in
pr_str "<span id=\"id%i\"><table><tr><td>Subtree %i, tag='%s', internal node = %s\n"
let tooltip,selected = try
let (inconf,outconf,trans,first_fun,next_fun,ctx) = Hashtbl.find h_trace id in
let selected = IntSet.mem id results in
pr_str "<span id=\"id%i\"><table><tr><td>Subtree %i, tag='%s', internal node = %s\n"
pr_str "%s" "\nEntered with configuration:\n";
SList.iter (fun s -> StateSet.print strf s) inconf;
pr_str "%s" "\nLeft with configuration:\n";
SList.iter (fun s -> StateSet.print strf s) outconf;
(let ft = first_fun t in
pr_str "\n<a href=\"#l%i\" onclick=\"ShowPopup(document.getElementById('id%i'));\" >Left successor</a> is: id=%i, tag='%s', internal node = '%s'\n"
pr_str "%s" "\nEntered with configuration:\n";
SList.iter (fun s -> StateSet.print strf s) inconf;
pr_str "%s" "\nLeft with configuration:\n";
SList.iter (fun s -> StateSet.print strf s) outconf;
(let ft = first_fun t in
pr_str "\n<a href=\"#l%i\" onclick=\"ShowPopup(document.getElementById('id%i'));\" >Left successor</a> is: id=%i, tag='%s', internal node = '%s'\n"
pr_str "Moving with : %s (tree=%i)\n" (get_funname first_fun) id;
);
(let nt = next_fun t ctx in
pr_str "\n<a href=\"#l%i\" onclick=\"ShowPopup(document.getElementById('id%i'));\">Right successor</a> is: id=%i, tag='%s', internal node = '%s'\n"
pr_str "Moving with : %s (tree=%i)\n" (get_funname first_fun) id;
);
(let nt = next_fun t ctx in
pr_str "\n<a href=\"#l%i\" onclick=\"ShowPopup(document.getElementById('id%i'));\">Right successor</a> is: id=%i, tag='%s', internal node = '%s'\n"
- (Tree.id nt) (Tree.id nt) (Tree.id nt) (tag_to_str (Tree.tag nt)) (Tree.dump_node nt);
- pr_str "Moving with : %s (tree=%i) (ctx=%i)\n" (get_funname first_fun) id (Tree.id ctx);
+ (Tree.id tree nt) (Tree.id tree nt) (Tree.id tree nt) (tag_to_str (Tree.tag tree nt)) (Tree.dump_node nt);
+ pr_str "Moving with : %s (tree=%i) (ctx=%i)\n" (get_funname next_fun) id (Tree.id tree ctx);
pr_str "%s" "<td>";Formlist.print strf fl;pr_str "</td>";
max_tt := max !max_tt (Formlist.length fl);
) trans;
pr_str "%s" "<td>";Formlist.print strf fl;pr_str "</td>";
max_tt := max !max_tt (Formlist.length fl);
) trans;
pr_str "In result set : %s\n</td></tr></table></span>" (if selected then "Yes" else "No");
Format.flush_str_formatter(),selected
with
pr_str "In result set : %s\n</td></tr></table></span>" (if selected then "Yes" else "No");
Format.flush_str_formatter(),selected
with
(if tag == Tag.pcdata || tag== Tag.attribute_data then "_text" else"")
in
if tag == Tag.pcdata || tag== Tag.attribute_data then
(if tag == Tag.pcdata || tag== Tag.attribute_data then "_text" else"")
in
if tag == Tag.pcdata || tag== Tag.attribute_data then
then
pr_out "<div class=\"%s\" id=\"div%i\" onclick=\"ShowPopup(document.getElementById('id%i'));\"><a name=\"l%i\"/><%s/>%s</div>"
div_class id id id (tag_to_str tag) tooltip
else begin
pr_out "<div class=\"%s\" id=\"div%i\" onclick=\"ShowPopup(document.getElementById('id%i'));\"><a name=\"l%i\"/><%s>%s</div>"
div_class id id id (tag_to_str tag) tooltip;
then
pr_out "<div class=\"%s\" id=\"div%i\" onclick=\"ShowPopup(document.getElementById('id%i'));\"><a name=\"l%i\"/><%s/>%s</div>"
div_class id id id (tag_to_str tag) tooltip
else begin
pr_out "<div class=\"%s\" id=\"div%i\" onclick=\"ShowPopup(document.getElementById('id%i'));\"><a name=\"l%i\"/><%s>%s</div>"
div_class id id id (tag_to_str tag) tooltip;
if (tooltip="") then
pr_out "<div class=\"%s\"></%s></div>" div_class (tag_to_str tag)
else
pr_out "<a href=\"#l%i\" onclick=\"ShowPopup(document.getElementById('id%i'));\"><div class=\"%s\"></%s></div></a>" id id div_class (tag_to_str tag);
end;
end;
if (tooltip="") then
pr_out "<div class=\"%s\"></%s></div>" div_class (tag_to_str tag)
else
pr_out "<a href=\"#l%i\" onclick=\"ShowPopup(document.getElementById('id%i'));\"><div class=\"%s\"></%s></div></a>" id id div_class (tag_to_str tag);
end;
end;
dump outf a;
pr_out "%s" "</div><hr /><div class=\"yellow\" id=\"tooltipzone\"></div>";
pr_out "%s" "<div class=\"document\">";
dump outf a;
pr_out "%s" "</div><hr /><div class=\"yellow\" id=\"tooltipzone\"></div>";
pr_out "%s" "<div class=\"document\">";