X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Fpxp%2Fpxp%2Fexamples%2Freadme%2Fmain.ml;fp=helm%2FDEVEL%2Fpxp%2Fpxp%2Fexamples%2Freadme%2Fmain.ml;h=0000000000000000000000000000000000000000;hb=c7514aaa249a96c5fdd39b1123fbdb38d92f20b6;hp=4e3837aa98832de0168616a9a96b19c0cad4c0e8;hpb=1c7fb836e2af4f2f3d18afd0396701f2094265ff;p=helm.git diff --git a/helm/DEVEL/pxp/pxp/examples/readme/main.ml b/helm/DEVEL/pxp/pxp/examples/readme/main.ml deleted file mode 100644 index 4e3837aa9..000000000 --- a/helm/DEVEL/pxp/pxp/examples/readme/main.ml +++ /dev/null @@ -1,108 +0,0 @@ -(* $Id$ - * ---------------------------------------------------------------------- - * - *) - -open Pxp_types -open Pxp_document -open Pxp_yacc - - -let rec print_error e = - prerr_endline(string_of_exn e) -;; - - -let run f a = - try f a with - e -> print_error e -;; - - -let convert_to_html filename = - (* read in style definition *) - let document = - parse_document_entity - { default_config with encoding = `Enc_iso88591 } - (from_file filename) - To_html.tag_map - in - let root = document # root in - let store = new To_html.store in - root # extension # to_html store stdout -;; - - -let convert_to_text filename = - (* read in style definition *) - let document = - parse_document_entity - default_config - (from_file filename) - To_text.tag_map - in - let root = document # root in - let store = new To_text.store in - let box = new To_text.box 79 79 in - root # extension # to_box store box; - box # output 0 0 stdout -;; - - -let main() = - let want_html = ref false in - let want_text = ref false in - let filename = ref None in - Arg.parse - [ "-html", Arg.Set want_html, - " convert file to html"; - "-text", Arg.Set want_text, - " convert file to text"; - ] - (fun s -> - match !filename with - None -> filename := Some s - | Some _ -> - raise (Arg.Bad "Multiple arguments not allowed.")) - "usage: readme [ -text | -html ] input.xml >output"; - let fn = - match !filename with - None -> - prerr_endline "readme: no input"; - exit 1 - | Some s -> s - in - match !want_html, !want_text with - true, false -> - run convert_to_html fn - | false, true -> - run convert_to_text fn - | _ -> - prerr_endline ("readme: Please select exactly one output format") -;; - -main();; - -(* ====================================================================== - * History: - * - * $Log$ - * Revision 1.1 2000/11/17 09:57:31 lpadovan - * Initial revision - * - * Revision 1.5 2000/07/08 17:58:17 gerd - * Updated because of PXP API changes. - * - * Revision 1.4 2000/06/04 20:25:38 gerd - * Updates because of renamed PXP modules. - * - * Revision 1.3 2000/05/01 16:46:40 gerd - * Using the new error formatter. - * - * Revision 1.2 1999/08/23 16:54:19 gerd - * Minor changes. - * - * Revision 1.1 1999/08/22 22:29:32 gerd - * Initial revision. - * - *)