]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/pxp/pxp/pxp_lexers.ml
- New interface for the MathQL interpreter (1.3 version)
[helm.git] / helm / DEVEL / pxp / pxp / pxp_lexers.ml
1 (* $Id$
2  * ----------------------------------------------------------------------
3  * PXP: The polymorphic XML parser for Objective Caml.
4  * Copyright 1999 by Gerd Stolpmann. See LICENSE for details.
5  *)
6
7
8 open Pxp_types
9 open Pxp_lexer_types
10
11 let lexer_set_iso88591 = 
12   { lex_encoding         = `Enc_iso88591;
13     scan_document        = Pxp_lex_document_iso88591.scan_document;
14     scan_content         = Pxp_lex_content_iso88591.scan_content;
15     scan_within_tag      = Pxp_lex_within_tag_iso88591.scan_within_tag;
16     scan_document_type   = Pxp_lex_document_type_iso88591.
17                              scan_document_type;
18     scan_declaration     = Pxp_lex_declaration_iso88591.scan_declaration;
19     scan_content_comment  = Pxp_lex_misc_iso88591.scan_content_comment;
20     scan_decl_comment     = Pxp_lex_misc_iso88591.scan_decl_comment;
21     scan_document_comment = Pxp_lex_misc_iso88591.scan_document_comment;
22     scan_ignored_section = Pxp_lex_name_string_iso88591.
23                              scan_ignored_section;
24     scan_xml_pi          = Pxp_lex_misc_iso88591.scan_xml_pi;
25     scan_dtd_string      = Pxp_lex_dtd_string_iso88591.scan_dtd_string;
26     scan_content_string  = Pxp_lex_content_string_iso88591.
27                              scan_content_string;
28     scan_name_string     = Pxp_lex_name_string_iso88591.scan_name_string;
29     scan_only_xml_decl   = Pxp_lex_misc_iso88591.scan_only_xml_decl;
30     scan_for_crlf        = Pxp_lex_misc_iso88591.scan_for_crlf;
31   }
32 ;;
33
34
35 let lexer_set_utf8 = ref None
36 ;;
37
38
39 let init_utf8 ls =
40   lexer_set_utf8 := Some ls
41 ;;
42
43
44 let get_lexer_set enc =
45   match enc with
46       `Enc_iso88591 -> lexer_set_iso88591
47     | `Enc_utf8 ->
48         ( match !lexer_set_utf8 with
49               None ->
50                 failwith ("Pxp_lexers: UTF-8 lexers not initialized")
51             | Some ls ->
52                 ls
53         )
54     | _ ->
55         failwith ("Pxp_lexers: This type of internal encoding is not supported")
56 ;;
57
58 (* ======================================================================
59  * History:
60  * 
61  * $Log$
62  * Revision 1.1  2000/11/17 09:57:29  lpadovan
63  * Initial revision
64  *
65  * Revision 1.4  2000/05/29 23:48:38  gerd
66  *      Changed module names:
67  *              Markup_aux          into Pxp_aux
68  *              Markup_codewriter   into Pxp_codewriter
69  *              Markup_document     into Pxp_document
70  *              Markup_dtd          into Pxp_dtd
71  *              Markup_entity       into Pxp_entity
72  *              Markup_lexer_types  into Pxp_lexer_types
73  *              Markup_reader       into Pxp_reader
74  *              Markup_types        into Pxp_types
75  *              Markup_yacc         into Pxp_yacc
76  * See directory "compatibility" for (almost) compatible wrappers emulating
77  * Markup_document, Markup_dtd, Markup_reader, Markup_types, and Markup_yacc.
78  *
79  * Revision 1.3  2000/05/29 21:14:57  gerd
80  *      Changed the type 'encoding' into a polymorphic variant.
81  *
82  * Revision 1.2  2000/05/23 00:09:44  gerd
83  *      The UTF-8 lexer set is no longer initialized here. It is done
84  * in the new module Pxp_utf8. Reason: You can link without UTF-8 support.
85  *
86  * Revision 1.1  2000/05/20 20:30:50  gerd
87  *      Initial revision.
88  *
89  * 
90  *)