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

📄 html-gram.sml

📁 这是我们参加06年全国开源软件的竞赛作品
💻 SML
📖 第 1 页 / 共 5 页
字号:
\\000\000\\\024\000\182\000\025\000\111\000\000\000\\\000\000\\\020\000\092\000\021\000\187\000\022\000\186\000\023\000\022\000\\\028\000\185\000\033\000\021\000\041\000\089\000\042\000\184\000\\\043\000\019\000\044\000\018\000\045\000\017\000\047\000\016\000\\\052\000\015\000\000\000\\\000\000\\\000\000\\\000\000\\\035\000\192\000\036\000\191\000\000\000\\\039\000\194\000\040\000\109\000\041\000\089\000\042\000\108\000\\\043\000\019\000\044\000\018\000\045\000\017\000\047\000\016\000\\\052\000\015\000\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\050\000\201\000\051\000\085\000\052\000\084\000\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\046\000\207\000\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\026\000\220\000\027\000\146\000\000\000\\\000\000\\\039\000\222\000\040\000\109\000\041\000\089\000\042\000\108\000\\\043\000\019\000\044\000\018\000\045\000\017\000\047\000\016\000\\\052\000\015\000\000\000\\\020\000\092\000\021\000\187\000\022\000\186\000\023\000\022\000\\\028\000\223\000\033\000\021\000\041\000\089\000\042\000\184\000\\\043\000\019\000\044\000\018\000\045\000\017\000\047\000\016\000\\\052\000\015\000\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\018\000\234\000\022\000\162\000\041\000\089\000\042\000\161\000\\\043\000\019\000\044\000\018\000\045\000\017\000\047\000\016\000\\\052\000\015\000\000\000\\\019\000\236\000\022\000\235\000\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\015\000\241\000\017\000\093\000\020\000\092\000\021\000\091\000\\\022\000\090\000\023\000\022\000\033\000\021\000\041\000\089\000\\\042\000\088\000\043\000\019\000\044\000\018\000\045\000\017\000\\\047\000\016\000\052\000\015\000\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\015\000\243\000\017\000\093\000\020\000\092\000\021\000\091\000\\\022\000\090\000\023\000\022\000\033\000\021\000\041\000\089\000\\\042\000\088\000\043\000\019\000\044\000\018\000\045\000\017\000\\\047\000\016\000\052\000\015\000\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\020\000\092\000\021\000\187\000\022\000\186\000\023\000\022\000\\\028\000\244\000\033\000\021\000\041\000\089\000\042\000\184\000\\\043\000\019\000\044\000\018\000\045\000\017\000\047\000\016\000\\\052\000\015\000\000\000\\\030\000\245\000\000\000\\\020\000\092\000\021\000\249\000\022\000\248\000\023\000\022\000\\\029\000\247\000\033\000\021\000\000\000\\\020\000\092\000\021\000\187\000\022\000\186\000\023\000\022\000\\\028\000\251\000\033\000\021\000\041\000\089\000\042\000\184\000\\\043\000\019\000\044\000\018\000\045\000\017\000\047\000\016\000\\\052\000\015\000\000\000\\\000\000\\\000\000\\\000\000\\\035\000\252\000\036\000\191\000\000\000\\\000\000\\\037\000\255\000\038\000\254\000\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\049\000\003\001\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\031\000\005\001\000\000\\\032\000\007\001\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\019\000\009\001\022\000\235\000\000\000\\\000\000\\\018\000\011\001\022\000\162\000\041\000\089\000\042\000\161\000\\\043\000\019\000\044\000\018\000\045\000\017\000\047\000\016\000\\\052\000\015\000\000\000\\\000\000\\\000\000\\\008\000\012\001\009\000\006\000\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\020\000\092\000\021\000\249\000\022\000\248\000\023\000\022\000\\\029\000\013\001\033\000\021\000\000\000\\\020\000\092\000\021\000\187\000\022\000\186\000\023\000\022\000\\\028\000\015\001\033\000\021\000\041\000\089\000\042\000\184\000\\\043\000\019\000\044\000\018\000\045\000\017\000\047\000\016\000\\\052\000\015\000\000\000\\\020\000\092\000\021\000\187\000\022\000\186\000\023\000\022\000\\\028\000\016\001\033\000\021\000\041\000\089\000\042\000\184\000\\\043\000\019\000\044\000\018\000\045\000\017\000\047\000\016\000\\\052\000\015\000\000\000\\\000\000\\\000\000\\\000\000\\\037\000\017\001\038\000\254\000\000\000\\\000\000\\\013\000\019\001\015\000\141\000\017\000\093\000\020\000\092\000\\\021\000\091\000\022\000\090\000\023\000\022\000\033\000\021\000\\\041\000\089\000\042\000\088\000\043\000\019\000\044\000\018\000\\\045\000\017\000\047\000\016\000\052\000\015\000\000\000\\\013\000\020\001\015\000\141\000\017\000\093\000\020\000\092\000\\\021\000\091\000\022\000\090\000\023\000\022\000\033\000\021\000\\\041\000\089\000\042\000\088\000\043\000\019\000\044\000\018\000\\\045\000\017\000\047\000\016\000\052\000\015\000\000\000\\\000\000\\\048\000\021\001\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\018\000\022\001\022\000\162\000\041\000\089\000\042\000\161\000\\\043\000\019\000\044\000\018\000\045\000\017\000\047\000\016\000\\\052\000\015\000\000\000\\\000\000\\\000\000\\\000\000\\\020\000\092\000\021\000\187\000\022\000\186\000\023\000\022\000\\\028\000\023\001\033\000\021\000\041\000\089\000\042\000\184\000\\\043\000\019\000\044\000\018\000\045\000\017\000\047\000\016\000\\\052\000\015\000\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\\000\000\\"val numstates = 283val numrules = 155val s = ref "" and index = ref 0val string_to_int = fn () => let val i = !indexin index := i+2; Char.ord(String.sub(!s,i)) + Char.ord(String.sub(!s,i+1)) * 256endval string_to_list = fn s' =>    let val len = String.size s'        fun f () =           if !index < len then string_to_int() :: f()           else nil   in index := 0; s := s'; f ()   endval string_to_pairlist = fn (conv_key,conv_entry) =>     let fun f () =         case string_to_int()         of 0 => EMPTY          | n => PAIR(conv_key (n-1),conv_entry (string_to_int()),f())     in f     endval string_to_pairlist_default = fn (conv_key,conv_entry) =>    let val conv_row = string_to_pairlist(conv_key,conv_entry)    in fn () =>       let val default = conv_entry(string_to_int())           val row = conv_row()       in (row,default)       end   endval string_to_table = fn (convert_row,s') =>    let val len = String.size s'        fun f ()=           if !index < len then convert_row() :: f()           else nil     in (s := s'; index := 0; f ())     endlocal  val memo = Array.array(numstates+numrules,ERROR)  val _ =let fun g i=(Array.update(memo,i,REDUCE(i-numstates)); g(i+1))       fun f i =            if i=numstates then g i            else (Array.update(memo,i,SHIFT (STATE i)); f (i+1))          in f 0 handle Subscript => ()          endinval entry_to_action = fn 0 => ACCEPT | 1 => ERROR | j => Array.sub(memo,(j-2))endval gotoT=Array.fromList(string_to_table(string_to_pairlist(NT,STATE),gotoT))val actionRows=string_to_table(string_to_pairlist_default(T,entry_to_action),actionRows)val actionRowNumbers = string_to_list actionRowNumbersval actionT = let val actionRowLookUp=let val a=Array.fromList(actionRows) in fn i=>Array.sub(a,i) endin Array.fromList(map actionRowLookUp actionRowNumbers)endin LrTable.mkLrTable {actions=actionT,gotos=gotoT,numRules=numrules,numStates=numstates,initialState=STATE 0}endendlocal open Header intype pos = inttype arg = int -> HTMLAttrs.contextstructure MlyValue = structdatatype svalue = VOID | ntVOID of unit | ENTITY_REF of  (string) | CHAR_REF of  (string) | PCDATA of  (string) | START_UL of  (HTMLAttrVals.attrs) | START_TR of  (HTMLAttrVals.attrs) | START_TH of  (HTMLAttrVals.attrs) | START_TEXTAREA of  (HTMLAttrVals.attrs) | START_TD of  (HTMLAttrVals.attrs) | START_TABLE of  (HTMLAttrVals.attrs) | START_SELECT of  (HTMLAttrVals.attrs) | START_PRE of  (HTMLAttrVals.attrs) | TAG_PARAM of  (HTMLAttrVals.attrs) | START_P of  (HTMLAttrVals.attrs) | START_OPTION of  (HTMLAttrVals.attrs) | START_OL of  (HTMLAttrVals.attrs) | TAG_META of  (HTMLAttrVals.attrs) | START_MENU of  (HTMLAttrVals.attrs) | START_MAP of  (HTMLAttrVals.attrs) | TAG_LINK of  (HTMLAttrVals.attrs) | START_LI of  (HTMLAttrVals.attrs) | TAG_ISINDEX of  (HTMLAttrVals.attrs) | TAG_INPUT of  (HTMLAttrVals.attrs) | TAG_IMG of  (HTMLAttrVals.attrs) | TAG_HR of  (HTMLAttrVals.attrs) | START_H6 of  (HTMLAttrVals.attrs) | START_H5 of  (HTMLAttrVals.attrs) | START_H4 of  (HTMLAttrVals.attrs) | START_H3 of  (HTMLAttrVals.attrs) | START_H2 of  (HTMLAttrVals.attrs) | START_H1 of  (HTMLAttrVals.attrs) | START_FORM of  (HTMLAttrVals.attrs) | START_BASEFONT of  (HTMLAttrVals.attrs) | START_FONT of  (HTMLAttrVals.attrs) | START_DL of  (HTMLAttrVals.attrs) | START_DIV of  (HTMLAttrVals.attrs) | START_DIR of  (HTMLAttrVals.attrs) | START_CAPTION of  (HTMLAttrVals.attrs) | TAG_BR of  (HTMLAttrVals.attrs) | START_BODY of  (HTMLAttrVals.attrs) | TAG_BASE of  (HTMLAttrVals.attrs) | TAG_AREA of  (HTMLAttrVals.attrs) | START_APPLET of  (HTMLAttrVals.attrs) | START_A of  (HTMLAttrVals.attrs) | PCDataElem of  (HTML.pcdata) | PCDataList of  (HTML.pcdata list) | PCData of  (HTML.pcdata) | OptionList of  (HTML.select_option list) | Form of  (HTML.text) | AreaList of  (HTML.area list) | Special of  (HTML.text) | Phrase of  (HTML.text) | Font of  (HTML.text) | Text of  (HTML.text) | TextWOScript of  (HTML.text) | TextList' of  (HTML.text list) | TextList of  (HTML.text) | TableCell of  (HTML.table_cell)

⌨️ 快捷键说明

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