⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 html-lex.sml

📁 这是我们参加06年全国开源软件的竞赛作品
💻 SML
📖 第 1 页 / 共 3 页
字号:
functor HTMLLexFn (  structure Tokens : HTML_TOKENS  structure Err : HTML_ERROR  structure HTMLAttrs : HTML_ATTRS)=   struct    structure UserDeclarations =      struct(* html-lex * * COPYRIGHT (c) 1995 AT&T Bell Laboratories. * COPYRIGHT (c) 1996 AT&T Research. * * A scanner for HTML. * * TODO: *    Recognize the DOCTYPE element *	<!DOCTYPE HTML PUBLIC "..."> *    Clean-up the scanning of start tags (do we need Err?). *    Whitespace in PRE elements should be preserved, but how? *)structure T = Tokensstructure Elems = HTMLElementsFn (  structure Tokens = Tokens  structure Err = Err  structure HTMLAttrs = HTMLAttrs)type pos = inttype svalue = T.svaluetype arg = (((string * int * int) -> unit) * string option)type ('a, 'b) token = ('a, 'b) T.tokentype lexresult= (svalue, pos) tokenfun eof _ = Tokens.EOF(0, 0)(* a buffer for collecting a string piecewise *)val buffer = ref ([] : string list)fun addStr s = (buffer := s :: !buffer)fun getStr () = (String.concat(List.rev(! buffer)) before (buffer := []))end (* end of user routines *)exception LexError (* raised if illegal leaf action tried *)structure Internal =	structdatatype yyfinstate = N of inttype statedata = {fin : yyfinstate list, trans: string}(* transition & final state table *)val tab = letval s = [  (0, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"), (1, "\009\009\009\009\009\009\009\009\009\028\029\009\009\009\009\009\\\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\\\028\009\009\009\009\009\020\009\009\009\009\009\009\009\009\009\\\009\009\009\009\009\009\009\009\009\009\009\009\011\009\009\009\\\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\\\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\\\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\\\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\\\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\\\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\\\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\\\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\\\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\\\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\\\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\\\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009\009"), (3, "\030\030\030\030\030\030\030\030\030\030\033\030\030\030\030\030\\\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\\\030\030\030\030\030\030\030\030\030\030\030\030\030\031\030\030\\\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\\\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\\\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\\\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\\\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\\\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\\\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\\\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\\\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\\\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\\\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\\\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\\\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030\030"), (5, "\034\034\034\034\034\034\034\034\034\038\039\034\034\034\034\034\\\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\\\038\034\034\034\034\034\034\034\034\034\034\034\034\036\034\034\\\034\034\034\034\034\034\034\034\034\034\034\034\034\034\035\034\\\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\\\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\\\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\\\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\\\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\\\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\\\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\\\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\\\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\\\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\\\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\\\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034\034"), (7, "\040\040\040\040\040\040\040\040\040\051\053\040\040\040\040\040\\\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\\\051\040\048\040\040\040\040\045\040\040\040\040\040\041\041\040\\\041\041\041\041\041\041\041\041\041\041\040\040\040\044\043\040\\\040\041\041\041\041\041\041\041\041\041\041\041\041\041\041\041\\\041\041\041\041\041\041\041\041\041\041\041\040\040\040\040\040\\\040\041\041\041\041\041\041\041\041\041\041\041\041\041\041\041\\\041\041\041\041\041\041\041\041\041\041\041\040\040\040\040\040\\\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\\\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\\\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\\\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\\\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\\\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\\\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\\\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"), (9, "\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\\\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\\\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\\\010\010\010\010\010\010\010\010\010\010\010\010\000\010\010\010\\\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\\\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\\\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\\\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\\\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\\\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\\\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\\\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\\\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\\\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\\\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\\\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010"), (11, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\017\000\000\000\000\000\000\000\000\000\000\000\000\000\013\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\\\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\\\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\\\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"), (12, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\012\012\000\\\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\\\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\\\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\\\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\\\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"), (13, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\014\014\014\014\014\014\014\014\014\014\014\014\014\014\014\\\014\014\014\014\014\014\014\014\014\014\014\000\000\000\000\000\\\000\014\014\014\014\014\014\014\014\014\014\014\014\014\014\014\\\014\014\014\014\014\014\014\014\014\014\014\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"), (14, "\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\016\000\000\000\000\000\000\000\000\000\000\000\000\014\014\000\\\014\014\014\014\014\014\014\014\014\014\000\000\000\000\015\000\\\000\014\014\014\014\014\014\014\014\014\014\014\014\014\014\014\\\014\014\014\014\014\014\014\014\014\014\014\000\000\000\000\000\\\000\014\014\014\014\014\014\014\014\014\014\014\014\014\014\014\\\014\014\014\014\014\014\014\014\014\014\014\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -