Helm_registry.load_from "test_parser.conf.xml"
(* Http_getter.init () *)
+let xml_stream_of_markup =
+ let rec print_box (t: CicNotationPres.boxml_markup) =
+ Box.box2xml print_mpres t
+ and print_mpres (t: CicNotationPres.mathml_markup) =
+ Mpresentation.print_mpres print_box t
+ in
+ print_mpres
+
+let dump_xml t id_to_uri fname =
+ print_endline (sprintf "dumping MathML to %s ..." fname);
+ flush stdout;
+ let oc = open_out fname in
+ Xml.pp_to_outchan (CicNotationPres.render_to_boxml id_to_uri t) oc;
+ close_out oc
+
let _ =
let module P = CicNotationPt in
let level = ref ~-1 in
prerr_endline "====";
print_endline (CicNotationPp.pp_term t); flush stdout;
let t' = CicNotationRew.pp_ast t in
- print_endline (CicNotationPp.pp_term t'); flush stdout
+ print_endline (CicNotationPp.pp_term t'); flush stdout;
+ let tbl = Hashtbl.create 0 in
+ dump_xml t' tbl "out.xml"
| P.Notation (l1, associativity, precedence, l2) ->
print_endline "Extending parser ..."; flush stdout;
let time1 = Unix.gettimeofday () in
let t' = CicNotationRew.pp_ast t in
let time4 = Unix.gettimeofday () in
printf "pretty printing took %f seconds\n" (time4 -. time3);
+ dump_xml t' id_to_uri "out.xml";
print_endline (CicNotationPp.pp_term t'); flush stdout
)
(* CicNotationParser.print_l2_pattern ()) *)