1 (* let installation_path = "http://www.pps.jussieu.fr/~yrg/cerco" *)
3 let installation_path =
8 Webify.Direct ("Scratch",
9 (fun () -> "/* Type your source code here in C. */"));
11 Webify.Url (installation_path ^ "/cerco_input.xml")
14 let processor step (title, contents) =
15 let to_output title a =
16 let lang = Languages.to_string (Languages.language_of_ast a) in
21 (Misc.Timed.profile (Printf.sprintf "Print %s" lang) Languages.print a))
23 let terminal title s = ("[" ^ title ^ "]", s) in
24 let (intermediate_asts, annotated_ast) =
25 Acc.process ~step (`Source (title, contents))
27 let intermediate_asts =
28 snd (Misc.ListExt.cut_last intermediate_asts)
31 to_output "Annotated " annotated_ast
32 :: List.map (to_output "") intermediate_asts
34 let (out, err) = Misc.IOExt.get_buffers () in
36 terminal "Standard output" out;
37 terminal "Standard error" err
43 let date = jsnew Js.date_now () in
44 Js.to_float (date##getTime ())
47 Options.set_web_mode ();
48 Misc.Timed.set_profiling_flag true;
49 Misc.Timed.set_now now;
50 Misc.IOExt.set_buffered_mode ();
51 Webify.from_function inputs processor