]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/pxp/pxp/lexers/pxp_lex_document_type.src
Initial revision
[helm.git] / helm / DEVEL / pxp / pxp / lexers / pxp_lex_document_type.src
diff --git a/helm/DEVEL/pxp/pxp/lexers/pxp_lex_document_type.src b/helm/DEVEL/pxp/pxp/lexers/pxp_lex_document_type.src
new file mode 100644 (file)
index 0000000..c775883
--- /dev/null
@@ -0,0 +1,72 @@
+(* $Id$
+ * ----------------------------------------------------------------------
+ *
+ *)
+
+
+{
+  open Pxp_types
+  open Pxp_lexer_types
+
+#insert open_pxp_lex_aux_*.src
+#insert pxp_lex_aux.src
+
+}
+
+#insert pxp_lex_defs_*.def
+
+
+(* scan_document_type: after "<!DOCTYPE" until matching ">" *)
+
+rule scan_document_type = parse
+    name
+      { let s = Lexing.lexeme lexbuf in
+       Name s, Document_type }
+  | ws+
+      { tok_Ignore__Document_type }
+  | '"' character_except_quot* '"'
+      { let s = Lexing.lexeme lexbuf in
+       (Unparsed_string (String.sub s 1 (String.length s - 2))), Document_type }
+  | '"'
+      { raise (WF_error ("Cannot find the second quotation mark"))
+      }
+  | "'" character_except_apos* "'"
+      { let s = Lexing.lexeme lexbuf in
+       (Unparsed_string (String.sub s 1 (String.length s - 2))), Document_type }
+  | "'"
+      { raise (WF_error ("Cannot find the second quotation mark"))
+      }
+  | '['
+      { tok_Dtd_begin__Declaration }
+  | '>'
+      { tok_Doctype_rangle__Document }
+  | eof
+      { tok_Eof__Document_type }
+  | '&' 
+      { raise (WF_error("References to general entities not allowed here")) }
+  | '%' 
+      { raise (WF_error("References to parameter entities not allowed here")) }
+  | character
+      { raise (WF_error("Content not allowed here")) }
+  | _
+      { raise Netconversion.Malformed_code }
+
+
+(* ======================================================================
+ * History:
+ * 
+ * $Log$
+ * Revision 1.1  2000/11/17 09:57:32  lpadovan
+ * Initial revision
+ *
+ * Revision 1.3  2000/08/14 22:18:34  gerd
+ *     Bad_character_stream -> Netconversion.Malformed_code
+ *
+ * Revision 1.2  2000/05/29 23:53:12  gerd
+ *     Updated because Markup_* modules have been renamed to Pxp_*.
+ *
+ * Revision 1.1  2000/05/20 20:33:25  gerd
+ *     Initial revision.
+ *
+ * 
+ *)