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

📄 html-gram.sml

📁 这是我们参加06年全国开源软件的竞赛作品
💻 SML
📖 第 1 页 / 共 5 页
字号:
  functor HTMLLrValsFn (    structure Token : TOKEN    structure HTMLAttrs : HTML_ATTRS) = structstructure ParserData=structstructure Header = struct(* html-gram * * COPYRIGHT (c) 1996 AT&T Research. * * This grammar parses HTML 3.2.  Note that it does not enforce exclusions * (for the content of FORM, PRE, etc).  Exclusions should be enforced as * a second pass over the parse tree. *)fun textList [text] = text  | textList l = HTML.TextList lfun blockList [blk] = blk  | blockList l = HTML.BlockList lfun textBlock l = HTML.TextBlock(textList l)    (* The elements of a definition list (<DL>) are tags (<DT>) and items (<DD>). * To avoid shift/reduce problems, we parse them and then group them. *)datatype deflist_item  = DL_tag of HTML.text  | DL_item of HTML.blockfun groupDefListContents [] = []  | groupDefListContents [DL_tag tag] = [{dt=[tag], dd=HTML.BlockList[]}]  | groupDefListContents (DL_item blk :: r) =      {dt=[], dd=blk} :: (groupDefListContents r)  | groupDefListContents (DL_tag tag :: r) = let      val {dt, dd} :: r' = groupDefListContents r      in	{dt=tag::dt, dd=dd} :: r'      end(* A list of Text, paragraphs and blocks requires grouping the Text items and * making an implicit paragraph.  We cannot directly use TextList because of * conflicts. *)datatype blklist_item  = BL_text of HTML.text list  | BL_block of HTML.block listfun consText (txt, BL_text tl :: r) = BL_text(txt::tl) :: r  | consText (txt, l) = BL_text[txt] :: lfun consBlock (blk, BL_block bl :: r) = BL_block(blk::bl) :: r  | consBlock (blk, l) = BL_block[blk] :: lfun mkBlock blks = let      fun f (BL_text tl) = textBlock tl	| f (BL_block bl) = blockList bl      in	blockList(List.map f blks)      endfun mkBody blks = HTML.BODY{	background = NONE,	bgcolor = NONE,	text = NONE,	link = NONE,	vlink = NONE,	alink = NONE,	content = mkBlock blks      }endstructure LrTable = Token.LrTablestructure Token = Tokenlocal open LrTable in val table=let val actionRows ="\\\001\000\001\000\000\000\000\000\\\001\000\002\000\081\000\004\000\080\000\006\000\079\000\009\000\078\000\\\012\000\077\000\014\000\076\000\016\000\075\000\018\000\074\000\\\021\000\073\000\023\000\072\000\025\000\071\000\029\000\070\000\\\031\000\069\000\033\000\068\000\035\000\067\000\039\000\066\000\\\041\000\065\000\043\000\064\000\045\000\063\000\047\000\062\000\\\049\000\061\000\051\000\060\000\053\000\059\000\055\000\058\000\\\057\000\057\000\061\000\056\000\064\000\055\000\066\000\054\000\\\067\000\053\000\069\000\052\000\074\000\051\000\076\000\050\000\\\079\000\049\000\083\000\048\000\085\000\047\000\086\000\046\000\\\088\000\045\000\092\000\044\000\094\000\043\000\096\000\042\000\\\098\000\041\000\102\000\040\000\104\000\039\000\106\000\038\000\\\110\000\037\000\118\000\036\000\120\000\035\000\122\000\034\000\\\124\000\033\000\126\000\032\000\127\000\031\000\128\000\030\000\000\000\\\001\000\003\000\241\000\000\000\\\001\000\005\000\240\000\000\000\\\001\000\007\000\235\000\000\000\\\001\000\010\000\234\000\000\000\\\001\000\013\000\233\000\000\000\\\001\000\015\000\232\000\000\000\\\001\000\020\000\004\001\000\000\\\001\000\022\000\231\000\000\000\\\001\000\024\000\230\000\000\000\\\001\000\026\000\229\000\000\000\\\001\000\030\000\228\000\000\000\\\001\000\032\000\227\000\000\000\\\001\000\034\000\226\000\000\000\\\001\000\036\000\223\000\000\000\\\001\000\040\000\221\000\000\000\\\001\000\042\000\220\000\000\000\\\001\000\044\000\219\000\000\000\\\001\000\046\000\218\000\000\000\\\001\000\048\000\217\000\000\000\\\001\000\050\000\216\000\000\000\\\001\000\052\000\215\000\000\000\\\001\000\054\000\214\000\000\000\\\001\000\056\000\213\000\000\000\\\001\000\058\000\212\000\000\000\\\001\000\065\000\211\000\000\000\\\001\000\070\000\210\000\000\000\\\001\000\075\000\208\000\000\000\\\001\000\077\000\207\000\000\000\\\001\000\080\000\206\000\000\000\\\001\000\087\000\205\000\000\000\\\001\000\089\000\204\000\000\000\\\001\000\091\000\170\000\000\000\\\001\000\091\000\244\000\000\000\\\001\000\093\000\202\000\000\000\\\001\000\095\000\201\000\000\000\\\001\000\097\000\200\000\000\000\\\001\000\099\000\199\000\000\000\\\001\000\101\000\169\000\000\000\\\001\000\103\000\198\000\000\000\\\001\000\105\000\197\000\000\000\\\001\000\107\000\255\000\000\000\\\001\000\108\000\003\001\112\000\002\001\000\000\\\001\000\111\000\192\000\000\000\\\001\000\114\000\083\000\000\000\\\001\000\115\000\242\000\000\000\\\001\000\116\000\195\000\000\000\\\001\000\119\000\191\000\000\000\\\001\000\121\000\190\000\000\000\\\001\000\123\000\185\000\000\000\\\001\000\125\000\183\000\000\000\\\029\001\000\000\\\030\001\062\000\004\000\000\000\\\031\001\000\000\\\032\001\063\000\109\000\000\000\\\033\001\000\000\\\034\001\000\000\\\035\001\059\000\007\000\000\000\\\036\001\000\000\\\037\001\060\000\085\000\000\000\\\038\001\000\000\\\039\001\000\000\\\040\001\011\000\016\000\068\000\015\000\073\000\014\000\078\000\013\000\\\090\000\012\000\100\000\011\000\000\000\\\041\001\000\000\\\042\001\000\000\\\043\001\000\000\\\044\001\000\000\\\045\001\000\000\\\046\001\000\000\\\047\001\000\000\\\048\001\000\000\\\049\001\017\000\107\000\000\000\\\050\001\000\000\\\051\001\000\000\\\052\001\000\000\\\053\001\000\000\\\054\001\000\000\\\055\001\000\000\\\056\001\000\000\\\057\001\000\000\\\058\001\002\000\081\000\004\000\080\000\006\000\079\000\009\000\078\000\\\012\000\077\000\014\000\076\000\018\000\074\000\021\000\073\000\\\023\000\072\000\025\000\071\000\029\000\070\000\031\000\069\000\\\033\000\068\000\035\000\067\000\039\000\066\000\041\000\065\000\\\043\000\064\000\045\000\063\000\047\000\062\000\049\000\061\000\\\051\000\060\000\053\000\059\000\055\000\058\000\057\000\057\000\\\061\000\056\000\064\000\055\000\066\000\054\000\067\000\053\000\\\068\000\098\000\069\000\052\000\074\000\051\000\076\000\050\000\\\079\000\049\000\083\000\048\000\085\000\047\000\086\000\046\000\\\088\000\045\000\090\000\097\000\092\000\044\000\094\000\043\000\\\096\000\042\000\098\000\041\000\102\000\040\000\104\000\039\000\\\106\000\038\000\110\000\037\000\118\000\036\000\120\000\035\000\\\122\000\034\000\124\000\033\000\126\000\032\000\127\000\031\000\\\128\000\030\000\000\000\\\059\001\000\000\\\060\001\000\000\\\061\001\000\000\\\062\001\000\000\\\063\001\000\000\\\064\001\004\000\080\000\014\000\076\000\021\000\073\000\031\000\069\000\\\033\000\068\000\035\000\067\000\045\000\063\000\047\000\062\000\\\049\000\061\000\051\000\060\000\053\000\059\000\055\000\058\000\\\057\000\057\000\061\000\056\000\068\000\098\000\076\000\050\000\\\079\000\049\000\083\000\048\000\084\000\103\000\086\000\046\000\\\106\000\038\000\122\000\034\000\000\000\\\064\001\004\000\080\000\014\000\076\000\021\000\073\000\031\000\069\000\\\033\000\068\000\035\000\067\000\045\000\063\000\047\000\062\000\\\049\000\061\000\051\000\060\000\053\000\059\000\055\000\058\000\\\057\000\057\000\061\000\056\000\068\000\098\000\076\000\050\000\\\079\000\049\000\083\000\048\000\084\000\173\000\086\000\046\000\\\106\000\038\000\122\000\034\000\000\000\\\064\001\004\000\080\000\014\000\076\000\021\000\073\000\031\000\069\000\\\033\000\068\000\035\000\067\000\045\000\063\000\047\000\062\000\\\049\000\061\000\051\000\060\000\053\000\059\000\055\000\058\000\\\057\000\057\000\061\000\056\000\068\000\098\000\076\000\050\000\\\079\000\049\000\083\000\048\000\084\000\178\000\086\000\046\000\\\106\000\038\000\122\000\034\000\000\000\\\065\001\000\000\\\066\001\000\000\\\067\001\000\000\\\068\001\000\000\\\069\001\000\000\\\070\001\000\000\\\071\001\000\000\\\072\001\000\000\\\073\001\000\000\\\074\001\000\000\\\075\001\000\000\\\076\001\002\000\081\000\006\000\079\000\009\000\078\000\012\000\077\000\\\018\000\074\000\023\000\072\000\025\000\071\000\029\000\070\000\\\039\000\066\000\041\000\065\000\043\000\064\000\064\000\055\000\\\066\000\054\000\067\000\053\000\069\000\052\000\074\000\051\000\\\083\000\048\000\085\000\047\000\088\000\045\000\090\000\097\000\\\092\000\044\000\094\000\043\000\096\000\042\000\098\000\041\000\\\102\000\040\000\104\000\039\000\110\000\037\000\118\000\036\000\\\120\000\035\000\124\000\033\000\126\000\032\000\127\000\031\000\\\128\000\030\000\000\000\\\077\001\000\000\\\078\001\000\000\\\079\001\000\000\\\080\001\083\000\048\000\084\000\239\000\000\000\\\080\001\083\000\048\000\084\000\012\001\000\000\\\081\001\000\000\\\082\001\000\000\\\083\001\000\000\\\084\001\000\000\\\085\001\000\000\\\086\001\000\000\\\087\001\000\000\\\088\001\000\000\\\089\001\000\000\\\090\001\000\000\\\091\001\000\000\\\092\001\000\000\\\093\001\000\000\\\094\001\000\000\\\095\001\000\000\\\096\001\000\000\\\097\001\000\000\\\098\001\000\000\\\099\001\071\000\115\000\000\000\\\100\001\000\000\\\101\001\000\000\\\102\001\027\000\151\000\037\000\150\000\000\000\\\103\001\000\000\\\104\001\000\000\\\105\001\000\000\\\106\001\002\000\081\000\006\000\079\000\009\000\078\000\012\000\077\000\\\014\000\076\000\018\000\074\000\021\000\073\000\023\000\072\000\\\025\000\071\000\029\000\070\000\031\000\069\000\033\000\068\000\\\035\000\067\000\039\000\066\000\041\000\065\000\043\000\064\000\\\045\000\063\000\061\000\056\000\064\000\055\000\066\000\054\000\\\067\000\053\000\068\000\098\000\069\000\052\000\074\000\051\000\\\076\000\050\000\079\000\049\000\083\000\048\000\085\000\047\000\\\086\000\046\000\088\000\045\000\090\000\097\000\092\000\044\000\\\094\000\043\000\096\000\042\000\098\000\041\000\102\000\040\000\\\104\000\039\000\106\000\038\000\110\000\037\000\118\000\036\000\\\120\000\035\000\122\000\034\000\124\000\033\000\126\000\032\000\\\127\000\031\000\128\000\030\000\000\000\\\107\001\000\000\\\108\001\000\000\\\109\001\000\000\\\110\001\000\000\\\111\001\014\000\076\000\021\000\073\000\031\000\069\000\033\000\068\000\\\035\000\067\000\045\000\063\000\061\000\056\000\068\000\098\000\\\076\000\050\000\079\000\049\000\083\000\048\000\084\000\252\000\\\086\000\046\000\106\000\038\000\122\000\034\000\000\000\\\111\001\014\000\076\000\021\000\073\000\031\000\069\000\033\000\068\000\\\035\000\067\000\045\000\063\000\061\000\056\000\068\000\098\000\\\076\000\050\000\079\000\049\000\083\000\048\000\084\000\016\001\\\086\000\046\000\106\000\038\000\122\000\034\000\000\000\\\112\001\000\000\\\113\001\000\000\\\114\001\000\000\\\115\001\072\000\248\000\000\000\\\116\001\000\000\\\117\001\038\000\008\001\000\000\\\118\001\000\000\\\119\001\028\000\010\001\000\000\\\120\001\000\000\\\121\001\000\000\\\122\001\019\000\120\000\000\000\\\123\001\000\000\\\124\001\116\000\195\000\000\000\\\125\001\000\000\\\126\001\117\000\020\001\000\000\\\127\001\000\000\\\128\001\108\000\003\001\112\000\002\001\000\000\\\129\001\000\000\\\130\001\000\000\\\131\001\113\000\026\001\000\000\\\132\001\000\000\\\133\001\109\000\027\001\000\000\\\134\001\000\000\\\135\001\002\000\081\000\006\000\079\000\009\000\078\000\012\000\077\000\\\018\000\074\000\023\000\072\000\025\000\071\000\029\000\070\000\\\039\000\066\000\041\000\065\000\043\000\064\000\064\000\055\000\\\066\000\054\000\067\000\053\000\069\000\052\000\074\000\051\000\\\085\000\047\000\088\000\045\000\090\000\097\000\092\000\044\000\\\094\000\043\000\096\000\042\000\098\000\041\000\102\000\040\000\\\104\000\039\000\110\000\037\000\118\000\036\000\120\000\035\000\\\124\000\033\000\126\000\032\000\127\000\031\000\128\000\030\000\000\000\\\136\001\000\000\\\137\001\000\000\\\138\001\000\000\\\139\001\000\000\\\140\001\000\000\\\141\001\000\000\\\142\001\000\000\\\143\001\000\000\\\144\001\000\000\\\145\001\000\000\\\146\001\000\000\\\147\001\000\000\

⌨️ 快捷键说明

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