2 * ----------------------------------------------------------------------
11 #insert pxp_lex_aux.src
13 #insert open_pxp_lex_aux_*.src
14 #insert open_pxp_lex_misc_*.src
18 #insert pxp_lex_defs_*.def
20 (* scan_declaration: after "[" in DTD until matching "]" *)
22 rule scan_declaration = parse
24 { tok_Ignore__Declaration }
26 { let s = Lexing.lexeme lexbuf in
27 (PERef (String.sub s 1 (String.length s - 2))), Declaration }
29 { tok_Percent__Declaration }
31 { raise(WF_error("References to general entities not allowed in DTDs")) }
33 { Name (Lexing.lexeme lexbuf), Declaration }
35 { Nametoken (Lexing.lexeme lexbuf), Declaration }
37 { tok_Plus__Declaration }
39 { tok_Star__Declaration }
41 { tok_Bar__Declaration }
43 { tok_Comma__Declaration }
45 { tok_Qmark__Declaration }
47 { tok_Lparen__Declaration }
49 { tok_RparenPlus__Declaration }
51 { tok_RparenStar__Declaration }
53 { tok_RparenQmark__Declaration }
55 { tok_Rparen__Declaration }
57 { tok_Required__Declaration }
59 { tok_Implied__Declaration }
61 { tok_Fixed__Declaration }
63 { tok_Pcdata__Declaration }
65 { tok_Decl_element__Declaration }
67 { tok_Decl_attlist__Declaration }
69 { tok_Decl_entity__Declaration }
71 { tok_Decl_notation__Declaration }
73 { Comment_begin, Decl_comment }
75 { tok_Conditional_begin__Declaration }
77 { tok_Conditional_end__Declaration }
79 { tok_Conditional_body__Declaration }
81 (* TODO: PIs modified *)
84 { scan_pi (Lexing.lexeme lexbuf) scan_xml_pi, Declaration }
86 { raise (WF_error ("Illegal processing instruction")) }
88 { let s = Lexing.lexeme lexbuf in
89 (* Check that characters are well-formed: *)
90 ignore(scan_characters (Lexing.from_string s));
91 (Unparsed_string (String.sub s 1 (String.length s - 2))), Declaration }
93 { raise (WF_error ("Cannot find the second quotation mark"))
96 { let s = Lexing.lexeme lexbuf in
97 (* Check that characters are well-formed: *)
98 ignore(scan_characters (Lexing.from_string s));
99 (Unparsed_string (String.sub s 1 (String.length s - 2))), Declaration }
101 { raise (WF_error ("Cannot find the second quotation mark"))
104 { tok_Decl_rangle__Declaration }
106 { tok_Dtd_end__Document_type }
108 { tok_Eof__Declaration }
110 { raise (WF_error "Declaration either malformed or not allowed in this context")
113 { raise (WF_error("Illegal token or character")) }
115 { raise Netconversion.Malformed_code }
118 (* ======================================================================
122 * Revision 1.1 2000/11/17 09:57:32 lpadovan
125 * Revision 1.4 2000/08/18 20:19:59 gerd
126 * Comments return different comment tokens.
128 * Revision 1.3 2000/08/14 22:18:34 gerd
129 * Bad_character_stream -> Netconversion.Malformed_code
131 * Revision 1.2 2000/05/29 23:53:12 gerd
132 * Updated because Markup_* modules have been renamed to Pxp_*.
134 * Revision 1.1 2000/05/20 20:33:25 gerd