(* let installation_path = "http://www.pps.jussieu.fr/~yrg/cerco" *) let installation_path = "http://0.0.0.0:8000" let inputs = [ (* For the moment: Webify.Direct ("Scratch", (fun () -> "/* Type your source code here in C. */")); *) Webify.Url (installation_path ^ "/cerco_input.xml") ] let processor step (title, contents) = let to_output title a = let lang = Languages.to_string (Languages.language_of_ast a) in ("[" ^ title ^ lang ^ "]", (Misc.Timed.profile (Printf.sprintf "Print %s" lang) Languages.print a)) in let terminal title s = ("[" ^ title ^ "]", s) in let (intermediate_asts, annotated_ast) = Acc.process ~step (`Source (title, contents)) in let intermediate_asts = snd (Misc.ListExt.cut_last intermediate_asts) in let pasts = to_output "Annotated " annotated_ast :: List.map (to_output "") intermediate_asts in let (out, err) = Misc.IOExt.get_buffers () in let terminals = [ terminal "Standard output" out; terminal "Standard error" err ] in pasts @ terminals let now () : float = let date = jsnew Js.date_now () in Js.to_float (date##getTime ()) let _ = Options.set_web_mode (); Misc.Timed.set_profiling_flag true; Misc.Timed.set_now now; Misc.IOExt.set_buffered_mode (); Webify.from_function inputs processor