2 * ----------------------------------------------------------------------
15 | Lelementend of string
26 (* Simplified rules: Only Latin-1 is recognized as character set *)
28 let letter = ['A'-'Z' 'a'-'z' '\192'-'\214' '\216'-'\246' '\248'-'\255']
31 let hexdigit = ['0'-'9' 'A'-'F' 'a'-'f']
32 let namechar = letter | digit | '.' | ':' | '-' | '_' | extender
33 let name = ( letter | '_' | ':' ) namechar*
34 let nmtoken = namechar+
35 let ws = [ ' ' '\t' '\r' '\n' ]
36 let string_literal1 = '"' [^ '"' '>' '<' '\n']* '"'
37 let string_literal2 = "'" [^ '\'' '>' '<' '\n']* "'"
40 (* This following rules reflect HTML as it is used, not the SGML
44 rule scan_document = parse
50 { let s = Lexing.lexeme lexbuf in
51 Lelement (String.sub s 1 (String.length s - 1))
54 { let s = Lexing.lexeme lexbuf in
55 Lelementend (String.sub s 2 (String.length s - 2))
57 | "<" (* misplaced "<" *)
62 { Cdata (Lexing.lexeme lexbuf)}
64 and scan_special = parse
66 { let s = Lexing.lexeme lexbuf in
67 Lelementend (String.sub s 2 (String.length s - 2))
74 { Cdata (Lexing.lexeme lexbuf)}
77 and scan_comment = parse
87 and scan_doctype = parse
88 | ">" (* Occurence in strings, and [ ] brackets ignored *)
95 and scan_element = parse
99 { Space (String.length (Lexing.lexeme lexbuf)) }
101 { Name (Lexing.lexeme lexbuf) }
105 { let s = Lexing.lexeme lexbuf in
106 Literal (String.sub s 1 (String.length s - 2))
109 { let s = Lexing.lexeme lexbuf in
110 Literal (String.sub s 1 (String.length s - 2))
117 (* ======================================================================
121 * Revision 1.1 2000/11/17 09:57:28 lpadovan
124 * Revision 1.1 2000/03/03 01:07:25 gerd