X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Fpxp%2Fpxp%2Flexers%2Fpxp_lex_declaration.src;fp=helm%2FDEVEL%2Fpxp%2Fpxp%2Flexers%2Fpxp_lex_declaration.src;h=4f53d9760bec5d66d38bf78ab29ad13d6105a83d;hb=c03d2c1fdab8d228cb88aaba5ca0f556318bebc5;hp=0000000000000000000000000000000000000000;hpb=758057e85325f94cd88583feb1fdf6b038e35055;p=helm.git diff --git a/helm/DEVEL/pxp/pxp/lexers/pxp_lex_declaration.src b/helm/DEVEL/pxp/pxp/lexers/pxp_lex_declaration.src new file mode 100644 index 000000000..4f53d9760 --- /dev/null +++ b/helm/DEVEL/pxp/pxp/lexers/pxp_lex_declaration.src @@ -0,0 +1,138 @@ +(* $Id$ + * ---------------------------------------------------------------------- + * + *) + + +{ + open Pxp_types + open Pxp_lexer_types + +#insert pxp_lex_aux.src + +#insert open_pxp_lex_aux_*.src +#insert open_pxp_lex_misc_*.src + +} + +#insert pxp_lex_defs_*.def + +(* scan_declaration: after "[" in DTD until matching "]" *) + +rule scan_declaration = parse + ws+ + { tok_Ignore__Declaration } + | '%' name ';' + { let s = Lexing.lexeme lexbuf in + (PERef (String.sub s 1 (String.length s - 2))), Declaration } + | '%' + { tok_Percent__Declaration } + | '&' + { raise(WF_error("References to general entities not allowed in DTDs")) } + | name + { Name (Lexing.lexeme lexbuf), Declaration } + | nmtoken + { Nametoken (Lexing.lexeme lexbuf), Declaration } + | '+' + { tok_Plus__Declaration } + | '*' + { tok_Star__Declaration } + | '|' + { tok_Bar__Declaration } + | ',' + { tok_Comma__Declaration } + | '?' + { tok_Qmark__Declaration } + | '(' + { tok_Lparen__Declaration } + | ")+" + { tok_RparenPlus__Declaration } + | ")*" + { tok_RparenStar__Declaration } + | ")?" + { tok_RparenQmark__Declaration } + | ')' + { tok_Rparen__Declaration } + | "#REQUIRED" + { tok_Required__Declaration } + | "#IMPLIED" + { tok_Implied__Declaration } + | "#FIXED" + { tok_Fixed__Declaration } + | "#PCDATA" + { tok_Pcdata__Declaration } + | "" + { tok_Conditional_end__Declaration } + | "[" + { tok_Conditional_body__Declaration } + + (* TODO: PIs modified *) + + | "" + { scan_pi (Lexing.lexeme lexbuf) scan_xml_pi, Declaration } + | "' + { tok_Decl_rangle__Declaration } + | ']' + { tok_Dtd_end__Document_type } + | eof + { tok_Eof__Declaration } + | " 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. + * + * + *)