X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Finterface%2Fexperiment.ml;fp=helm%2Finterface%2Fexperiment.ml;h=0000000000000000000000000000000000000000;hb=fa11ed6dc134f8ad3421c37a97271018e075bbed;hp=5c086bb19d43d4d9d481f171f443e865c0db80fb;hpb=c03d2c1fdab8d228cb88aaba5ca0f556318bebc5;p=helm.git diff --git a/helm/interface/experiment.ml b/helm/interface/experiment.ml deleted file mode 100644 index 5c086bb19..000000000 --- a/helm/interface/experiment.ml +++ /dev/null @@ -1,84 +0,0 @@ -(******************************************************************************) -(* *) -(* PROJECT HELM *) -(* *) -(* Claudio Sacerdoti Coen *) -(* 24/01/2000 *) -(* *) -(* This is a textual interface to the Coq-like pretty printer cicPp for cic *) -(* terms exported in xml. It uses directly the modules cicPp and cache and *) -(* indirectly all the other modules (cicParser, cicParser2, cicParser3, *) -(* getter). The syntax is "experiment[.opt] filename1 ... filenamen" where *) -(* filenamei is the path-name of an xml file describing a cic term. On stdout *) -(* are pretty-printed all the n terms *) -(* *) -(******************************************************************************) - -let pretty_print = ref true;; -let read_from_stdin = ref false;; -let uris_in_input = ref false;; - -let parse uri = - if !pretty_print then - begin - print_endline ("^^^" ^ uri ^ "^^^") ; - print_string (CicPp.ppobj (CicCache.get_obj (UriManager.uri_of_string uri))); - print_endline ("\n$$$" ^ uri ^ "$$$\n") - end - else - begin - print_string uri ; - let _ = CicCache.get_obj (UriManager.uri_of_string uri) in - print_endline " OK!" ; - flush stdout - end -;; - -let uri_of_filename fn = - if !uris_in_input then fn - else - let uri = - Str.replace_first (Str.regexp (Str.quote Configuration.helm_dir)) "cic:" fn - in - let uri' = Str.replace_first (Str.regexp "\.xml$") "" uri in - uri' -;; - -let read_filenames_from_stdin () = - let files = ref [] in - try - while true do - let l = Str.split (Str.regexp " ") (read_line ()) in - List.iter (fun x -> files := (uri_of_filename x) :: !files) l - done - with - End_of_file -> - files := List.rev !files ; - List.iter parse !files -;; - -(* filenames are read from command line and converted to uris via *) -(* uri_of_filenames; then the cic terms are load in cache via *) -(* CicCache.get_obj and then pretty printed via CicPp.ppobj *) - -let main() = - let files = ref [] in - Arg.parse - ["-nopp", Arg.Clear pretty_print, "Do not pretty print, parse only" ; - "-stdin", Arg.Set read_from_stdin, "Read from stdin" ; - "-uris", Arg.Set uris_in_input, "Read uris, not filenames" ; - "-update", Arg.Unit Getter.update, "Update the getter view of the world"] - (fun x -> files := (uri_of_filename x) :: !files) - " -usage: experiment file ... - -List of options:"; - if !read_from_stdin then read_filenames_from_stdin () - else - begin - files := List.rev !files; - List.iter parse !files - end -;; - -main();;