]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/pxp/pxp/lexers/pxp_lex_document_type.src
- the mathql interpreter is not helm-dependent any more
[helm.git] / helm / DEVEL / pxp / pxp / lexers / pxp_lex_document_type.src
1 (* $Id$
2  * ----------------------------------------------------------------------
3  *
4  *)
5
6
7 {
8   open Pxp_types
9   open Pxp_lexer_types
10
11 #insert open_pxp_lex_aux_*.src
12 #insert pxp_lex_aux.src
13
14 }
15
16 #insert pxp_lex_defs_*.def
17
18
19 (* scan_document_type: after "<!DOCTYPE" until matching ">" *)
20
21 rule scan_document_type = parse
22     name
23       { let s = Lexing.lexeme lexbuf in
24         Name s, Document_type }
25   | ws+
26       { tok_Ignore__Document_type }
27   | '"' character_except_quot* '"'
28       { let s = Lexing.lexeme lexbuf in
29         (Unparsed_string (String.sub s 1 (String.length s - 2))), Document_type }
30   | '"'
31       { raise (WF_error ("Cannot find the second quotation mark"))
32       }
33   | "'" character_except_apos* "'"
34       { let s = Lexing.lexeme lexbuf in
35         (Unparsed_string (String.sub s 1 (String.length s - 2))), Document_type }
36   | "'"
37       { raise (WF_error ("Cannot find the second quotation mark"))
38       }
39   | '['
40       { tok_Dtd_begin__Declaration }
41   | '>'
42       { tok_Doctype_rangle__Document }
43   | eof
44       { tok_Eof__Document_type }
45   | '&' 
46       { raise (WF_error("References to general entities not allowed here")) }
47   | '%' 
48       { raise (WF_error("References to parameter entities not allowed here")) }
49   | character
50       { raise (WF_error("Content not allowed here")) }
51   | _
52       { raise Netconversion.Malformed_code }
53
54
55 (* ======================================================================
56  * History:
57  * 
58  * $Log$
59  * Revision 1.1  2000/11/17 09:57:32  lpadovan
60  * Initial revision
61  *
62  * Revision 1.3  2000/08/14 22:18:34  gerd
63  *      Bad_character_stream -> Netconversion.Malformed_code
64  *
65  * Revision 1.2  2000/05/29 23:53:12  gerd
66  *      Updated because Markup_* modules have been renamed to Pxp_*.
67  *
68  * Revision 1.1  2000/05/20 20:33:25  gerd
69  *      Initial revision.
70  *
71  * 
72  *)