Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / lib / smlnj-lib / smlnj-lib.patch
CommitLineData
7f918cf1
CE
1diff --git a/Controls/controls-lib.mlb b/Controls/controls-lib.mlb
2new file mode 100644
3index 0000000..501b6f8
4--- /dev/null
5+++ b/Controls/controls-lib.mlb
6@@ -0,0 +1,178 @@
7+
8+ann
9+ "nonexhaustiveBind warn" "nonexhaustiveMatch warn"
10+ "redundantBind warn" "redundantMatch warn"
11+ "sequenceNonUnit ignore"
12+ "warnUnused false" "forceUsed"
13+in
14+
15+local
16+ basis l8 =
17+ bas
18+ (* $/basis.cm ====> *) $(SML_LIB)/basis/basis.mlb
19+ end
20+ basis l4 =
21+ bas
22+ (* $/smlnj-lib.cm ====> *) $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
23+ end
24+in
25+local
26+ $(SML_LIB)/basis/pervasive.mlb
27+ local
28+ open l4
29+ in
30+ structure gs_0 = GetOpt
31+ end
32+ local
33+ open l8
34+ in
35+ structure gs_1 = Option
36+ end
37+ local
38+ open l8
39+ in
40+ structure gs_2 = List
41+ end
42+ local
43+ open l4
44+ in
45+ structure gs_3 = Atom
46+ end
47+ local
48+ open l8
49+ in
50+ structure gs_4 = Int
51+ end
52+ local
53+ structure GetOpt = gs_0
54+ controls-sig.sml
55+ in
56+ signature gs_5 = CONTROLS
57+ end
58+ local
59+ open l4
60+ in
61+ structure gs_6 = AtomTable
62+ end
63+ local
64+ structure Atom = gs_3
65+ structure AtomTable = gs_6
66+ structure Int = gs_4
67+ structure List = gs_2
68+ control-reps.sml
69+ in
70+ structure gs_7 = ControlReps
71+ end
72+ local
73+ structure Atom = gs_3
74+ signature CONTROLS = gs_5
75+ structure ControlReps = gs_7
76+ structure GetOpt = gs_0
77+ structure Int = gs_4
78+ structure List = gs_2
79+ structure Option = gs_1
80+ controls.sml
81+ in
82+ structure gs_8 = Controls
83+ end
84+ local
85+ open l4
86+ in
87+ structure gs_9 = ListMergeSort
88+ end
89+ local
90+ structure Atom = gs_3
91+ structure Controls = gs_8
92+ control-set-sig.sml
93+ in
94+ signature gs_10 = CONTROL_SET
95+ end
96+ local
97+ structure AtomTable = gs_6
98+ signature CONTROL_SET = gs_10
99+ structure ControlReps = gs_7
100+ structure Controls = gs_8
101+ structure ListMergeSort = gs_9
102+ structure Option = gs_1
103+ control-set.sml
104+ in
105+ structure gs_11 = ControlSet
106+ end
107+ local
108+ structure ControlSet = gs_11
109+ structure Controls = gs_8
110+ registry-sig.sml
111+ in
112+ signature gs_12 = CONTROL_REGISTRY
113+ end
114+ local
115+ open l8
116+ in
117+ structure gs_13 = String
118+ end
119+ local
120+ open l8
121+ in
122+ structure gs_14 = Real
123+ end
124+ local
125+ open l8
126+ in
127+ structure gs_15 = Char
128+ end
129+ local
130+ open l8
131+ in
132+ structure gs_16 = Bool
133+ end
134+ local
135+ structure Controls = gs_8
136+ control-util-sig.sml
137+ in
138+ signature gs_17 = CONTROL_UTIL
139+ end
140+ local
141+ structure Bool = gs_16
142+ signature CONTROL_UTIL = gs_17
143+ structure Char = gs_15
144+ structure Controls = gs_8
145+ structure Int = gs_4
146+ structure List = gs_2
147+ structure Real = gs_14
148+ structure String = gs_13
149+ control-util.sml
150+ in
151+ structure gs_18 = ControlUtil
152+ end
153+ local
154+ open l8
155+ in
156+ structure gs_19 = OS
157+ end
158+ local
159+ structure Atom = gs_3
160+ structure AtomTable = gs_6
161+ signature CONTROL_REGISTRY = gs_12
162+ structure ControlReps = gs_7
163+ structure ControlSet = gs_11
164+ structure Controls = gs_8
165+ structure List = gs_2
166+ structure ListMergeSort = gs_9
167+ structure OS = gs_19
168+ registry.sml
169+ in
170+ structure gs_20 = ControlRegistry
171+ end
172+in
173+ signature CONTROLS = gs_5
174+ signature CONTROL_REGISTRY = gs_12
175+ signature CONTROL_SET = gs_10
176+ signature CONTROL_UTIL = gs_17
177+ structure ControlRegistry = gs_20
178+ structure ControlSet = gs_11
179+ structure ControlUtil = gs_18
180+ structure Controls = gs_8
181+end
182+end
183+
184+end
185diff --git a/HTML/html-lex.sml b/HTML/html-lex.sml
186index f1de5c0..9ffd254 100644
187--- a/HTML/html-lex.sml
188+++ b/HTML/html-lex.sml
189@@ -178,7 +178,7 @@ Vector.fromList []
190 (fn (~1, _, oldMatches) => yystuck oldMatches
191 | (curState, strm, oldMatches) => let
192 val (transitions, finals') = Vector.sub (yytable, curState)
193- val finals = map (fn i => Vector.sub (actTable, i)) finals'
194+ val finals = List.map (fn i => Vector.sub (actTable, i)) finals'
195 fun tryfinal() =
196 yystuck (yyactsToMatches (strm, finals, oldMatches))
197 fun find (c, []) = NONE
198@@ -990,7 +990,6 @@ end
199 end
200 in
201 fun makeLexer yyinputN = mk (yyInput.mkStream yyinputN)
202- fun makeLexer' ins = mk (yyInput.mkStream ins)
203 end
204
205 end
206diff --git a/HTML/html-lib.mlb b/HTML/html-lib.mlb
207new file mode 100644
208index 0000000..a5f8ca3
209--- /dev/null
210+++ b/HTML/html-lib.mlb
211@@ -0,0 +1,302 @@
212+
213+ann
214+ "nonexhaustiveBind warn" "nonexhaustiveMatch warn"
215+ "redundantBind warn" "redundantMatch warn"
216+ "sequenceNonUnit ignore"
217+ "warnUnused false" "forceUsed"
218+ "allowOrPats true" "allowVectorExpsAndPats true"
219+in
220+
221+local
222+ basis l5 =
223+ bas
224+ (* $/basis.cm ====> *) $(SML_LIB)/basis/basis.mlb $(SML_LIB)/basis/unsafe.mlb
225+ end
226+ basis l46 =
227+ bas
228+ (* $/smlnj-lib.cm ====> *) $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
229+ end
230+ basis l35 =
231+ bas
232+ (* $/ml-yacc-lib.cm ====> *) $(SML_LIB)/mlyacc-lib/mlyacc-lib.mlb
233+ end
234+in
235+local
236+ $(SML_LIB)/basis/pervasive.mlb
237+ local
238+ open l5
239+ in
240+ structure gs_0 = General
241+ end
242+ local
243+ open l5
244+ in
245+ structure gs_1 = String
246+ end
247+ local
248+ open l5
249+ in
250+ structure gs_2 = List
251+ end
252+ local
253+ open l5
254+ in
255+ structure gs_3 = Char
256+ end
257+ local
258+ html-sig.sml
259+ in
260+ signature gs_4 = HTML
261+ end
262+ local
263+ structure Char = gs_3
264+ structure General = gs_0
265+ signature HTML = gs_4
266+ structure List = gs_2
267+ structure String = gs_1
268+ html.sml
269+ in
270+ structure gs_5 = HTML
271+ end
272+ local
273+ structure HTML = gs_5
274+ make-html.sml
275+ in
276+ structure gs_6 = MakeHTML
277+ end
278+ local
279+ structure HTML = gs_5
280+ html-defaults.sml
281+ in
282+ structure gs_7 = HTMLDefaults
283+ end
284+ local
285+ html-error-sig.sml
286+ in
287+ signature gs_8 = HTML_ERROR
288+ end
289+ local
290+ open l35
291+ in
292+ functor gs_9 = Join
293+ functor gs_10 = JoinWithArg
294+ end
295+ local
296+ open l35
297+ in
298+ structure gs_11 = LrParser
299+ end
300+ local
301+ open l5
302+ in
303+ structure gs_12 = TextIO
304+ end
305+ local
306+ open l46
307+ in
308+ structure gs_13 = Format
309+ end
310+ local
311+ structure Format = gs_13
312+ structure HTML = gs_5
313+ signature HTML_ERROR = gs_8
314+ structure List = gs_2
315+ check-html-fn.sml
316+ in
317+ functor gs_14 = CheckHTMLFn
318+ end
319+ local
320+ open l5
321+ in
322+ structure gs_15 = IO
323+ end
324+ local
325+ open l5
326+ in
327+ structure gs_16 = TextPrimIO
328+ end
329+ local
330+ open l5
331+ in
332+ structure gs_17 = Vector
333+ end
334+ local
335+ open l5
336+ in
337+ structure gs_18 = Substring
338+ end
339+ local
340+ open l46
341+ in
342+ functor gs_19 = HashTableFn
343+ end
344+ local
345+ open l46
346+ in
347+ structure gs_20 = HashString
348+ end
349+ local
350+ html-attr-vals.sml
351+ in
352+ structure gs_21 = HTMLAttrVals
353+ end
354+ local
355+ structure HTML = gs_5
356+ structure HTMLAttrVals = gs_21
357+ html-attrs-sig.sml
358+ in
359+ signature gs_22 = HTML_ATTRS
360+ end
361+ local
362+ open l35
363+ in
364+ signature gs_23 = ARG_LEXER
365+ signature gs_24 = ARG_PARSER
366+ signature gs_25 = LEXER
367+ signature gs_26 = LR_PARSER
368+ signature gs_27 = LR_TABLE
369+ signature gs_28 = PARSER
370+ signature gs_29 = PARSER_DATA
371+ signature gs_30 = STREAM
372+ signature gs_31 = TOKEN
373+ end
374+ local
375+ signature ARG_LEXER = gs_23
376+ signature ARG_PARSER = gs_24
377+ structure HTMLAttrVals = gs_21
378+ signature LEXER = gs_25
379+ signature LR_PARSER = gs_26
380+ signature LR_TABLE = gs_27
381+ signature PARSER = gs_28
382+ signature PARSER_DATA = gs_29
383+ signature STREAM = gs_30
384+ signature TOKEN = gs_31
385+ html-gram.sig
386+ in
387+ signature gs_32 = HTML_LRVALS
388+ signature gs_33 = HTML_TOKENS
389+ end
390+ local
391+ structure Char = gs_3
392+ signature HTML_ATTRS = gs_22
393+ signature HTML_ERROR = gs_8
394+ signature HTML_LRVALS = gs_32
395+ signature HTML_TOKENS = gs_33
396+ structure HashString = gs_20
397+ functor HashTableFn = gs_19
398+ structure List = gs_2
399+ structure String = gs_1
400+ structure Substring = gs_18
401+ html-elements-fn.sml
402+ in
403+ functor gs_34 = HTMLElementsFn
404+ end
405+ local
406+ structure Char = gs_3
407+ functor HTMLElementsFn = gs_34
408+ signature HTML_ATTRS = gs_22
409+ signature HTML_ERROR = gs_8
410+ signature HTML_LRVALS = gs_32
411+ signature HTML_TOKENS = gs_33
412+ structure IO = gs_15
413+ structure List = gs_2
414+ structure String = gs_1
415+ structure TextIO = gs_12
416+ structure TextPrimIO = gs_16
417+ structure Vector = gs_17
418+ html-lex.sml
419+ in
420+ functor gs_35 = HTMLLexFn
421+ end
422+ local
423+ open l5
424+ in
425+ structure gs_36 = Array
426+ end
427+ local
428+ signature ARG_LEXER = gs_23
429+ signature ARG_PARSER = gs_24
430+ structure Array = gs_36
431+ structure Char = gs_3
432+ structure General = gs_0
433+ structure HTML = gs_5
434+ structure HTMLAttrVals = gs_21
435+ signature HTML_ATTRS = gs_22
436+ signature HTML_LRVALS = gs_32
437+ signature HTML_TOKENS = gs_33
438+ signature LEXER = gs_25
439+ signature LR_PARSER = gs_26
440+ signature LR_TABLE = gs_27
441+ structure List = gs_2
442+ signature PARSER = gs_28
443+ signature PARSER_DATA = gs_29
444+ signature STREAM = gs_30
445+ structure String = gs_1
446+ signature TOKEN = gs_31
447+ html-gram.sml
448+ in
449+ functor gs_37 = HTMLLrValsFn
450+ end
451+ local
452+ open l5
453+ in
454+ structure gs_38 = Int
455+ end
456+ local
457+ structure Array = gs_36
458+ structure Char = gs_3
459+ structure HTML = gs_5
460+ structure HTMLAttrVals = gs_21
461+ signature HTML_ATTRS = gs_22
462+ signature HTML_ERROR = gs_8
463+ structure HashString = gs_20
464+ functor HashTableFn = gs_19
465+ structure Int = gs_38
466+ structure List = gs_2
467+ structure String = gs_1
468+ html-attrs-fn.sml
469+ in
470+ functor gs_39 = HTMLAttrsFn
471+ end
472+ local
473+ functor CheckHTMLFn = gs_14
474+ structure HTML = gs_5
475+ functor HTMLAttrsFn = gs_39
476+ functor HTMLLexFn = gs_35
477+ functor HTMLLrValsFn = gs_37
478+ signature HTML_ERROR = gs_8
479+ functor Join = gs_9
480+ functor JoinWithArg = gs_10
481+ structure LrParser = gs_11
482+ structure TextIO = gs_12
483+ html-parser-fn.sml
484+ in
485+ functor gs_40 = HTMLParserFn
486+ end
487+ local
488+ open l46
489+ in
490+ structure gs_41 = ListFormat
491+ end
492+ local
493+ structure Format = gs_13
494+ structure HTML = gs_5
495+ structure Int = gs_38
496+ structure List = gs_2
497+ structure ListFormat = gs_41
498+ pr-html.sml
499+ in
500+ structure gs_42 = PrHTML
501+ end
502+in
503+ signature HTML = gs_4
504+ structure HTML = gs_5
505+ structure HTMLDefaults = gs_7
506+ functor HTMLParserFn = gs_40
507+ signature HTML_ERROR = gs_8
508+ structure MakeHTML = gs_6
509+ structure PrHTML = gs_42
510+end
511+end
512+
513+end
514diff --git a/HTML4/html4-attr.g.sml b/HTML4/html4-attr.g.sml
515index cfc415b..e0c2765 100644
516--- a/HTML4/html4-attr.g.sml
517+++ b/HTML4/html4-attr.g.sml
518@@ -1,43 +1,41 @@
519-structure
520-HTML4AttrTokens = struct
521-
522- datatype token = EOF
523- | NUMBER of string
524- | DOT
525- | STRINGLIT of string
526+structure HTML4AttrTokens =
527+ struct
528+ datatype token
529+ = NAME of Atom.atom
530 | EQUALS
531- | NAME of Atom.atom
532-
533- val allToks = [EOF, DOT, EQUALS]
534-
535+ | STRINGLIT of string
536+ | DOT
537+ | NUMBER of string
538+ | EOF
539+ val allToks = [
540+ EQUALS, DOT, EOF
541+ ]
542 fun toString tok =
543 (case (tok)
544- of (EOF) => "EOF"
545- | (NUMBER(_)) => "NUMBER"
546- | (DOT) => "."
547- | (STRINGLIT(_)) => "STRINGLIT"
548+ of (NAME(_)) => "NAME"
549 | (EQUALS) => "="
550- | (NAME(_)) => "NAME"
551+ | (STRINGLIT(_)) => "STRINGLIT"
552+ | (DOT) => "."
553+ | (NUMBER(_)) => "NUMBER"
554+ | (EOF) => "EOF"
555 (* end case *))
556 fun isKW tok =
557 (case (tok)
558- of (EOF) => false
559- | (NUMBER(_)) => false
560- | (DOT) => false
561- | (STRINGLIT(_)) => false
562+ of (NAME(_)) => false
563 | (EQUALS) => false
564- | (NAME(_)) => false
565+ | (STRINGLIT(_)) => false
566+ | (DOT) => false
567+ | (NUMBER(_)) => false
568+ | (EOF) => false
569 (* end case *))
570+ fun isEOF EOF = true
571+ | isEOF _ = false
572+ end (* HTML4AttrTokens *)
573
574- fun isEOF EOF = true
575- | isEOF _ = false
576-
577-end
578-
579-functor HTML4AttrParseFn(Lex : ANTLR_LEXER) = struct
580+functor HTML4AttrParseFn (Lex : ANTLR_LEXER) = struct
581
582 local
583- structure Tok =
584+ structure Tok =
585 HTML4AttrTokens
586 structure UserCode =
587 struct
588@@ -60,47 +58,81 @@ fun attr_value_PROD_3_ACT (SR, NUMBER, SR_SPAN : (Lex.pos * Lex.pos), NUMBER_SPA
589 structure Err = AntlrErrHandler(
590 structure Tok = Tok
591 structure Lex = Lex)
592+
593+(* replace functor with inline structure for better optimization
594 structure EBNF = AntlrEBNF(
595 struct
596 type strm = Err.wstream
597 val getSpan = Err.getSpan
598 end)
599+*)
600+ structure EBNF =
601+ struct
602+ fun optional (pred, parse, strm) =
603+ if pred strm
604+ then let
605+ val (y, span, strm') = parse strm
606+ in
607+ (SOME y, span, strm')
608+ end
609+ else (NONE, Err.getSpan strm, strm)
610+
611+ fun closure (pred, parse, strm) = let
612+ fun iter (strm, (left, right), ys) =
613+ if pred strm
614+ then let
615+ val (y, (_, right'), strm') = parse strm
616+ in iter (strm', (left, right'), y::ys)
617+ end
618+ else (List.rev ys, (left, right), strm)
619+ in
620+ iter (strm, Err.getSpan strm, [])
621+ end
622+
623+ fun posclos (pred, parse, strm) = let
624+ val (y, (left, _), strm') = parse strm
625+ val (ys, (_, right), strm'') = closure (pred, parse, strm')
626+ in
627+ (y::ys, (left, right), strm'')
628+ end
629+ end
630
631 fun mk lexFn = let
632 fun getS() = {}
633 fun putS{} = ()
634-fun unwrap (ret, strm, repairs) = (ret, strm, repairs) val (eh, lex) = Err.mkErrHandler {get = getS, put = putS}
635+fun unwrap (ret, strm, repairs) = (ret, strm, repairs)
636+ val (eh, lex) = Err.mkErrHandler {get = getS, put = putS}
637 fun fail() = Err.failure eh
638 fun tryProds (strm, prods) = let
639 fun try [] = fail()
640- | try (prod :: prods) =
641- (Err.whileDisabled eh (fn() => prod strm))
642+ | try (prod :: prods) =
643+ (Err.whileDisabled eh (fn() => prod strm))
644 handle Err.ParseError => try (prods)
645 in try prods end
646-fun matchEOF strm = (case (lex(strm))
647- of (Tok.EOF, span, strm') => ((), span, strm')
648- | _ => fail()
649-(* end case *))
650-fun matchNUMBER strm = (case (lex(strm))
651- of (Tok.NUMBER(x), span, strm') => (x, span, strm')
652- | _ => fail()
653-(* end case *))
654-fun matchDOT strm = (case (lex(strm))
655- of (Tok.DOT, span, strm') => ((), span, strm')
656- | _ => fail()
657-(* end case *))
658-fun matchSTRINGLIT strm = (case (lex(strm))
659- of (Tok.STRINGLIT(x), span, strm') => (x, span, strm')
660- | _ => fail()
661-(* end case *))
662-fun matchEQUALS strm = (case (lex(strm))
663- of (Tok.EQUALS, span, strm') => ((), span, strm')
664- | _ => fail()
665-(* end case *))
666 fun matchNAME strm = (case (lex(strm))
667 of (Tok.NAME(x), span, strm') => (x, span, strm')
668 | _ => fail()
669 (* end case *))
670+fun matchEQUALS strm = (case (lex(strm))
671+ of (Tok.EQUALS, span, strm') => ((), span, strm')
672+ | _ => fail()
673+(* end case *))
674+fun matchSTRINGLIT strm = (case (lex(strm))
675+ of (Tok.STRINGLIT(x), span, strm') => (x, span, strm')
676+ | _ => fail()
677+(* end case *))
678+fun matchDOT strm = (case (lex(strm))
679+ of (Tok.DOT, span, strm') => ((), span, strm')
680+ | _ => fail()
681+(* end case *))
682+fun matchNUMBER strm = (case (lex(strm))
683+ of (Tok.NUMBER(x), span, strm') => (x, span, strm')
684+ | _ => fail()
685+(* end case *))
686+fun matchEOF strm = (case (lex(strm))
687+ of (Tok.EOF, span, strm') => ((), span, strm')
688+ | _ => fail()
689+(* end case *))
690
691 val (attrs_NT) =
692 let
693diff --git a/HTML4/html4-lib.cm b/HTML4/html4-lib.cm
694index 8248a55..dba213b 100644
695--- a/HTML4/html4-lib.cm
696+++ b/HTML4/html4-lib.cm
697@@ -23,6 +23,9 @@ is
698 $/smlnj-lib.cm
699 $/ml-lpt-lib.cm
700
701+ $/pp-lib.cm
702+ pp-init.sml
703+
704 html4.g : ml-antlr
705 html4.l : ml-ulex
706
707diff --git a/HTML4/html4-lib.mlb b/HTML4/html4-lib.mlb
708new file mode 100644
709index 0000000..46eaf3d
710--- /dev/null
711+++ b/HTML4/html4-lib.mlb
712@@ -0,0 +1,279 @@
713+
714+ann
715+ "nonexhaustiveBind ignore" "nonexhaustiveMatch ignore"
716+ "redundantBind warn" "redundantMatch warn"
717+ "sequenceNonUnit ignore"
718+ "warnUnused false" "forceUsed"
719+in
720+
721+local
722+ basis l4 =
723+ bas
724+ (* $/basis.cm ====> *) $(SML_LIB)/basis/basis.mlb
725+ end
726+ basis l8 =
727+ bas
728+ (* $/smlnj-lib.cm ====> *) $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
729+ end
730+ basis l55 =
731+ bas
732+ (* $/ml-lpt-lib.cm ====> *) $(SML_LIB)/mllpt-lib/mllpt-lib.mlb
733+ end
734+in
735+local
736+ $(SML_LIB)/basis/pervasive.mlb
737+ local
738+ open l4
739+ in
740+ structure gs_0 = String
741+ end
742+ local
743+ open l8
744+ in
745+ structure gs_1 = Atom
746+ end
747+ local
748+ structure Atom = gs_1
749+ structure String = gs_0
750+ html4-utils.sml
751+ in
752+ structure gs_2 = HTML4Utils
753+ end
754+ local
755+ open l8
756+ in
757+ structure gs_3 = Format
758+ end
759+ local
760+ open l4
761+ in
762+ structure gs_4 = IntInf
763+ end
764+ local
765+ open l4
766+ in
767+ structure gs_5 = List
768+ end
769+ local
770+ structure Atom = gs_1
771+ structure IntInf = gs_4
772+ html4.sig
773+ in
774+ signature gs_6 = HTML4
775+ end
776+ local
777+ structure Atom = gs_1
778+ signature HTML4 = gs_6
779+ structure IntInf = gs_4
780+ html4.sml
781+ in
782+ structure gs_7 = HTML4
783+ end
784+ local
785+ structure Atom = gs_1
786+ structure Format = gs_3
787+ structure HTML4 = gs_7
788+ structure IntInf = gs_4
789+ structure List = gs_5
790+ structure String = gs_0
791+ html4-print.sml
792+ in
793+ structure gs_8 = HTML4Print
794+ end
795+ local
796+ structure Atom = gs_1
797+ html4-attrs.sml
798+ in
799+ structure gs_9 = HTML4Attrs
800+ end
801+ local
802+ open l8
803+ in
804+ signature gs_10 = ORD_MAP
805+ end
806+ local
807+ open l8
808+ in
809+ functor gs_11 = RedBlackMapFn
810+ end
811+ local
812+ open l4
813+ in
814+ structure gs_12 = CharVectorSlice
815+ end
816+ local
817+ open l4
818+ in
819+ structure gs_13 = Substring
820+ end
821+ local
822+ open l4
823+ in
824+ structure gs_14 = Char
825+ end
826+ local
827+ open l55
828+ in
829+ structure gs_15 = AntlrStreamPos
830+ end
831+ local
832+ open l4
833+ in
834+ structure gs_16 = TextIO
835+ end
836+ local
837+ open l55
838+ in
839+ functor gs_17 = AntlrErrHandler
840+ end
841+ local
842+ open l55
843+ in
844+ signature gs_18 = ANTLR_LEXER
845+ end
846+ local
847+ signature ANTLR_LEXER = gs_18
848+ functor AntlrErrHandler = gs_17
849+ structure Atom = gs_1
850+ structure HTML4Utils = gs_2
851+ structure IntInf = gs_4
852+ structure List = gs_5
853+ html4.g.sml
854+ in
855+ functor gs_19 = HTML4ParseFn
856+ structure gs_20 = HTML4Tokens
857+ end
858+ local
859+ signature ANTLR_LEXER = gs_18
860+ functor AntlrErrHandler = gs_17
861+ structure Atom = gs_1
862+ structure List = gs_5
863+ structure String = gs_0
864+ html4-attr.g.sml
865+ in
866+ functor gs_21 = HTML4AttrParseFn
867+ structure gs_22 = HTML4AttrTokens
868+ end
869+ local
870+ open l4
871+ in
872+ structure gs_23 = Vector
873+ end
874+ local
875+ open l55
876+ in
877+ structure gs_24 = ULexBuffer
878+ end
879+ local
880+ open l55
881+ in
882+ structure gs_25 = UTF8
883+ end
884+ local
885+ structure AntlrStreamPos = gs_15
886+ structure Atom = gs_1
887+ functor HTML4AttrParseFn = gs_21
888+ structure HTML4AttrTokens = gs_22
889+ structure List = gs_5
890+ structure String = gs_0
891+ structure Substring = gs_13
892+ structure TextIO = gs_16
893+ structure ULexBuffer = gs_24
894+ structure UTF8 = gs_25
895+ structure Vector = gs_23
896+ html4-attr.l.sml
897+ in
898+ structure gs_26 = HTML4AttrLexer
899+ end
900+ local
901+ structure AntlrStreamPos = gs_15
902+ structure Atom = gs_1
903+ structure Char = gs_14
904+ structure CharVectorSlice = gs_12
905+ structure HTML4AttrLexer = gs_26
906+ functor HTML4AttrParseFn = gs_21
907+ structure HTML4AttrTokens = gs_22
908+ functor HTML4ParseFn = gs_19
909+ structure HTML4Tokens = gs_20
910+ structure HTML4Utils = gs_2
911+ structure IntInf = gs_4
912+ signature ORD_MAP = gs_10
913+ functor RedBlackMapFn = gs_11
914+ structure String = gs_0
915+ structure Substring = gs_13
916+ structure TextIO = gs_16
917+ html4-token-utils.sml
918+ in
919+ structure gs_27 = HTML4TokenUtils
920+ end
921+ local
922+ structure Atom = gs_1
923+ structure HTML4 = gs_7
924+ html4-entities.sml
925+ in
926+ structure gs_28 = HTML4Entities
927+ end
928+ local
929+ open l4
930+ in
931+ structure gs_29 = CharVector
932+ end
933+ local
934+ open l4
935+ in
936+ structure gs_30 = Option
937+ end
938+ local
939+ open l4
940+ in
941+ structure gs_31 = StringCvt
942+ end
943+ local
944+ structure AntlrStreamPos = gs_15
945+ structure Atom = gs_1
946+ structure HTML4TokenUtils = gs_27
947+ structure IntInf = gs_4
948+ structure List = gs_5
949+ structure String = gs_0
950+ structure StringCvt = gs_31
951+ structure Substring = gs_13
952+ structure TextIO = gs_16
953+ structure ULexBuffer = gs_24
954+ structure UTF8 = gs_25
955+ structure Vector = gs_23
956+ html4.l.sml
957+ in
958+ structure gs_32 = HTML4Lexer
959+ end
960+ local
961+ structure AntlrStreamPos = gs_15
962+ structure Atom = gs_1
963+ structure Char = gs_14
964+ structure CharVector = gs_29
965+ structure HTML4 = gs_7
966+ structure HTML4Lexer = gs_32
967+ functor HTML4ParseFn = gs_19
968+ structure HTML4TokenUtils = gs_27
969+ structure HTML4Tokens = gs_20
970+ structure HTML4Utils = gs_2
971+ structure Option = gs_30
972+ structure String = gs_0
973+ structure TextIO = gs_16
974+ html4-parser.sml
975+ in
976+ structure gs_33 = HTML4Parser
977+ end
978+in
979+ signature HTML4 = gs_6
980+ structure HTML4 = gs_7
981+ structure HTML4Attrs = gs_9
982+ structure HTML4Entities = gs_28
983+ structure HTML4Parser = gs_33
984+ structure HTML4Print = gs_8
985+ structure HTML4TokenUtils = gs_27
986+ structure HTML4Tokens = gs_20
987+ structure HTML4Utils = gs_2
988+end
989+end
990+
991+end
992diff --git a/HTML4/html4.g.sml b/HTML4/html4.g.sml
993index 52d716b..75e445f 100644
994--- a/HTML4/html4.g.sml
995+++ b/HTML4/html4.g.sml
996@@ -1,559 +1,557 @@
997-structure
998-HTML4Tokens = struct
999-
1000- datatype token = EOF
1001- | ENDVAR
1002- | STARTVAR of HTML4Utils.tag_payload
1003- | ENDUL
1004- | STARTUL of HTML4Utils.tag_payload
1005- | ENDU
1006- | STARTU of HTML4Utils.tag_payload
1007- | ENDTT
1008- | STARTTT of HTML4Utils.tag_payload
1009- | ENDTR
1010- | STARTTR of HTML4Utils.tag_payload
1011- | ENDTITLE
1012- | STARTTITLE of HTML4Utils.tag_payload
1013- | ENDTHEAD
1014- | STARTTHEAD of HTML4Utils.tag_payload
1015- | ENDTH
1016- | STARTTH of HTML4Utils.tag_payload
1017- | ENDTFOOT
1018- | STARTTFOOT of HTML4Utils.tag_payload
1019- | ENDTEXTAREA
1020- | STARTTEXTAREA of HTML4Utils.tag_payload
1021- | ENDTD
1022- | STARTTD of HTML4Utils.tag_payload
1023- | ENDTBODY
1024- | STARTTBODY of HTML4Utils.tag_payload
1025- | ENDTABLE
1026- | STARTTABLE of HTML4Utils.tag_payload
1027- | ENDSUP
1028- | STARTSUP of HTML4Utils.tag_payload
1029- | ENDSUB
1030- | STARTSUB of HTML4Utils.tag_payload
1031- | ENDSTYLE
1032- | STARTSTYLE of HTML4Utils.tag_payload
1033- | ENDSTRONG
1034- | STARTSTRONG of HTML4Utils.tag_payload
1035- | ENDSTRIKE
1036- | STARTSTRIKE of HTML4Utils.tag_payload
1037- | ENDSPAN
1038- | STARTSPAN of HTML4Utils.tag_payload
1039- | ENDSMALL
1040- | STARTSMALL of HTML4Utils.tag_payload
1041- | ENDSELECT
1042- | STARTSELECT of HTML4Utils.tag_payload
1043- | ENDSCRIPT
1044- | STARTSCRIPT of HTML4Utils.tag_payload
1045- | ENDSAMP
1046- | STARTSAMP of HTML4Utils.tag_payload
1047- | ENDS
1048- | STARTS of HTML4Utils.tag_payload
1049- | ENDQ
1050- | STARTQ of HTML4Utils.tag_payload
1051- | ENDPRE
1052- | STARTPRE of HTML4Utils.tag_payload
1053- | STARTPARAM of HTML4Utils.tag_payload
1054- | ENDP
1055- | STARTP of HTML4Utils.tag_payload
1056- | ENDOPTION
1057- | STARTOPTION of HTML4Utils.tag_payload
1058- | ENDOPTGROUP
1059- | STARTOPTGROUP of HTML4Utils.tag_payload
1060- | ENDOL
1061- | STARTOL of HTML4Utils.tag_payload
1062- | ENDOBJECT
1063- | STARTOBJECT of HTML4Utils.tag_payload
1064- | ENDNOSCRIPT
1065- | STARTNOSCRIPT of HTML4Utils.tag_payload
1066- | ENDNOFRAMES
1067- | STARTNOFRAMES of HTML4Utils.tag_payload
1068- | STARTMETA of HTML4Utils.tag_payload
1069- | ENDMENU
1070- | STARTMENU of HTML4Utils.tag_payload
1071- | ENDMAP
1072- | STARTMAP of HTML4Utils.tag_payload
1073- | STARTLINK of HTML4Utils.tag_payload
1074- | ENDLI
1075- | STARTLI of HTML4Utils.tag_payload
1076- | ENDLEGEND
1077- | STARTLEGEND of HTML4Utils.tag_payload
1078- | ENDLABEL
1079- | STARTLABEL of HTML4Utils.tag_payload
1080- | ENDKBD
1081- | STARTKBD of HTML4Utils.tag_payload
1082- | STARTISINDEX of HTML4Utils.tag_payload
1083- | ENDINS
1084- | STARTINS of HTML4Utils.tag_payload
1085- | STARTINPUT of HTML4Utils.tag_payload
1086- | STARTIMG of HTML4Utils.tag_payload
1087- | ENDIFRAME
1088- | STARTIFRAME of HTML4Utils.tag_payload
1089- | ENDI
1090- | STARTI of HTML4Utils.tag_payload
1091- | ENDHTML
1092- | STARTHTML of HTML4Utils.tag_payload
1093- | STARTHR of HTML4Utils.tag_payload
1094- | ENDHEAD
1095- | STARTHEAD of HTML4Utils.tag_payload
1096- | ENDH6
1097- | STARTH6 of HTML4Utils.tag_payload
1098- | ENDH5
1099- | STARTH5 of HTML4Utils.tag_payload
1100- | ENDH4
1101- | STARTH4 of HTML4Utils.tag_payload
1102- | ENDH3
1103- | STARTH3 of HTML4Utils.tag_payload
1104- | ENDH2
1105- | STARTH2 of HTML4Utils.tag_payload
1106- | ENDH1
1107- | STARTH1 of HTML4Utils.tag_payload
1108- | ENDFRAMESET
1109- | STARTFRAMESET of HTML4Utils.tag_payload
1110- | STARTFRAME of HTML4Utils.tag_payload
1111- | ENDFORM
1112- | STARTFORM of HTML4Utils.tag_payload
1113- | ENDFONT
1114- | STARTFONT of HTML4Utils.tag_payload
1115- | ENDFIELDSET
1116- | STARTFIELDSET of HTML4Utils.tag_payload
1117- | ENDEM
1118- | STARTEM of HTML4Utils.tag_payload
1119- | ENDDT
1120- | STARTDT of HTML4Utils.tag_payload
1121- | ENDDL
1122- | STARTDL of HTML4Utils.tag_payload
1123- | ENDDIV
1124- | STARTDIV of HTML4Utils.tag_payload
1125- | ENDDIR
1126- | STARTDIR of HTML4Utils.tag_payload
1127- | ENDDFN
1128- | STARTDFN of HTML4Utils.tag_payload
1129- | ENDDEL
1130- | STARTDEL of HTML4Utils.tag_payload
1131- | ENDDD
1132- | STARTDD of HTML4Utils.tag_payload
1133- | ENDCOLGROUP
1134- | STARTCOLGROUP of HTML4Utils.tag_payload
1135- | STARTCOL of HTML4Utils.tag_payload
1136- | ENDCODE
1137- | STARTCODE of HTML4Utils.tag_payload
1138- | ENDCITE
1139- | STARTCITE of HTML4Utils.tag_payload
1140- | ENDCENTER
1141- | STARTCENTER of HTML4Utils.tag_payload
1142- | ENDCAPTION
1143- | STARTCAPTION of HTML4Utils.tag_payload
1144- | ENDBUTTON
1145- | STARTBUTTON of HTML4Utils.tag_payload
1146- | STARTBR of HTML4Utils.tag_payload
1147- | ENDBODY
1148- | STARTBODY of HTML4Utils.tag_payload
1149- | ENDBLOCKQUOTE
1150- | STARTBLOCKQUOTE of HTML4Utils.tag_payload
1151- | ENDBIG
1152- | STARTBIG of HTML4Utils.tag_payload
1153- | ENDBDO
1154- | STARTBDO of HTML4Utils.tag_payload
1155- | STARTBASEFONT of HTML4Utils.tag_payload
1156- | STARTBASE of HTML4Utils.tag_payload
1157- | ENDB
1158- | STARTB of HTML4Utils.tag_payload
1159- | STARTAREA of HTML4Utils.tag_payload
1160- | ENDAPPLET
1161- | STARTAPPLET of HTML4Utils.tag_payload
1162- | ENDADDRESS
1163- | STARTADDRESS of HTML4Utils.tag_payload
1164- | ENDACRONYM
1165- | STARTACRONYM of HTML4Utils.tag_payload
1166- | ENDABBR
1167- | STARTABBR of HTML4Utils.tag_payload
1168- | ENDA
1169- | STARTA of HTML4Utils.tag_payload
1170- | XML_PROCESSING of string
1171- | ENTITY_REF of Atom.atom
1172- | CHAR_REF of IntInf.int
1173- | DOCTYPE of string
1174- | PCDATA of string
1175- | COMMENT of string
1176+structure HTML4Tokens =
1177+ struct
1178+ datatype token
1179+ = OPENTAG of Atom.atom * HTML4Utils.tag_payload
1180 | CLOSETAG of Atom.atom
1181- | OPENTAG of Atom.atom * HTML4Utils.tag_payload
1182-
1183- val allToks = [EOF, ENDVAR, ENDUL, ENDU, ENDTT, ENDTR, ENDTITLE, ENDTHEAD, ENDTH, ENDTFOOT, ENDTEXTAREA, ENDTD, ENDTBODY, ENDTABLE, ENDSUP, ENDSUB, ENDSTYLE, ENDSTRONG, ENDSTRIKE, ENDSPAN, ENDSMALL, ENDSELECT, ENDSCRIPT, ENDSAMP, ENDS, ENDQ, ENDPRE, ENDP, ENDOPTION, ENDOPTGROUP, ENDOL, ENDOBJECT, ENDNOSCRIPT, ENDNOFRAMES, ENDMENU, ENDMAP, ENDLI, ENDLEGEND, ENDLABEL, ENDKBD, ENDINS, ENDIFRAME, ENDI, ENDHTML, ENDHEAD, ENDH6, ENDH5, ENDH4, ENDH3, ENDH2, ENDH1, ENDFRAMESET, ENDFORM, ENDFONT, ENDFIELDSET, ENDEM, ENDDT, ENDDL, ENDDIV, ENDDIR, ENDDFN, ENDDEL, ENDDD, ENDCOLGROUP, ENDCODE, ENDCITE, ENDCENTER, ENDCAPTION, ENDBUTTON, ENDBODY, ENDBLOCKQUOTE, ENDBIG, ENDBDO, ENDB, ENDAPPLET, ENDADDRESS, ENDACRONYM, ENDABBR, ENDA]
1184-
1185+ | COMMENT of string
1186+ | PCDATA of string
1187+ | DOCTYPE of string
1188+ | CHAR_REF of IntInf.int
1189+ | ENTITY_REF of Atom.atom
1190+ | XML_PROCESSING of string
1191+ | STARTA of HTML4Utils.tag_payload
1192+ | ENDA
1193+ | STARTABBR of HTML4Utils.tag_payload
1194+ | ENDABBR
1195+ | STARTACRONYM of HTML4Utils.tag_payload
1196+ | ENDACRONYM
1197+ | STARTADDRESS of HTML4Utils.tag_payload
1198+ | ENDADDRESS
1199+ | STARTAPPLET of HTML4Utils.tag_payload
1200+ | ENDAPPLET
1201+ | STARTAREA of HTML4Utils.tag_payload
1202+ | STARTB of HTML4Utils.tag_payload
1203+ | ENDB
1204+ | STARTBASE of HTML4Utils.tag_payload
1205+ | STARTBASEFONT of HTML4Utils.tag_payload
1206+ | STARTBDO of HTML4Utils.tag_payload
1207+ | ENDBDO
1208+ | STARTBIG of HTML4Utils.tag_payload
1209+ | ENDBIG
1210+ | STARTBLOCKQUOTE of HTML4Utils.tag_payload
1211+ | ENDBLOCKQUOTE
1212+ | STARTBODY of HTML4Utils.tag_payload
1213+ | ENDBODY
1214+ | STARTBR of HTML4Utils.tag_payload
1215+ | STARTBUTTON of HTML4Utils.tag_payload
1216+ | ENDBUTTON
1217+ | STARTCAPTION of HTML4Utils.tag_payload
1218+ | ENDCAPTION
1219+ | STARTCENTER of HTML4Utils.tag_payload
1220+ | ENDCENTER
1221+ | STARTCITE of HTML4Utils.tag_payload
1222+ | ENDCITE
1223+ | STARTCODE of HTML4Utils.tag_payload
1224+ | ENDCODE
1225+ | STARTCOL of HTML4Utils.tag_payload
1226+ | STARTCOLGROUP of HTML4Utils.tag_payload
1227+ | ENDCOLGROUP
1228+ | STARTDD of HTML4Utils.tag_payload
1229+ | ENDDD
1230+ | STARTDEL of HTML4Utils.tag_payload
1231+ | ENDDEL
1232+ | STARTDFN of HTML4Utils.tag_payload
1233+ | ENDDFN
1234+ | STARTDIR of HTML4Utils.tag_payload
1235+ | ENDDIR
1236+ | STARTDIV of HTML4Utils.tag_payload
1237+ | ENDDIV
1238+ | STARTDL of HTML4Utils.tag_payload
1239+ | ENDDL
1240+ | STARTDT of HTML4Utils.tag_payload
1241+ | ENDDT
1242+ | STARTEM of HTML4Utils.tag_payload
1243+ | ENDEM
1244+ | STARTFIELDSET of HTML4Utils.tag_payload
1245+ | ENDFIELDSET
1246+ | STARTFONT of HTML4Utils.tag_payload
1247+ | ENDFONT
1248+ | STARTFORM of HTML4Utils.tag_payload
1249+ | ENDFORM
1250+ | STARTFRAME of HTML4Utils.tag_payload
1251+ | STARTFRAMESET of HTML4Utils.tag_payload
1252+ | ENDFRAMESET
1253+ | STARTH1 of HTML4Utils.tag_payload
1254+ | ENDH1
1255+ | STARTH2 of HTML4Utils.tag_payload
1256+ | ENDH2
1257+ | STARTH3 of HTML4Utils.tag_payload
1258+ | ENDH3
1259+ | STARTH4 of HTML4Utils.tag_payload
1260+ | ENDH4
1261+ | STARTH5 of HTML4Utils.tag_payload
1262+ | ENDH5
1263+ | STARTH6 of HTML4Utils.tag_payload
1264+ | ENDH6
1265+ | STARTHEAD of HTML4Utils.tag_payload
1266+ | ENDHEAD
1267+ | STARTHR of HTML4Utils.tag_payload
1268+ | STARTHTML of HTML4Utils.tag_payload
1269+ | ENDHTML
1270+ | STARTI of HTML4Utils.tag_payload
1271+ | ENDI
1272+ | STARTIFRAME of HTML4Utils.tag_payload
1273+ | ENDIFRAME
1274+ | STARTIMG of HTML4Utils.tag_payload
1275+ | STARTINPUT of HTML4Utils.tag_payload
1276+ | STARTINS of HTML4Utils.tag_payload
1277+ | ENDINS
1278+ | STARTISINDEX of HTML4Utils.tag_payload
1279+ | STARTKBD of HTML4Utils.tag_payload
1280+ | ENDKBD
1281+ | STARTLABEL of HTML4Utils.tag_payload
1282+ | ENDLABEL
1283+ | STARTLEGEND of HTML4Utils.tag_payload
1284+ | ENDLEGEND
1285+ | STARTLI of HTML4Utils.tag_payload
1286+ | ENDLI
1287+ | STARTLINK of HTML4Utils.tag_payload
1288+ | STARTMAP of HTML4Utils.tag_payload
1289+ | ENDMAP
1290+ | STARTMENU of HTML4Utils.tag_payload
1291+ | ENDMENU
1292+ | STARTMETA of HTML4Utils.tag_payload
1293+ | STARTNOFRAMES of HTML4Utils.tag_payload
1294+ | ENDNOFRAMES
1295+ | STARTNOSCRIPT of HTML4Utils.tag_payload
1296+ | ENDNOSCRIPT
1297+ | STARTOBJECT of HTML4Utils.tag_payload
1298+ | ENDOBJECT
1299+ | STARTOL of HTML4Utils.tag_payload
1300+ | ENDOL
1301+ | STARTOPTGROUP of HTML4Utils.tag_payload
1302+ | ENDOPTGROUP
1303+ | STARTOPTION of HTML4Utils.tag_payload
1304+ | ENDOPTION
1305+ | STARTP of HTML4Utils.tag_payload
1306+ | ENDP
1307+ | STARTPARAM of HTML4Utils.tag_payload
1308+ | STARTPRE of HTML4Utils.tag_payload
1309+ | ENDPRE
1310+ | STARTQ of HTML4Utils.tag_payload
1311+ | ENDQ
1312+ | STARTS of HTML4Utils.tag_payload
1313+ | ENDS
1314+ | STARTSAMP of HTML4Utils.tag_payload
1315+ | ENDSAMP
1316+ | STARTSCRIPT of HTML4Utils.tag_payload
1317+ | ENDSCRIPT
1318+ | STARTSELECT of HTML4Utils.tag_payload
1319+ | ENDSELECT
1320+ | STARTSMALL of HTML4Utils.tag_payload
1321+ | ENDSMALL
1322+ | STARTSPAN of HTML4Utils.tag_payload
1323+ | ENDSPAN
1324+ | STARTSTRIKE of HTML4Utils.tag_payload
1325+ | ENDSTRIKE
1326+ | STARTSTRONG of HTML4Utils.tag_payload
1327+ | ENDSTRONG
1328+ | STARTSTYLE of HTML4Utils.tag_payload
1329+ | ENDSTYLE
1330+ | STARTSUB of HTML4Utils.tag_payload
1331+ | ENDSUB
1332+ | STARTSUP of HTML4Utils.tag_payload
1333+ | ENDSUP
1334+ | STARTTABLE of HTML4Utils.tag_payload
1335+ | ENDTABLE
1336+ | STARTTBODY of HTML4Utils.tag_payload
1337+ | ENDTBODY
1338+ | STARTTD of HTML4Utils.tag_payload
1339+ | ENDTD
1340+ | STARTTEXTAREA of HTML4Utils.tag_payload
1341+ | ENDTEXTAREA
1342+ | STARTTFOOT of HTML4Utils.tag_payload
1343+ | ENDTFOOT
1344+ | STARTTH of HTML4Utils.tag_payload
1345+ | ENDTH
1346+ | STARTTHEAD of HTML4Utils.tag_payload
1347+ | ENDTHEAD
1348+ | STARTTITLE of HTML4Utils.tag_payload
1349+ | ENDTITLE
1350+ | STARTTR of HTML4Utils.tag_payload
1351+ | ENDTR
1352+ | STARTTT of HTML4Utils.tag_payload
1353+ | ENDTT
1354+ | STARTU of HTML4Utils.tag_payload
1355+ | ENDU
1356+ | STARTUL of HTML4Utils.tag_payload
1357+ | ENDUL
1358+ | STARTVAR of HTML4Utils.tag_payload
1359+ | ENDVAR
1360+ | EOF
1361+ val allToks = [
1362+ ENDA, ENDABBR, ENDACRONYM, ENDADDRESS, ENDAPPLET, ENDB, ENDBDO, ENDBIG, ENDBLOCKQUOTE, ENDBODY, ENDBUTTON, ENDCAPTION, ENDCENTER, ENDCITE, ENDCODE, ENDCOLGROUP, ENDDD, ENDDEL, ENDDFN, ENDDIR, ENDDIV, ENDDL, ENDDT, ENDEM, ENDFIELDSET, ENDFONT, ENDFORM, ENDFRAMESET, ENDH1, ENDH2, ENDH3, ENDH4, ENDH5, ENDH6, ENDHEAD, ENDHTML, ENDI, ENDIFRAME, ENDINS, ENDKBD, ENDLABEL, ENDLEGEND, ENDLI, ENDMAP, ENDMENU, ENDNOFRAMES, ENDNOSCRIPT, ENDOBJECT, ENDOL, ENDOPTGROUP, ENDOPTION, ENDP, ENDPRE, ENDQ, ENDS, ENDSAMP, ENDSCRIPT, ENDSELECT, ENDSMALL, ENDSPAN, ENDSTRIKE, ENDSTRONG, ENDSTYLE, ENDSUB, ENDSUP, ENDTABLE, ENDTBODY, ENDTD, ENDTEXTAREA, ENDTFOOT, ENDTH, ENDTHEAD, ENDTITLE, ENDTR, ENDTT, ENDU, ENDUL, ENDVAR, EOF
1363+ ]
1364 fun toString tok =
1365 (case (tok)
1366- of (EOF) => "EOF"
1367- | (ENDVAR) => "ENDVAR"
1368- | (STARTVAR(_)) => "STARTVAR"
1369- | (ENDUL) => "ENDUL"
1370- | (STARTUL(_)) => "STARTUL"
1371- | (ENDU) => "ENDU"
1372- | (STARTU(_)) => "STARTU"
1373- | (ENDTT) => "ENDTT"
1374- | (STARTTT(_)) => "STARTTT"
1375- | (ENDTR) => "ENDTR"
1376- | (STARTTR(_)) => "STARTTR"
1377- | (ENDTITLE) => "ENDTITLE"
1378- | (STARTTITLE(_)) => "STARTTITLE"
1379- | (ENDTHEAD) => "ENDTHEAD"
1380- | (STARTTHEAD(_)) => "STARTTHEAD"
1381- | (ENDTH) => "ENDTH"
1382- | (STARTTH(_)) => "STARTTH"
1383- | (ENDTFOOT) => "ENDTFOOT"
1384- | (STARTTFOOT(_)) => "STARTTFOOT"
1385- | (ENDTEXTAREA) => "ENDTEXTAREA"
1386- | (STARTTEXTAREA(_)) => "STARTTEXTAREA"
1387- | (ENDTD) => "ENDTD"
1388- | (STARTTD(_)) => "STARTTD"
1389- | (ENDTBODY) => "ENDTBODY"
1390- | (STARTTBODY(_)) => "STARTTBODY"
1391- | (ENDTABLE) => "ENDTABLE"
1392- | (STARTTABLE(_)) => "STARTTABLE"
1393- | (ENDSUP) => "ENDSUP"
1394- | (STARTSUP(_)) => "STARTSUP"
1395- | (ENDSUB) => "ENDSUB"
1396- | (STARTSUB(_)) => "STARTSUB"
1397- | (ENDSTYLE) => "ENDSTYLE"
1398- | (STARTSTYLE(_)) => "STARTSTYLE"
1399- | (ENDSTRONG) => "ENDSTRONG"
1400- | (STARTSTRONG(_)) => "STARTSTRONG"
1401- | (ENDSTRIKE) => "ENDSTRIKE"
1402- | (STARTSTRIKE(_)) => "STARTSTRIKE"
1403- | (ENDSPAN) => "ENDSPAN"
1404- | (STARTSPAN(_)) => "STARTSPAN"
1405- | (ENDSMALL) => "ENDSMALL"
1406- | (STARTSMALL(_)) => "STARTSMALL"
1407- | (ENDSELECT) => "ENDSELECT"
1408- | (STARTSELECT(_)) => "STARTSELECT"
1409- | (ENDSCRIPT) => "ENDSCRIPT"
1410- | (STARTSCRIPT(_)) => "STARTSCRIPT"
1411- | (ENDSAMP) => "ENDSAMP"
1412- | (STARTSAMP(_)) => "STARTSAMP"
1413- | (ENDS) => "ENDS"
1414- | (STARTS(_)) => "STARTS"
1415- | (ENDQ) => "ENDQ"
1416- | (STARTQ(_)) => "STARTQ"
1417- | (ENDPRE) => "ENDPRE"
1418- | (STARTPRE(_)) => "STARTPRE"
1419- | (STARTPARAM(_)) => "STARTPARAM"
1420- | (ENDP) => "ENDP"
1421- | (STARTP(_)) => "STARTP"
1422- | (ENDOPTION) => "ENDOPTION"
1423- | (STARTOPTION(_)) => "STARTOPTION"
1424- | (ENDOPTGROUP) => "ENDOPTGROUP"
1425- | (STARTOPTGROUP(_)) => "STARTOPTGROUP"
1426- | (ENDOL) => "ENDOL"
1427- | (STARTOL(_)) => "STARTOL"
1428- | (ENDOBJECT) => "ENDOBJECT"
1429- | (STARTOBJECT(_)) => "STARTOBJECT"
1430- | (ENDNOSCRIPT) => "ENDNOSCRIPT"
1431- | (STARTNOSCRIPT(_)) => "STARTNOSCRIPT"
1432- | (ENDNOFRAMES) => "ENDNOFRAMES"
1433- | (STARTNOFRAMES(_)) => "STARTNOFRAMES"
1434- | (STARTMETA(_)) => "STARTMETA"
1435- | (ENDMENU) => "ENDMENU"
1436- | (STARTMENU(_)) => "STARTMENU"
1437- | (ENDMAP) => "ENDMAP"
1438- | (STARTMAP(_)) => "STARTMAP"
1439- | (STARTLINK(_)) => "STARTLINK"
1440- | (ENDLI) => "ENDLI"
1441- | (STARTLI(_)) => "STARTLI"
1442- | (ENDLEGEND) => "ENDLEGEND"
1443- | (STARTLEGEND(_)) => "STARTLEGEND"
1444- | (ENDLABEL) => "ENDLABEL"
1445- | (STARTLABEL(_)) => "STARTLABEL"
1446- | (ENDKBD) => "ENDKBD"
1447- | (STARTKBD(_)) => "STARTKBD"
1448- | (STARTISINDEX(_)) => "STARTISINDEX"
1449- | (ENDINS) => "ENDINS"
1450- | (STARTINS(_)) => "STARTINS"
1451- | (STARTINPUT(_)) => "STARTINPUT"
1452- | (STARTIMG(_)) => "STARTIMG"
1453- | (ENDIFRAME) => "ENDIFRAME"
1454- | (STARTIFRAME(_)) => "STARTIFRAME"
1455- | (ENDI) => "ENDI"
1456- | (STARTI(_)) => "STARTI"
1457- | (ENDHTML) => "ENDHTML"
1458- | (STARTHTML(_)) => "STARTHTML"
1459- | (STARTHR(_)) => "STARTHR"
1460- | (ENDHEAD) => "ENDHEAD"
1461- | (STARTHEAD(_)) => "STARTHEAD"
1462- | (ENDH6) => "ENDH6"
1463- | (STARTH6(_)) => "STARTH6"
1464- | (ENDH5) => "ENDH5"
1465- | (STARTH5(_)) => "STARTH5"
1466- | (ENDH4) => "ENDH4"
1467- | (STARTH4(_)) => "STARTH4"
1468- | (ENDH3) => "ENDH3"
1469- | (STARTH3(_)) => "STARTH3"
1470- | (ENDH2) => "ENDH2"
1471- | (STARTH2(_)) => "STARTH2"
1472- | (ENDH1) => "ENDH1"
1473- | (STARTH1(_)) => "STARTH1"
1474- | (ENDFRAMESET) => "ENDFRAMESET"
1475- | (STARTFRAMESET(_)) => "STARTFRAMESET"
1476- | (STARTFRAME(_)) => "STARTFRAME"
1477- | (ENDFORM) => "ENDFORM"
1478- | (STARTFORM(_)) => "STARTFORM"
1479- | (ENDFONT) => "ENDFONT"
1480- | (STARTFONT(_)) => "STARTFONT"
1481- | (ENDFIELDSET) => "ENDFIELDSET"
1482- | (STARTFIELDSET(_)) => "STARTFIELDSET"
1483- | (ENDEM) => "ENDEM"
1484- | (STARTEM(_)) => "STARTEM"
1485- | (ENDDT) => "ENDDT"
1486- | (STARTDT(_)) => "STARTDT"
1487- | (ENDDL) => "ENDDL"
1488- | (STARTDL(_)) => "STARTDL"
1489- | (ENDDIV) => "ENDDIV"
1490- | (STARTDIV(_)) => "STARTDIV"
1491- | (ENDDIR) => "ENDDIR"
1492- | (STARTDIR(_)) => "STARTDIR"
1493- | (ENDDFN) => "ENDDFN"
1494- | (STARTDFN(_)) => "STARTDFN"
1495- | (ENDDEL) => "ENDDEL"
1496- | (STARTDEL(_)) => "STARTDEL"
1497- | (ENDDD) => "ENDDD"
1498- | (STARTDD(_)) => "STARTDD"
1499- | (ENDCOLGROUP) => "ENDCOLGROUP"
1500- | (STARTCOLGROUP(_)) => "STARTCOLGROUP"
1501- | (STARTCOL(_)) => "STARTCOL"
1502- | (ENDCODE) => "ENDCODE"
1503- | (STARTCODE(_)) => "STARTCODE"
1504- | (ENDCITE) => "ENDCITE"
1505- | (STARTCITE(_)) => "STARTCITE"
1506- | (ENDCENTER) => "ENDCENTER"
1507- | (STARTCENTER(_)) => "STARTCENTER"
1508- | (ENDCAPTION) => "ENDCAPTION"
1509- | (STARTCAPTION(_)) => "STARTCAPTION"
1510- | (ENDBUTTON) => "ENDBUTTON"
1511- | (STARTBUTTON(_)) => "STARTBUTTON"
1512- | (STARTBR(_)) => "STARTBR"
1513- | (ENDBODY) => "ENDBODY"
1514- | (STARTBODY(_)) => "STARTBODY"
1515- | (ENDBLOCKQUOTE) => "ENDBLOCKQUOTE"
1516- | (STARTBLOCKQUOTE(_)) => "STARTBLOCKQUOTE"
1517- | (ENDBIG) => "ENDBIG"
1518- | (STARTBIG(_)) => "STARTBIG"
1519- | (ENDBDO) => "ENDBDO"
1520- | (STARTBDO(_)) => "STARTBDO"
1521- | (STARTBASEFONT(_)) => "STARTBASEFONT"
1522- | (STARTBASE(_)) => "STARTBASE"
1523- | (ENDB) => "ENDB"
1524- | (STARTB(_)) => "STARTB"
1525- | (STARTAREA(_)) => "STARTAREA"
1526- | (ENDAPPLET) => "ENDAPPLET"
1527- | (STARTAPPLET(_)) => "STARTAPPLET"
1528- | (ENDADDRESS) => "ENDADDRESS"
1529- | (STARTADDRESS(_)) => "STARTADDRESS"
1530- | (ENDACRONYM) => "ENDACRONYM"
1531- | (STARTACRONYM(_)) => "STARTACRONYM"
1532- | (ENDABBR) => "ENDABBR"
1533- | (STARTABBR(_)) => "STARTABBR"
1534- | (ENDA) => "ENDA"
1535- | (STARTA(_)) => "STARTA"
1536- | (XML_PROCESSING(_)) => "XML_PROCESSING"
1537- | (ENTITY_REF(_)) => "ENTITY_REF"
1538- | (CHAR_REF(_)) => "CHAR_REF"
1539- | (DOCTYPE(_)) => "DOCTYPE"
1540- | (PCDATA(_)) => "PCDATA"
1541- | (COMMENT(_)) => "COMMENT"
1542+ of (OPENTAG(_)) => "OPENTAG"
1543 | (CLOSETAG(_)) => "CLOSETAG"
1544- | (OPENTAG(_)) => "OPENTAG"
1545+ | (COMMENT(_)) => "COMMENT"
1546+ | (PCDATA(_)) => "PCDATA"
1547+ | (DOCTYPE(_)) => "DOCTYPE"
1548+ | (CHAR_REF(_)) => "CHAR_REF"
1549+ | (ENTITY_REF(_)) => "ENTITY_REF"
1550+ | (XML_PROCESSING(_)) => "XML_PROCESSING"
1551+ | (STARTA(_)) => "STARTA"
1552+ | (ENDA) => "ENDA"
1553+ | (STARTABBR(_)) => "STARTABBR"
1554+ | (ENDABBR) => "ENDABBR"
1555+ | (STARTACRONYM(_)) => "STARTACRONYM"
1556+ | (ENDACRONYM) => "ENDACRONYM"
1557+ | (STARTADDRESS(_)) => "STARTADDRESS"
1558+ | (ENDADDRESS) => "ENDADDRESS"
1559+ | (STARTAPPLET(_)) => "STARTAPPLET"
1560+ | (ENDAPPLET) => "ENDAPPLET"
1561+ | (STARTAREA(_)) => "STARTAREA"
1562+ | (STARTB(_)) => "STARTB"
1563+ | (ENDB) => "ENDB"
1564+ | (STARTBASE(_)) => "STARTBASE"
1565+ | (STARTBASEFONT(_)) => "STARTBASEFONT"
1566+ | (STARTBDO(_)) => "STARTBDO"
1567+ | (ENDBDO) => "ENDBDO"
1568+ | (STARTBIG(_)) => "STARTBIG"
1569+ | (ENDBIG) => "ENDBIG"
1570+ | (STARTBLOCKQUOTE(_)) => "STARTBLOCKQUOTE"
1571+ | (ENDBLOCKQUOTE) => "ENDBLOCKQUOTE"
1572+ | (STARTBODY(_)) => "STARTBODY"
1573+ | (ENDBODY) => "ENDBODY"
1574+ | (STARTBR(_)) => "STARTBR"
1575+ | (STARTBUTTON(_)) => "STARTBUTTON"
1576+ | (ENDBUTTON) => "ENDBUTTON"
1577+ | (STARTCAPTION(_)) => "STARTCAPTION"
1578+ | (ENDCAPTION) => "ENDCAPTION"
1579+ | (STARTCENTER(_)) => "STARTCENTER"
1580+ | (ENDCENTER) => "ENDCENTER"
1581+ | (STARTCITE(_)) => "STARTCITE"
1582+ | (ENDCITE) => "ENDCITE"
1583+ | (STARTCODE(_)) => "STARTCODE"
1584+ | (ENDCODE) => "ENDCODE"
1585+ | (STARTCOL(_)) => "STARTCOL"
1586+ | (STARTCOLGROUP(_)) => "STARTCOLGROUP"
1587+ | (ENDCOLGROUP) => "ENDCOLGROUP"
1588+ | (STARTDD(_)) => "STARTDD"
1589+ | (ENDDD) => "ENDDD"
1590+ | (STARTDEL(_)) => "STARTDEL"
1591+ | (ENDDEL) => "ENDDEL"
1592+ | (STARTDFN(_)) => "STARTDFN"
1593+ | (ENDDFN) => "ENDDFN"
1594+ | (STARTDIR(_)) => "STARTDIR"
1595+ | (ENDDIR) => "ENDDIR"
1596+ | (STARTDIV(_)) => "STARTDIV"
1597+ | (ENDDIV) => "ENDDIV"
1598+ | (STARTDL(_)) => "STARTDL"
1599+ | (ENDDL) => "ENDDL"
1600+ | (STARTDT(_)) => "STARTDT"
1601+ | (ENDDT) => "ENDDT"
1602+ | (STARTEM(_)) => "STARTEM"
1603+ | (ENDEM) => "ENDEM"
1604+ | (STARTFIELDSET(_)) => "STARTFIELDSET"
1605+ | (ENDFIELDSET) => "ENDFIELDSET"
1606+ | (STARTFONT(_)) => "STARTFONT"
1607+ | (ENDFONT) => "ENDFONT"
1608+ | (STARTFORM(_)) => "STARTFORM"
1609+ | (ENDFORM) => "ENDFORM"
1610+ | (STARTFRAME(_)) => "STARTFRAME"
1611+ | (STARTFRAMESET(_)) => "STARTFRAMESET"
1612+ | (ENDFRAMESET) => "ENDFRAMESET"
1613+ | (STARTH1(_)) => "STARTH1"
1614+ | (ENDH1) => "ENDH1"
1615+ | (STARTH2(_)) => "STARTH2"
1616+ | (ENDH2) => "ENDH2"
1617+ | (STARTH3(_)) => "STARTH3"
1618+ | (ENDH3) => "ENDH3"
1619+ | (STARTH4(_)) => "STARTH4"
1620+ | (ENDH4) => "ENDH4"
1621+ | (STARTH5(_)) => "STARTH5"
1622+ | (ENDH5) => "ENDH5"
1623+ | (STARTH6(_)) => "STARTH6"
1624+ | (ENDH6) => "ENDH6"
1625+ | (STARTHEAD(_)) => "STARTHEAD"
1626+ | (ENDHEAD) => "ENDHEAD"
1627+ | (STARTHR(_)) => "STARTHR"
1628+ | (STARTHTML(_)) => "STARTHTML"
1629+ | (ENDHTML) => "ENDHTML"
1630+ | (STARTI(_)) => "STARTI"
1631+ | (ENDI) => "ENDI"
1632+ | (STARTIFRAME(_)) => "STARTIFRAME"
1633+ | (ENDIFRAME) => "ENDIFRAME"
1634+ | (STARTIMG(_)) => "STARTIMG"
1635+ | (STARTINPUT(_)) => "STARTINPUT"
1636+ | (STARTINS(_)) => "STARTINS"
1637+ | (ENDINS) => "ENDINS"
1638+ | (STARTISINDEX(_)) => "STARTISINDEX"
1639+ | (STARTKBD(_)) => "STARTKBD"
1640+ | (ENDKBD) => "ENDKBD"
1641+ | (STARTLABEL(_)) => "STARTLABEL"
1642+ | (ENDLABEL) => "ENDLABEL"
1643+ | (STARTLEGEND(_)) => "STARTLEGEND"
1644+ | (ENDLEGEND) => "ENDLEGEND"
1645+ | (STARTLI(_)) => "STARTLI"
1646+ | (ENDLI) => "ENDLI"
1647+ | (STARTLINK(_)) => "STARTLINK"
1648+ | (STARTMAP(_)) => "STARTMAP"
1649+ | (ENDMAP) => "ENDMAP"
1650+ | (STARTMENU(_)) => "STARTMENU"
1651+ | (ENDMENU) => "ENDMENU"
1652+ | (STARTMETA(_)) => "STARTMETA"
1653+ | (STARTNOFRAMES(_)) => "STARTNOFRAMES"
1654+ | (ENDNOFRAMES) => "ENDNOFRAMES"
1655+ | (STARTNOSCRIPT(_)) => "STARTNOSCRIPT"
1656+ | (ENDNOSCRIPT) => "ENDNOSCRIPT"
1657+ | (STARTOBJECT(_)) => "STARTOBJECT"
1658+ | (ENDOBJECT) => "ENDOBJECT"
1659+ | (STARTOL(_)) => "STARTOL"
1660+ | (ENDOL) => "ENDOL"
1661+ | (STARTOPTGROUP(_)) => "STARTOPTGROUP"
1662+ | (ENDOPTGROUP) => "ENDOPTGROUP"
1663+ | (STARTOPTION(_)) => "STARTOPTION"
1664+ | (ENDOPTION) => "ENDOPTION"
1665+ | (STARTP(_)) => "STARTP"
1666+ | (ENDP) => "ENDP"
1667+ | (STARTPARAM(_)) => "STARTPARAM"
1668+ | (STARTPRE(_)) => "STARTPRE"
1669+ | (ENDPRE) => "ENDPRE"
1670+ | (STARTQ(_)) => "STARTQ"
1671+ | (ENDQ) => "ENDQ"
1672+ | (STARTS(_)) => "STARTS"
1673+ | (ENDS) => "ENDS"
1674+ | (STARTSAMP(_)) => "STARTSAMP"
1675+ | (ENDSAMP) => "ENDSAMP"
1676+ | (STARTSCRIPT(_)) => "STARTSCRIPT"
1677+ | (ENDSCRIPT) => "ENDSCRIPT"
1678+ | (STARTSELECT(_)) => "STARTSELECT"
1679+ | (ENDSELECT) => "ENDSELECT"
1680+ | (STARTSMALL(_)) => "STARTSMALL"
1681+ | (ENDSMALL) => "ENDSMALL"
1682+ | (STARTSPAN(_)) => "STARTSPAN"
1683+ | (ENDSPAN) => "ENDSPAN"
1684+ | (STARTSTRIKE(_)) => "STARTSTRIKE"
1685+ | (ENDSTRIKE) => "ENDSTRIKE"
1686+ | (STARTSTRONG(_)) => "STARTSTRONG"
1687+ | (ENDSTRONG) => "ENDSTRONG"
1688+ | (STARTSTYLE(_)) => "STARTSTYLE"
1689+ | (ENDSTYLE) => "ENDSTYLE"
1690+ | (STARTSUB(_)) => "STARTSUB"
1691+ | (ENDSUB) => "ENDSUB"
1692+ | (STARTSUP(_)) => "STARTSUP"
1693+ | (ENDSUP) => "ENDSUP"
1694+ | (STARTTABLE(_)) => "STARTTABLE"
1695+ | (ENDTABLE) => "ENDTABLE"
1696+ | (STARTTBODY(_)) => "STARTTBODY"
1697+ | (ENDTBODY) => "ENDTBODY"
1698+ | (STARTTD(_)) => "STARTTD"
1699+ | (ENDTD) => "ENDTD"
1700+ | (STARTTEXTAREA(_)) => "STARTTEXTAREA"
1701+ | (ENDTEXTAREA) => "ENDTEXTAREA"
1702+ | (STARTTFOOT(_)) => "STARTTFOOT"
1703+ | (ENDTFOOT) => "ENDTFOOT"
1704+ | (STARTTH(_)) => "STARTTH"
1705+ | (ENDTH) => "ENDTH"
1706+ | (STARTTHEAD(_)) => "STARTTHEAD"
1707+ | (ENDTHEAD) => "ENDTHEAD"
1708+ | (STARTTITLE(_)) => "STARTTITLE"
1709+ | (ENDTITLE) => "ENDTITLE"
1710+ | (STARTTR(_)) => "STARTTR"
1711+ | (ENDTR) => "ENDTR"
1712+ | (STARTTT(_)) => "STARTTT"
1713+ | (ENDTT) => "ENDTT"
1714+ | (STARTU(_)) => "STARTU"
1715+ | (ENDU) => "ENDU"
1716+ | (STARTUL(_)) => "STARTUL"
1717+ | (ENDUL) => "ENDUL"
1718+ | (STARTVAR(_)) => "STARTVAR"
1719+ | (ENDVAR) => "ENDVAR"
1720+ | (EOF) => "EOF"
1721 (* end case *))
1722 fun isKW tok =
1723 (case (tok)
1724- of (EOF) => false
1725- | (ENDVAR) => false
1726- | (STARTVAR(_)) => false
1727- | (ENDUL) => false
1728- | (STARTUL(_)) => false
1729- | (ENDU) => false
1730- | (STARTU(_)) => false
1731- | (ENDTT) => false
1732- | (STARTTT(_)) => false
1733- | (ENDTR) => false
1734- | (STARTTR(_)) => false
1735- | (ENDTITLE) => false
1736- | (STARTTITLE(_)) => false
1737- | (ENDTHEAD) => false
1738- | (STARTTHEAD(_)) => false
1739- | (ENDTH) => false
1740- | (STARTTH(_)) => false
1741- | (ENDTFOOT) => false
1742- | (STARTTFOOT(_)) => false
1743- | (ENDTEXTAREA) => false
1744- | (STARTTEXTAREA(_)) => false
1745- | (ENDTD) => false
1746- | (STARTTD(_)) => false
1747- | (ENDTBODY) => false
1748- | (STARTTBODY(_)) => false
1749- | (ENDTABLE) => false
1750- | (STARTTABLE(_)) => false
1751- | (ENDSUP) => false
1752- | (STARTSUP(_)) => false
1753- | (ENDSUB) => false
1754- | (STARTSUB(_)) => false
1755- | (ENDSTYLE) => false
1756- | (STARTSTYLE(_)) => false
1757- | (ENDSTRONG) => false
1758- | (STARTSTRONG(_)) => false
1759- | (ENDSTRIKE) => false
1760- | (STARTSTRIKE(_)) => false
1761- | (ENDSPAN) => false
1762- | (STARTSPAN(_)) => false
1763- | (ENDSMALL) => false
1764- | (STARTSMALL(_)) => false
1765- | (ENDSELECT) => false
1766- | (STARTSELECT(_)) => false
1767- | (ENDSCRIPT) => false
1768- | (STARTSCRIPT(_)) => false
1769- | (ENDSAMP) => false
1770- | (STARTSAMP(_)) => false
1771- | (ENDS) => false
1772- | (STARTS(_)) => false
1773- | (ENDQ) => false
1774- | (STARTQ(_)) => false
1775- | (ENDPRE) => false
1776- | (STARTPRE(_)) => false
1777- | (STARTPARAM(_)) => false
1778- | (ENDP) => false
1779- | (STARTP(_)) => false
1780- | (ENDOPTION) => false
1781- | (STARTOPTION(_)) => false
1782- | (ENDOPTGROUP) => false
1783- | (STARTOPTGROUP(_)) => false
1784- | (ENDOL) => false
1785- | (STARTOL(_)) => false
1786- | (ENDOBJECT) => false
1787- | (STARTOBJECT(_)) => false
1788- | (ENDNOSCRIPT) => false
1789- | (STARTNOSCRIPT(_)) => false
1790- | (ENDNOFRAMES) => false
1791- | (STARTNOFRAMES(_)) => false
1792- | (STARTMETA(_)) => false
1793- | (ENDMENU) => false
1794- | (STARTMENU(_)) => false
1795- | (ENDMAP) => false
1796- | (STARTMAP(_)) => false
1797- | (STARTLINK(_)) => false
1798- | (ENDLI) => false
1799- | (STARTLI(_)) => false
1800- | (ENDLEGEND) => false
1801- | (STARTLEGEND(_)) => false
1802- | (ENDLABEL) => false
1803- | (STARTLABEL(_)) => false
1804- | (ENDKBD) => false
1805- | (STARTKBD(_)) => false
1806- | (STARTISINDEX(_)) => false
1807- | (ENDINS) => false
1808- | (STARTINS(_)) => false
1809- | (STARTINPUT(_)) => false
1810- | (STARTIMG(_)) => false
1811- | (ENDIFRAME) => false
1812- | (STARTIFRAME(_)) => false
1813- | (ENDI) => false
1814- | (STARTI(_)) => false
1815- | (ENDHTML) => false
1816- | (STARTHTML(_)) => false
1817- | (STARTHR(_)) => false
1818- | (ENDHEAD) => false
1819- | (STARTHEAD(_)) => false
1820- | (ENDH6) => false
1821- | (STARTH6(_)) => false
1822- | (ENDH5) => false
1823- | (STARTH5(_)) => false
1824- | (ENDH4) => false
1825- | (STARTH4(_)) => false
1826- | (ENDH3) => false
1827- | (STARTH3(_)) => false
1828- | (ENDH2) => false
1829- | (STARTH2(_)) => false
1830- | (ENDH1) => false
1831- | (STARTH1(_)) => false
1832- | (ENDFRAMESET) => false
1833- | (STARTFRAMESET(_)) => false
1834- | (STARTFRAME(_)) => false
1835- | (ENDFORM) => false
1836- | (STARTFORM(_)) => false
1837- | (ENDFONT) => false
1838- | (STARTFONT(_)) => false
1839- | (ENDFIELDSET) => false
1840- | (STARTFIELDSET(_)) => false
1841- | (ENDEM) => false
1842- | (STARTEM(_)) => false
1843- | (ENDDT) => false
1844- | (STARTDT(_)) => false
1845- | (ENDDL) => false
1846- | (STARTDL(_)) => false
1847- | (ENDDIV) => false
1848- | (STARTDIV(_)) => false
1849- | (ENDDIR) => false
1850- | (STARTDIR(_)) => false
1851- | (ENDDFN) => false
1852- | (STARTDFN(_)) => false
1853- | (ENDDEL) => false
1854- | (STARTDEL(_)) => false
1855- | (ENDDD) => false
1856- | (STARTDD(_)) => false
1857- | (ENDCOLGROUP) => false
1858- | (STARTCOLGROUP(_)) => false
1859- | (STARTCOL(_)) => false
1860- | (ENDCODE) => false
1861- | (STARTCODE(_)) => false
1862- | (ENDCITE) => false
1863- | (STARTCITE(_)) => false
1864- | (ENDCENTER) => false
1865- | (STARTCENTER(_)) => false
1866- | (ENDCAPTION) => false
1867- | (STARTCAPTION(_)) => false
1868- | (ENDBUTTON) => false
1869- | (STARTBUTTON(_)) => false
1870- | (STARTBR(_)) => false
1871- | (ENDBODY) => false
1872- | (STARTBODY(_)) => false
1873- | (ENDBLOCKQUOTE) => false
1874- | (STARTBLOCKQUOTE(_)) => false
1875- | (ENDBIG) => false
1876- | (STARTBIG(_)) => false
1877- | (ENDBDO) => false
1878- | (STARTBDO(_)) => false
1879- | (STARTBASEFONT(_)) => false
1880- | (STARTBASE(_)) => false
1881- | (ENDB) => false
1882- | (STARTB(_)) => false
1883- | (STARTAREA(_)) => false
1884- | (ENDAPPLET) => false
1885- | (STARTAPPLET(_)) => false
1886- | (ENDADDRESS) => false
1887- | (STARTADDRESS(_)) => false
1888- | (ENDACRONYM) => false
1889- | (STARTACRONYM(_)) => false
1890- | (ENDABBR) => false
1891- | (STARTABBR(_)) => false
1892- | (ENDA) => false
1893- | (STARTA(_)) => false
1894- | (XML_PROCESSING(_)) => false
1895- | (ENTITY_REF(_)) => false
1896- | (CHAR_REF(_)) => false
1897- | (DOCTYPE(_)) => false
1898- | (PCDATA(_)) => false
1899- | (COMMENT(_)) => false
1900+ of (OPENTAG(_)) => false
1901 | (CLOSETAG(_)) => false
1902- | (OPENTAG(_)) => false
1903+ | (COMMENT(_)) => false
1904+ | (PCDATA(_)) => false
1905+ | (DOCTYPE(_)) => false
1906+ | (CHAR_REF(_)) => false
1907+ | (ENTITY_REF(_)) => false
1908+ | (XML_PROCESSING(_)) => false
1909+ | (STARTA(_)) => false
1910+ | (ENDA) => false
1911+ | (STARTABBR(_)) => false
1912+ | (ENDABBR) => false
1913+ | (STARTACRONYM(_)) => false
1914+ | (ENDACRONYM) => false
1915+ | (STARTADDRESS(_)) => false
1916+ | (ENDADDRESS) => false
1917+ | (STARTAPPLET(_)) => false
1918+ | (ENDAPPLET) => false
1919+ | (STARTAREA(_)) => false
1920+ | (STARTB(_)) => false
1921+ | (ENDB) => false
1922+ | (STARTBASE(_)) => false
1923+ | (STARTBASEFONT(_)) => false
1924+ | (STARTBDO(_)) => false
1925+ | (ENDBDO) => false
1926+ | (STARTBIG(_)) => false
1927+ | (ENDBIG) => false
1928+ | (STARTBLOCKQUOTE(_)) => false
1929+ | (ENDBLOCKQUOTE) => false
1930+ | (STARTBODY(_)) => false
1931+ | (ENDBODY) => false
1932+ | (STARTBR(_)) => false
1933+ | (STARTBUTTON(_)) => false
1934+ | (ENDBUTTON) => false
1935+ | (STARTCAPTION(_)) => false
1936+ | (ENDCAPTION) => false
1937+ | (STARTCENTER(_)) => false
1938+ | (ENDCENTER) => false
1939+ | (STARTCITE(_)) => false
1940+ | (ENDCITE) => false
1941+ | (STARTCODE(_)) => false
1942+ | (ENDCODE) => false
1943+ | (STARTCOL(_)) => false
1944+ | (STARTCOLGROUP(_)) => false
1945+ | (ENDCOLGROUP) => false
1946+ | (STARTDD(_)) => false
1947+ | (ENDDD) => false
1948+ | (STARTDEL(_)) => false
1949+ | (ENDDEL) => false
1950+ | (STARTDFN(_)) => false
1951+ | (ENDDFN) => false
1952+ | (STARTDIR(_)) => false
1953+ | (ENDDIR) => false
1954+ | (STARTDIV(_)) => false
1955+ | (ENDDIV) => false
1956+ | (STARTDL(_)) => false
1957+ | (ENDDL) => false
1958+ | (STARTDT(_)) => false
1959+ | (ENDDT) => false
1960+ | (STARTEM(_)) => false
1961+ | (ENDEM) => false
1962+ | (STARTFIELDSET(_)) => false
1963+ | (ENDFIELDSET) => false
1964+ | (STARTFONT(_)) => false
1965+ | (ENDFONT) => false
1966+ | (STARTFORM(_)) => false
1967+ | (ENDFORM) => false
1968+ | (STARTFRAME(_)) => false
1969+ | (STARTFRAMESET(_)) => false
1970+ | (ENDFRAMESET) => false
1971+ | (STARTH1(_)) => false
1972+ | (ENDH1) => false
1973+ | (STARTH2(_)) => false
1974+ | (ENDH2) => false
1975+ | (STARTH3(_)) => false
1976+ | (ENDH3) => false
1977+ | (STARTH4(_)) => false
1978+ | (ENDH4) => false
1979+ | (STARTH5(_)) => false
1980+ | (ENDH5) => false
1981+ | (STARTH6(_)) => false
1982+ | (ENDH6) => false
1983+ | (STARTHEAD(_)) => false
1984+ | (ENDHEAD) => false
1985+ | (STARTHR(_)) => false
1986+ | (STARTHTML(_)) => false
1987+ | (ENDHTML) => false
1988+ | (STARTI(_)) => false
1989+ | (ENDI) => false
1990+ | (STARTIFRAME(_)) => false
1991+ | (ENDIFRAME) => false
1992+ | (STARTIMG(_)) => false
1993+ | (STARTINPUT(_)) => false
1994+ | (STARTINS(_)) => false
1995+ | (ENDINS) => false
1996+ | (STARTISINDEX(_)) => false
1997+ | (STARTKBD(_)) => false
1998+ | (ENDKBD) => false
1999+ | (STARTLABEL(_)) => false
2000+ | (ENDLABEL) => false
2001+ | (STARTLEGEND(_)) => false
2002+ | (ENDLEGEND) => false
2003+ | (STARTLI(_)) => false
2004+ | (ENDLI) => false
2005+ | (STARTLINK(_)) => false
2006+ | (STARTMAP(_)) => false
2007+ | (ENDMAP) => false
2008+ | (STARTMENU(_)) => false
2009+ | (ENDMENU) => false
2010+ | (STARTMETA(_)) => false
2011+ | (STARTNOFRAMES(_)) => false
2012+ | (ENDNOFRAMES) => false
2013+ | (STARTNOSCRIPT(_)) => false
2014+ | (ENDNOSCRIPT) => false
2015+ | (STARTOBJECT(_)) => false
2016+ | (ENDOBJECT) => false
2017+ | (STARTOL(_)) => false
2018+ | (ENDOL) => false
2019+ | (STARTOPTGROUP(_)) => false
2020+ | (ENDOPTGROUP) => false
2021+ | (STARTOPTION(_)) => false
2022+ | (ENDOPTION) => false
2023+ | (STARTP(_)) => false
2024+ | (ENDP) => false
2025+ | (STARTPARAM(_)) => false
2026+ | (STARTPRE(_)) => false
2027+ | (ENDPRE) => false
2028+ | (STARTQ(_)) => false
2029+ | (ENDQ) => false
2030+ | (STARTS(_)) => false
2031+ | (ENDS) => false
2032+ | (STARTSAMP(_)) => false
2033+ | (ENDSAMP) => false
2034+ | (STARTSCRIPT(_)) => false
2035+ | (ENDSCRIPT) => false
2036+ | (STARTSELECT(_)) => false
2037+ | (ENDSELECT) => false
2038+ | (STARTSMALL(_)) => false
2039+ | (ENDSMALL) => false
2040+ | (STARTSPAN(_)) => false
2041+ | (ENDSPAN) => false
2042+ | (STARTSTRIKE(_)) => false
2043+ | (ENDSTRIKE) => false
2044+ | (STARTSTRONG(_)) => false
2045+ | (ENDSTRONG) => false
2046+ | (STARTSTYLE(_)) => false
2047+ | (ENDSTYLE) => false
2048+ | (STARTSUB(_)) => false
2049+ | (ENDSUB) => false
2050+ | (STARTSUP(_)) => false
2051+ | (ENDSUP) => false
2052+ | (STARTTABLE(_)) => false
2053+ | (ENDTABLE) => false
2054+ | (STARTTBODY(_)) => false
2055+ | (ENDTBODY) => false
2056+ | (STARTTD(_)) => false
2057+ | (ENDTD) => false
2058+ | (STARTTEXTAREA(_)) => false
2059+ | (ENDTEXTAREA) => false
2060+ | (STARTTFOOT(_)) => false
2061+ | (ENDTFOOT) => false
2062+ | (STARTTH(_)) => false
2063+ | (ENDTH) => false
2064+ | (STARTTHEAD(_)) => false
2065+ | (ENDTHEAD) => false
2066+ | (STARTTITLE(_)) => false
2067+ | (ENDTITLE) => false
2068+ | (STARTTR(_)) => false
2069+ | (ENDTR) => false
2070+ | (STARTTT(_)) => false
2071+ | (ENDTT) => false
2072+ | (STARTU(_)) => false
2073+ | (ENDU) => false
2074+ | (STARTUL(_)) => false
2075+ | (ENDUL) => false
2076+ | (STARTVAR(_)) => false
2077+ | (ENDVAR) => false
2078+ | (EOF) => false
2079 (* end case *))
2080+ fun isEOF EOF = true
2081+ | isEOF _ = false
2082+ end (* HTML4Tokens *)
2083
2084- fun isEOF EOF = true
2085- | isEOF _ = false
2086-
2087-end
2088-
2089-functor HTML4ParseFn(Lex : ANTLR_LEXER) = struct
2090+functor HTML4ParseFn (Lex : ANTLR_LEXER) = struct
2091
2092 local
2093- structure Tok =
2094+ structure Tok =
2095 HTML4Tokens
2096 structure UserCode =
2097 struct
2098@@ -982,735 +980,769 @@ fun cdata_opt_PROD_1_ACT (cdata, cdata_SPAN : (Lex.pos * Lex.pos), FULL_SPAN : (
2099 structure Err = AntlrErrHandler(
2100 structure Tok = Tok
2101 structure Lex = Lex)
2102+
2103+(* replace functor with inline structure for better optimization
2104 structure EBNF = AntlrEBNF(
2105 struct
2106 type strm = Err.wstream
2107 val getSpan = Err.getSpan
2108 end)
2109+*)
2110+ structure EBNF =
2111+ struct
2112+ fun optional (pred, parse, strm) =
2113+ if pred strm
2114+ then let
2115+ val (y, span, strm') = parse strm
2116+ in
2117+ (SOME y, span, strm')
2118+ end
2119+ else (NONE, Err.getSpan strm, strm)
2120+
2121+ fun closure (pred, parse, strm) = let
2122+ fun iter (strm, (left, right), ys) =
2123+ if pred strm
2124+ then let
2125+ val (y, (_, right'), strm') = parse strm
2126+ in iter (strm', (left, right'), y::ys)
2127+ end
2128+ else (List.rev ys, (left, right), strm)
2129+ in
2130+ iter (strm, Err.getSpan strm, [])
2131+ end
2132+
2133+ fun posclos (pred, parse, strm) = let
2134+ val (y, (left, _), strm') = parse strm
2135+ val (ys, (_, right), strm'') = closure (pred, parse, strm')
2136+ in
2137+ (y::ys, (left, right), strm'')
2138+ end
2139+ end
2140
2141 fun mk lexFn = let
2142 fun getS() = {}
2143 fun putS{} = ()
2144-fun unwrap (ret, strm, repairs) = (ret, strm, repairs) val (eh, lex) = Err.mkErrHandler {get = getS, put = putS}
2145+fun unwrap (ret, strm, repairs) = (ret, strm, repairs)
2146+ val (eh, lex) = Err.mkErrHandler {get = getS, put = putS}
2147 fun fail() = Err.failure eh
2148 fun tryProds (strm, prods) = let
2149 fun try [] = fail()
2150- | try (prod :: prods) =
2151- (Err.whileDisabled eh (fn() => prod strm))
2152+ | try (prod :: prods) =
2153+ (Err.whileDisabled eh (fn() => prod strm))
2154 handle Err.ParseError => try (prods)
2155 in try prods end
2156-fun matchEOF strm = (case (lex(strm))
2157- of (Tok.EOF, span, strm') => ((), span, strm')
2158- | _ => fail()
2159-(* end case *))
2160-fun matchENDVAR strm = (case (lex(strm))
2161- of (Tok.ENDVAR, span, strm') => ((), span, strm')
2162- | _ => fail()
2163-(* end case *))
2164-fun matchSTARTVAR strm = (case (lex(strm))
2165- of (Tok.STARTVAR(x), span, strm') => (x, span, strm')
2166- | _ => fail()
2167-(* end case *))
2168-fun matchENDUL strm = (case (lex(strm))
2169- of (Tok.ENDUL, span, strm') => ((), span, strm')
2170- | _ => fail()
2171-(* end case *))
2172-fun matchSTARTUL strm = (case (lex(strm))
2173- of (Tok.STARTUL(x), span, strm') => (x, span, strm')
2174- | _ => fail()
2175-(* end case *))
2176-fun matchENDU strm = (case (lex(strm))
2177- of (Tok.ENDU, span, strm') => ((), span, strm')
2178- | _ => fail()
2179-(* end case *))
2180-fun matchSTARTU strm = (case (lex(strm))
2181- of (Tok.STARTU(x), span, strm') => (x, span, strm')
2182- | _ => fail()
2183-(* end case *))
2184-fun matchENDTT strm = (case (lex(strm))
2185- of (Tok.ENDTT, span, strm') => ((), span, strm')
2186- | _ => fail()
2187-(* end case *))
2188-fun matchSTARTTT strm = (case (lex(strm))
2189- of (Tok.STARTTT(x), span, strm') => (x, span, strm')
2190- | _ => fail()
2191-(* end case *))
2192-fun matchENDTR strm = (case (lex(strm))
2193- of (Tok.ENDTR, span, strm') => ((), span, strm')
2194- | _ => fail()
2195-(* end case *))
2196-fun matchSTARTTR strm = (case (lex(strm))
2197- of (Tok.STARTTR(x), span, strm') => (x, span, strm')
2198- | _ => fail()
2199-(* end case *))
2200-fun matchENDTITLE strm = (case (lex(strm))
2201- of (Tok.ENDTITLE, span, strm') => ((), span, strm')
2202- | _ => fail()
2203-(* end case *))
2204-fun matchSTARTTITLE strm = (case (lex(strm))
2205- of (Tok.STARTTITLE(x), span, strm') => (x, span, strm')
2206- | _ => fail()
2207-(* end case *))
2208-fun matchENDTHEAD strm = (case (lex(strm))
2209- of (Tok.ENDTHEAD, span, strm') => ((), span, strm')
2210- | _ => fail()
2211-(* end case *))
2212-fun matchSTARTTHEAD strm = (case (lex(strm))
2213- of (Tok.STARTTHEAD(x), span, strm') => (x, span, strm')
2214- | _ => fail()
2215-(* end case *))
2216-fun matchENDTH strm = (case (lex(strm))
2217- of (Tok.ENDTH, span, strm') => ((), span, strm')
2218- | _ => fail()
2219-(* end case *))
2220-fun matchSTARTTH strm = (case (lex(strm))
2221- of (Tok.STARTTH(x), span, strm') => (x, span, strm')
2222- | _ => fail()
2223-(* end case *))
2224-fun matchENDTFOOT strm = (case (lex(strm))
2225- of (Tok.ENDTFOOT, span, strm') => ((), span, strm')
2226- | _ => fail()
2227-(* end case *))
2228-fun matchSTARTTFOOT strm = (case (lex(strm))
2229- of (Tok.STARTTFOOT(x), span, strm') => (x, span, strm')
2230- | _ => fail()
2231-(* end case *))
2232-fun matchENDTEXTAREA strm = (case (lex(strm))
2233- of (Tok.ENDTEXTAREA, span, strm') => ((), span, strm')
2234- | _ => fail()
2235-(* end case *))
2236-fun matchSTARTTEXTAREA strm = (case (lex(strm))
2237- of (Tok.STARTTEXTAREA(x), span, strm') => (x, span, strm')
2238- | _ => fail()
2239-(* end case *))
2240-fun matchENDTD strm = (case (lex(strm))
2241- of (Tok.ENDTD, span, strm') => ((), span, strm')
2242- | _ => fail()
2243-(* end case *))
2244-fun matchSTARTTD strm = (case (lex(strm))
2245- of (Tok.STARTTD(x), span, strm') => (x, span, strm')
2246- | _ => fail()
2247-(* end case *))
2248-fun matchENDTBODY strm = (case (lex(strm))
2249- of (Tok.ENDTBODY, span, strm') => ((), span, strm')
2250- | _ => fail()
2251-(* end case *))
2252-fun matchSTARTTBODY strm = (case (lex(strm))
2253- of (Tok.STARTTBODY(x), span, strm') => (x, span, strm')
2254- | _ => fail()
2255-(* end case *))
2256-fun matchENDTABLE strm = (case (lex(strm))
2257- of (Tok.ENDTABLE, span, strm') => ((), span, strm')
2258- | _ => fail()
2259-(* end case *))
2260-fun matchSTARTTABLE strm = (case (lex(strm))
2261- of (Tok.STARTTABLE(x), span, strm') => (x, span, strm')
2262- | _ => fail()
2263-(* end case *))
2264-fun matchENDSUP strm = (case (lex(strm))
2265- of (Tok.ENDSUP, span, strm') => ((), span, strm')
2266- | _ => fail()
2267-(* end case *))
2268-fun matchSTARTSUP strm = (case (lex(strm))
2269- of (Tok.STARTSUP(x), span, strm') => (x, span, strm')
2270- | _ => fail()
2271-(* end case *))
2272-fun matchENDSUB strm = (case (lex(strm))
2273- of (Tok.ENDSUB, span, strm') => ((), span, strm')
2274- | _ => fail()
2275-(* end case *))
2276-fun matchSTARTSUB strm = (case (lex(strm))
2277- of (Tok.STARTSUB(x), span, strm') => (x, span, strm')
2278- | _ => fail()
2279-(* end case *))
2280-fun matchENDSTYLE strm = (case (lex(strm))
2281- of (Tok.ENDSTYLE, span, strm') => ((), span, strm')
2282- | _ => fail()
2283-(* end case *))
2284-fun matchSTARTSTYLE strm = (case (lex(strm))
2285- of (Tok.STARTSTYLE(x), span, strm') => (x, span, strm')
2286- | _ => fail()
2287-(* end case *))
2288-fun matchENDSTRONG strm = (case (lex(strm))
2289- of (Tok.ENDSTRONG, span, strm') => ((), span, strm')
2290- | _ => fail()
2291-(* end case *))
2292-fun matchSTARTSTRONG strm = (case (lex(strm))
2293- of (Tok.STARTSTRONG(x), span, strm') => (x, span, strm')
2294- | _ => fail()
2295-(* end case *))
2296-fun matchENDSTRIKE strm = (case (lex(strm))
2297- of (Tok.ENDSTRIKE, span, strm') => ((), span, strm')
2298- | _ => fail()
2299-(* end case *))
2300-fun matchSTARTSTRIKE strm = (case (lex(strm))
2301- of (Tok.STARTSTRIKE(x), span, strm') => (x, span, strm')
2302- | _ => fail()
2303-(* end case *))
2304-fun matchENDSPAN strm = (case (lex(strm))
2305- of (Tok.ENDSPAN, span, strm') => ((), span, strm')
2306- | _ => fail()
2307-(* end case *))
2308-fun matchSTARTSPAN strm = (case (lex(strm))
2309- of (Tok.STARTSPAN(x), span, strm') => (x, span, strm')
2310- | _ => fail()
2311-(* end case *))
2312-fun matchENDSMALL strm = (case (lex(strm))
2313- of (Tok.ENDSMALL, span, strm') => ((), span, strm')
2314- | _ => fail()
2315-(* end case *))
2316-fun matchSTARTSMALL strm = (case (lex(strm))
2317- of (Tok.STARTSMALL(x), span, strm') => (x, span, strm')
2318- | _ => fail()
2319-(* end case *))
2320-fun matchENDSELECT strm = (case (lex(strm))
2321- of (Tok.ENDSELECT, span, strm') => ((), span, strm')
2322- | _ => fail()
2323-(* end case *))
2324-fun matchSTARTSELECT strm = (case (lex(strm))
2325- of (Tok.STARTSELECT(x), span, strm') => (x, span, strm')
2326- | _ => fail()
2327-(* end case *))
2328-fun matchENDSCRIPT strm = (case (lex(strm))
2329- of (Tok.ENDSCRIPT, span, strm') => ((), span, strm')
2330- | _ => fail()
2331-(* end case *))
2332-fun matchSTARTSCRIPT strm = (case (lex(strm))
2333- of (Tok.STARTSCRIPT(x), span, strm') => (x, span, strm')
2334- | _ => fail()
2335-(* end case *))
2336-fun matchENDSAMP strm = (case (lex(strm))
2337- of (Tok.ENDSAMP, span, strm') => ((), span, strm')
2338- | _ => fail()
2339-(* end case *))
2340-fun matchSTARTSAMP strm = (case (lex(strm))
2341- of (Tok.STARTSAMP(x), span, strm') => (x, span, strm')
2342- | _ => fail()
2343-(* end case *))
2344-fun matchENDS strm = (case (lex(strm))
2345- of (Tok.ENDS, span, strm') => ((), span, strm')
2346- | _ => fail()
2347-(* end case *))
2348-fun matchSTARTS strm = (case (lex(strm))
2349- of (Tok.STARTS(x), span, strm') => (x, span, strm')
2350- | _ => fail()
2351-(* end case *))
2352-fun matchENDQ strm = (case (lex(strm))
2353- of (Tok.ENDQ, span, strm') => ((), span, strm')
2354- | _ => fail()
2355-(* end case *))
2356-fun matchSTARTQ strm = (case (lex(strm))
2357- of (Tok.STARTQ(x), span, strm') => (x, span, strm')
2358- | _ => fail()
2359-(* end case *))
2360-fun matchENDPRE strm = (case (lex(strm))
2361- of (Tok.ENDPRE, span, strm') => ((), span, strm')
2362- | _ => fail()
2363-(* end case *))
2364-fun matchSTARTPRE strm = (case (lex(strm))
2365- of (Tok.STARTPRE(x), span, strm') => (x, span, strm')
2366- | _ => fail()
2367-(* end case *))
2368-fun matchSTARTPARAM strm = (case (lex(strm))
2369- of (Tok.STARTPARAM(x), span, strm') => (x, span, strm')
2370- | _ => fail()
2371-(* end case *))
2372-fun matchENDP strm = (case (lex(strm))
2373- of (Tok.ENDP, span, strm') => ((), span, strm')
2374- | _ => fail()
2375-(* end case *))
2376-fun matchSTARTP strm = (case (lex(strm))
2377- of (Tok.STARTP(x), span, strm') => (x, span, strm')
2378- | _ => fail()
2379-(* end case *))
2380-fun matchENDOPTION strm = (case (lex(strm))
2381- of (Tok.ENDOPTION, span, strm') => ((), span, strm')
2382- | _ => fail()
2383-(* end case *))
2384-fun matchSTARTOPTION strm = (case (lex(strm))
2385- of (Tok.STARTOPTION(x), span, strm') => (x, span, strm')
2386- | _ => fail()
2387-(* end case *))
2388-fun matchENDOPTGROUP strm = (case (lex(strm))
2389- of (Tok.ENDOPTGROUP, span, strm') => ((), span, strm')
2390- | _ => fail()
2391-(* end case *))
2392-fun matchSTARTOPTGROUP strm = (case (lex(strm))
2393- of (Tok.STARTOPTGROUP(x), span, strm') => (x, span, strm')
2394- | _ => fail()
2395-(* end case *))
2396-fun matchENDOL strm = (case (lex(strm))
2397- of (Tok.ENDOL, span, strm') => ((), span, strm')
2398- | _ => fail()
2399-(* end case *))
2400-fun matchSTARTOL strm = (case (lex(strm))
2401- of (Tok.STARTOL(x), span, strm') => (x, span, strm')
2402- | _ => fail()
2403-(* end case *))
2404-fun matchENDOBJECT strm = (case (lex(strm))
2405- of (Tok.ENDOBJECT, span, strm') => ((), span, strm')
2406- | _ => fail()
2407-(* end case *))
2408-fun matchSTARTOBJECT strm = (case (lex(strm))
2409- of (Tok.STARTOBJECT(x), span, strm') => (x, span, strm')
2410- | _ => fail()
2411-(* end case *))
2412-fun matchENDNOSCRIPT strm = (case (lex(strm))
2413- of (Tok.ENDNOSCRIPT, span, strm') => ((), span, strm')
2414- | _ => fail()
2415-(* end case *))
2416-fun matchSTARTNOSCRIPT strm = (case (lex(strm))
2417- of (Tok.STARTNOSCRIPT(x), span, strm') => (x, span, strm')
2418- | _ => fail()
2419-(* end case *))
2420-fun matchENDNOFRAMES strm = (case (lex(strm))
2421- of (Tok.ENDNOFRAMES, span, strm') => ((), span, strm')
2422- | _ => fail()
2423-(* end case *))
2424-fun matchSTARTNOFRAMES strm = (case (lex(strm))
2425- of (Tok.STARTNOFRAMES(x), span, strm') => (x, span, strm')
2426- | _ => fail()
2427-(* end case *))
2428-fun matchSTARTMETA strm = (case (lex(strm))
2429- of (Tok.STARTMETA(x), span, strm') => (x, span, strm')
2430- | _ => fail()
2431-(* end case *))
2432-fun matchENDMENU strm = (case (lex(strm))
2433- of (Tok.ENDMENU, span, strm') => ((), span, strm')
2434- | _ => fail()
2435-(* end case *))
2436-fun matchSTARTMENU strm = (case (lex(strm))
2437- of (Tok.STARTMENU(x), span, strm') => (x, span, strm')
2438- | _ => fail()
2439-(* end case *))
2440-fun matchENDMAP strm = (case (lex(strm))
2441- of (Tok.ENDMAP, span, strm') => ((), span, strm')
2442- | _ => fail()
2443-(* end case *))
2444-fun matchSTARTMAP strm = (case (lex(strm))
2445- of (Tok.STARTMAP(x), span, strm') => (x, span, strm')
2446- | _ => fail()
2447-(* end case *))
2448-fun matchSTARTLINK strm = (case (lex(strm))
2449- of (Tok.STARTLINK(x), span, strm') => (x, span, strm')
2450- | _ => fail()
2451-(* end case *))
2452-fun matchENDLI strm = (case (lex(strm))
2453- of (Tok.ENDLI, span, strm') => ((), span, strm')
2454- | _ => fail()
2455-(* end case *))
2456-fun matchSTARTLI strm = (case (lex(strm))
2457- of (Tok.STARTLI(x), span, strm') => (x, span, strm')
2458- | _ => fail()
2459-(* end case *))
2460-fun matchENDLEGEND strm = (case (lex(strm))
2461- of (Tok.ENDLEGEND, span, strm') => ((), span, strm')
2462- | _ => fail()
2463-(* end case *))
2464-fun matchSTARTLEGEND strm = (case (lex(strm))
2465- of (Tok.STARTLEGEND(x), span, strm') => (x, span, strm')
2466- | _ => fail()
2467-(* end case *))
2468-fun matchENDLABEL strm = (case (lex(strm))
2469- of (Tok.ENDLABEL, span, strm') => ((), span, strm')
2470- | _ => fail()
2471-(* end case *))
2472-fun matchSTARTLABEL strm = (case (lex(strm))
2473- of (Tok.STARTLABEL(x), span, strm') => (x, span, strm')
2474- | _ => fail()
2475-(* end case *))
2476-fun matchENDKBD strm = (case (lex(strm))
2477- of (Tok.ENDKBD, span, strm') => ((), span, strm')
2478- | _ => fail()
2479-(* end case *))
2480-fun matchSTARTKBD strm = (case (lex(strm))
2481- of (Tok.STARTKBD(x), span, strm') => (x, span, strm')
2482- | _ => fail()
2483-(* end case *))
2484-fun matchSTARTISINDEX strm = (case (lex(strm))
2485- of (Tok.STARTISINDEX(x), span, strm') => (x, span, strm')
2486- | _ => fail()
2487-(* end case *))
2488-fun matchENDINS strm = (case (lex(strm))
2489- of (Tok.ENDINS, span, strm') => ((), span, strm')
2490- | _ => fail()
2491-(* end case *))
2492-fun matchSTARTINS strm = (case (lex(strm))
2493- of (Tok.STARTINS(x), span, strm') => (x, span, strm')
2494- | _ => fail()
2495-(* end case *))
2496-fun matchSTARTINPUT strm = (case (lex(strm))
2497- of (Tok.STARTINPUT(x), span, strm') => (x, span, strm')
2498- | _ => fail()
2499-(* end case *))
2500-fun matchSTARTIMG strm = (case (lex(strm))
2501- of (Tok.STARTIMG(x), span, strm') => (x, span, strm')
2502- | _ => fail()
2503-(* end case *))
2504-fun matchENDIFRAME strm = (case (lex(strm))
2505- of (Tok.ENDIFRAME, span, strm') => ((), span, strm')
2506- | _ => fail()
2507-(* end case *))
2508-fun matchSTARTIFRAME strm = (case (lex(strm))
2509- of (Tok.STARTIFRAME(x), span, strm') => (x, span, strm')
2510- | _ => fail()
2511-(* end case *))
2512-fun matchENDI strm = (case (lex(strm))
2513- of (Tok.ENDI, span, strm') => ((), span, strm')
2514- | _ => fail()
2515-(* end case *))
2516-fun matchSTARTI strm = (case (lex(strm))
2517- of (Tok.STARTI(x), span, strm') => (x, span, strm')
2518- | _ => fail()
2519-(* end case *))
2520-fun matchENDHTML strm = (case (lex(strm))
2521- of (Tok.ENDHTML, span, strm') => ((), span, strm')
2522- | _ => fail()
2523-(* end case *))
2524-fun matchSTARTHTML strm = (case (lex(strm))
2525- of (Tok.STARTHTML(x), span, strm') => (x, span, strm')
2526- | _ => fail()
2527-(* end case *))
2528-fun matchSTARTHR strm = (case (lex(strm))
2529- of (Tok.STARTHR(x), span, strm') => (x, span, strm')
2530- | _ => fail()
2531-(* end case *))
2532-fun matchENDHEAD strm = (case (lex(strm))
2533- of (Tok.ENDHEAD, span, strm') => ((), span, strm')
2534- | _ => fail()
2535-(* end case *))
2536-fun matchSTARTHEAD strm = (case (lex(strm))
2537- of (Tok.STARTHEAD(x), span, strm') => (x, span, strm')
2538- | _ => fail()
2539-(* end case *))
2540-fun matchENDH6 strm = (case (lex(strm))
2541- of (Tok.ENDH6, span, strm') => ((), span, strm')
2542- | _ => fail()
2543-(* end case *))
2544-fun matchSTARTH6 strm = (case (lex(strm))
2545- of (Tok.STARTH6(x), span, strm') => (x, span, strm')
2546- | _ => fail()
2547-(* end case *))
2548-fun matchENDH5 strm = (case (lex(strm))
2549- of (Tok.ENDH5, span, strm') => ((), span, strm')
2550- | _ => fail()
2551-(* end case *))
2552-fun matchSTARTH5 strm = (case (lex(strm))
2553- of (Tok.STARTH5(x), span, strm') => (x, span, strm')
2554- | _ => fail()
2555-(* end case *))
2556-fun matchENDH4 strm = (case (lex(strm))
2557- of (Tok.ENDH4, span, strm') => ((), span, strm')
2558- | _ => fail()
2559-(* end case *))
2560-fun matchSTARTH4 strm = (case (lex(strm))
2561- of (Tok.STARTH4(x), span, strm') => (x, span, strm')
2562- | _ => fail()
2563-(* end case *))
2564-fun matchENDH3 strm = (case (lex(strm))
2565- of (Tok.ENDH3, span, strm') => ((), span, strm')
2566- | _ => fail()
2567-(* end case *))
2568-fun matchSTARTH3 strm = (case (lex(strm))
2569- of (Tok.STARTH3(x), span, strm') => (x, span, strm')
2570- | _ => fail()
2571-(* end case *))
2572-fun matchENDH2 strm = (case (lex(strm))
2573- of (Tok.ENDH2, span, strm') => ((), span, strm')
2574- | _ => fail()
2575-(* end case *))
2576-fun matchSTARTH2 strm = (case (lex(strm))
2577- of (Tok.STARTH2(x), span, strm') => (x, span, strm')
2578- | _ => fail()
2579-(* end case *))
2580-fun matchENDH1 strm = (case (lex(strm))
2581- of (Tok.ENDH1, span, strm') => ((), span, strm')
2582- | _ => fail()
2583-(* end case *))
2584-fun matchSTARTH1 strm = (case (lex(strm))
2585- of (Tok.STARTH1(x), span, strm') => (x, span, strm')
2586- | _ => fail()
2587-(* end case *))
2588-fun matchENDFRAMESET strm = (case (lex(strm))
2589- of (Tok.ENDFRAMESET, span, strm') => ((), span, strm')
2590- | _ => fail()
2591-(* end case *))
2592-fun matchSTARTFRAMESET strm = (case (lex(strm))
2593- of (Tok.STARTFRAMESET(x), span, strm') => (x, span, strm')
2594- | _ => fail()
2595-(* end case *))
2596-fun matchSTARTFRAME strm = (case (lex(strm))
2597- of (Tok.STARTFRAME(x), span, strm') => (x, span, strm')
2598- | _ => fail()
2599-(* end case *))
2600-fun matchENDFORM strm = (case (lex(strm))
2601- of (Tok.ENDFORM, span, strm') => ((), span, strm')
2602- | _ => fail()
2603-(* end case *))
2604-fun matchSTARTFORM strm = (case (lex(strm))
2605- of (Tok.STARTFORM(x), span, strm') => (x, span, strm')
2606- | _ => fail()
2607-(* end case *))
2608-fun matchENDFONT strm = (case (lex(strm))
2609- of (Tok.ENDFONT, span, strm') => ((), span, strm')
2610- | _ => fail()
2611-(* end case *))
2612-fun matchSTARTFONT strm = (case (lex(strm))
2613- of (Tok.STARTFONT(x), span, strm') => (x, span, strm')
2614- | _ => fail()
2615-(* end case *))
2616-fun matchENDFIELDSET strm = (case (lex(strm))
2617- of (Tok.ENDFIELDSET, span, strm') => ((), span, strm')
2618- | _ => fail()
2619-(* end case *))
2620-fun matchSTARTFIELDSET strm = (case (lex(strm))
2621- of (Tok.STARTFIELDSET(x), span, strm') => (x, span, strm')
2622- | _ => fail()
2623-(* end case *))
2624-fun matchENDEM strm = (case (lex(strm))
2625- of (Tok.ENDEM, span, strm') => ((), span, strm')
2626- | _ => fail()
2627-(* end case *))
2628-fun matchSTARTEM strm = (case (lex(strm))
2629- of (Tok.STARTEM(x), span, strm') => (x, span, strm')
2630- | _ => fail()
2631-(* end case *))
2632-fun matchENDDT strm = (case (lex(strm))
2633- of (Tok.ENDDT, span, strm') => ((), span, strm')
2634- | _ => fail()
2635-(* end case *))
2636-fun matchSTARTDT strm = (case (lex(strm))
2637- of (Tok.STARTDT(x), span, strm') => (x, span, strm')
2638- | _ => fail()
2639-(* end case *))
2640-fun matchENDDL strm = (case (lex(strm))
2641- of (Tok.ENDDL, span, strm') => ((), span, strm')
2642- | _ => fail()
2643-(* end case *))
2644-fun matchSTARTDL strm = (case (lex(strm))
2645- of (Tok.STARTDL(x), span, strm') => (x, span, strm')
2646- | _ => fail()
2647-(* end case *))
2648-fun matchENDDIV strm = (case (lex(strm))
2649- of (Tok.ENDDIV, span, strm') => ((), span, strm')
2650- | _ => fail()
2651-(* end case *))
2652-fun matchSTARTDIV strm = (case (lex(strm))
2653- of (Tok.STARTDIV(x), span, strm') => (x, span, strm')
2654- | _ => fail()
2655-(* end case *))
2656-fun matchENDDIR strm = (case (lex(strm))
2657- of (Tok.ENDDIR, span, strm') => ((), span, strm')
2658- | _ => fail()
2659-(* end case *))
2660-fun matchSTARTDIR strm = (case (lex(strm))
2661- of (Tok.STARTDIR(x), span, strm') => (x, span, strm')
2662- | _ => fail()
2663-(* end case *))
2664-fun matchENDDFN strm = (case (lex(strm))
2665- of (Tok.ENDDFN, span, strm') => ((), span, strm')
2666- | _ => fail()
2667-(* end case *))
2668-fun matchSTARTDFN strm = (case (lex(strm))
2669- of (Tok.STARTDFN(x), span, strm') => (x, span, strm')
2670- | _ => fail()
2671-(* end case *))
2672-fun matchENDDEL strm = (case (lex(strm))
2673- of (Tok.ENDDEL, span, strm') => ((), span, strm')
2674- | _ => fail()
2675-(* end case *))
2676-fun matchSTARTDEL strm = (case (lex(strm))
2677- of (Tok.STARTDEL(x), span, strm') => (x, span, strm')
2678- | _ => fail()
2679-(* end case *))
2680-fun matchENDDD strm = (case (lex(strm))
2681- of (Tok.ENDDD, span, strm') => ((), span, strm')
2682- | _ => fail()
2683-(* end case *))
2684-fun matchSTARTDD strm = (case (lex(strm))
2685- of (Tok.STARTDD(x), span, strm') => (x, span, strm')
2686- | _ => fail()
2687-(* end case *))
2688-fun matchENDCOLGROUP strm = (case (lex(strm))
2689- of (Tok.ENDCOLGROUP, span, strm') => ((), span, strm')
2690- | _ => fail()
2691-(* end case *))
2692-fun matchSTARTCOLGROUP strm = (case (lex(strm))
2693- of (Tok.STARTCOLGROUP(x), span, strm') => (x, span, strm')
2694- | _ => fail()
2695-(* end case *))
2696-fun matchSTARTCOL strm = (case (lex(strm))
2697- of (Tok.STARTCOL(x), span, strm') => (x, span, strm')
2698- | _ => fail()
2699-(* end case *))
2700-fun matchENDCODE strm = (case (lex(strm))
2701- of (Tok.ENDCODE, span, strm') => ((), span, strm')
2702- | _ => fail()
2703-(* end case *))
2704-fun matchSTARTCODE strm = (case (lex(strm))
2705- of (Tok.STARTCODE(x), span, strm') => (x, span, strm')
2706- | _ => fail()
2707-(* end case *))
2708-fun matchENDCITE strm = (case (lex(strm))
2709- of (Tok.ENDCITE, span, strm') => ((), span, strm')
2710- | _ => fail()
2711-(* end case *))
2712-fun matchSTARTCITE strm = (case (lex(strm))
2713- of (Tok.STARTCITE(x), span, strm') => (x, span, strm')
2714- | _ => fail()
2715-(* end case *))
2716-fun matchENDCENTER strm = (case (lex(strm))
2717- of (Tok.ENDCENTER, span, strm') => ((), span, strm')
2718- | _ => fail()
2719-(* end case *))
2720-fun matchSTARTCENTER strm = (case (lex(strm))
2721- of (Tok.STARTCENTER(x), span, strm') => (x, span, strm')
2722- | _ => fail()
2723-(* end case *))
2724-fun matchENDCAPTION strm = (case (lex(strm))
2725- of (Tok.ENDCAPTION, span, strm') => ((), span, strm')
2726- | _ => fail()
2727-(* end case *))
2728-fun matchSTARTCAPTION strm = (case (lex(strm))
2729- of (Tok.STARTCAPTION(x), span, strm') => (x, span, strm')
2730- | _ => fail()
2731-(* end case *))
2732-fun matchENDBUTTON strm = (case (lex(strm))
2733- of (Tok.ENDBUTTON, span, strm') => ((), span, strm')
2734- | _ => fail()
2735-(* end case *))
2736-fun matchSTARTBUTTON strm = (case (lex(strm))
2737- of (Tok.STARTBUTTON(x), span, strm') => (x, span, strm')
2738- | _ => fail()
2739-(* end case *))
2740-fun matchSTARTBR strm = (case (lex(strm))
2741- of (Tok.STARTBR(x), span, strm') => (x, span, strm')
2742- | _ => fail()
2743-(* end case *))
2744-fun matchENDBODY strm = (case (lex(strm))
2745- of (Tok.ENDBODY, span, strm') => ((), span, strm')
2746- | _ => fail()
2747-(* end case *))
2748-fun matchSTARTBODY strm = (case (lex(strm))
2749- of (Tok.STARTBODY(x), span, strm') => (x, span, strm')
2750- | _ => fail()
2751-(* end case *))
2752-fun matchENDBLOCKQUOTE strm = (case (lex(strm))
2753- of (Tok.ENDBLOCKQUOTE, span, strm') => ((), span, strm')
2754- | _ => fail()
2755-(* end case *))
2756-fun matchSTARTBLOCKQUOTE strm = (case (lex(strm))
2757- of (Tok.STARTBLOCKQUOTE(x), span, strm') => (x, span, strm')
2758- | _ => fail()
2759-(* end case *))
2760-fun matchENDBIG strm = (case (lex(strm))
2761- of (Tok.ENDBIG, span, strm') => ((), span, strm')
2762- | _ => fail()
2763-(* end case *))
2764-fun matchSTARTBIG strm = (case (lex(strm))
2765- of (Tok.STARTBIG(x), span, strm') => (x, span, strm')
2766- | _ => fail()
2767-(* end case *))
2768-fun matchENDBDO strm = (case (lex(strm))
2769- of (Tok.ENDBDO, span, strm') => ((), span, strm')
2770- | _ => fail()
2771-(* end case *))
2772-fun matchSTARTBDO strm = (case (lex(strm))
2773- of (Tok.STARTBDO(x), span, strm') => (x, span, strm')
2774- | _ => fail()
2775-(* end case *))
2776-fun matchSTARTBASEFONT strm = (case (lex(strm))
2777- of (Tok.STARTBASEFONT(x), span, strm') => (x, span, strm')
2778- | _ => fail()
2779-(* end case *))
2780-fun matchSTARTBASE strm = (case (lex(strm))
2781- of (Tok.STARTBASE(x), span, strm') => (x, span, strm')
2782- | _ => fail()
2783-(* end case *))
2784-fun matchENDB strm = (case (lex(strm))
2785- of (Tok.ENDB, span, strm') => ((), span, strm')
2786- | _ => fail()
2787-(* end case *))
2788-fun matchSTARTB strm = (case (lex(strm))
2789- of (Tok.STARTB(x), span, strm') => (x, span, strm')
2790- | _ => fail()
2791-(* end case *))
2792-fun matchSTARTAREA strm = (case (lex(strm))
2793- of (Tok.STARTAREA(x), span, strm') => (x, span, strm')
2794- | _ => fail()
2795-(* end case *))
2796-fun matchENDAPPLET strm = (case (lex(strm))
2797- of (Tok.ENDAPPLET, span, strm') => ((), span, strm')
2798- | _ => fail()
2799-(* end case *))
2800-fun matchSTARTAPPLET strm = (case (lex(strm))
2801- of (Tok.STARTAPPLET(x), span, strm') => (x, span, strm')
2802- | _ => fail()
2803-(* end case *))
2804-fun matchENDADDRESS strm = (case (lex(strm))
2805- of (Tok.ENDADDRESS, span, strm') => ((), span, strm')
2806- | _ => fail()
2807-(* end case *))
2808-fun matchSTARTADDRESS strm = (case (lex(strm))
2809- of (Tok.STARTADDRESS(x), span, strm') => (x, span, strm')
2810- | _ => fail()
2811-(* end case *))
2812-fun matchENDACRONYM strm = (case (lex(strm))
2813- of (Tok.ENDACRONYM, span, strm') => ((), span, strm')
2814- | _ => fail()
2815-(* end case *))
2816-fun matchSTARTACRONYM strm = (case (lex(strm))
2817- of (Tok.STARTACRONYM(x), span, strm') => (x, span, strm')
2818- | _ => fail()
2819-(* end case *))
2820-fun matchENDABBR strm = (case (lex(strm))
2821- of (Tok.ENDABBR, span, strm') => ((), span, strm')
2822- | _ => fail()
2823-(* end case *))
2824-fun matchSTARTABBR strm = (case (lex(strm))
2825- of (Tok.STARTABBR(x), span, strm') => (x, span, strm')
2826- | _ => fail()
2827-(* end case *))
2828-fun matchENDA strm = (case (lex(strm))
2829- of (Tok.ENDA, span, strm') => ((), span, strm')
2830- | _ => fail()
2831-(* end case *))
2832-fun matchSTARTA strm = (case (lex(strm))
2833- of (Tok.STARTA(x), span, strm') => (x, span, strm')
2834- | _ => fail()
2835-(* end case *))
2836-fun matchXML_PROCESSING strm = (case (lex(strm))
2837- of (Tok.XML_PROCESSING(x), span, strm') => (x, span, strm')
2838- | _ => fail()
2839-(* end case *))
2840-fun matchENTITY_REF strm = (case (lex(strm))
2841- of (Tok.ENTITY_REF(x), span, strm') => (x, span, strm')
2842- | _ => fail()
2843-(* end case *))
2844-fun matchCHAR_REF strm = (case (lex(strm))
2845- of (Tok.CHAR_REF(x), span, strm') => (x, span, strm')
2846- | _ => fail()
2847-(* end case *))
2848-fun matchDOCTYPE strm = (case (lex(strm))
2849- of (Tok.DOCTYPE(x), span, strm') => (x, span, strm')
2850- | _ => fail()
2851-(* end case *))
2852-fun matchPCDATA strm = (case (lex(strm))
2853- of (Tok.PCDATA(x), span, strm') => (x, span, strm')
2854- | _ => fail()
2855-(* end case *))
2856-fun matchCOMMENT strm = (case (lex(strm))
2857- of (Tok.COMMENT(x), span, strm') => (x, span, strm')
2858- | _ => fail()
2859-(* end case *))
2860-fun matchCLOSETAG strm = (case (lex(strm))
2861- of (Tok.CLOSETAG(x), span, strm') => (x, span, strm')
2862- | _ => fail()
2863-(* end case *))
2864 fun matchOPENTAG strm = (case (lex(strm))
2865 of (Tok.OPENTAG(x), span, strm') => (x, span, strm')
2866 | _ => fail()
2867 (* end case *))
2868+fun matchCLOSETAG strm = (case (lex(strm))
2869+ of (Tok.CLOSETAG(x), span, strm') => (x, span, strm')
2870+ | _ => fail()
2871+(* end case *))
2872+fun matchCOMMENT strm = (case (lex(strm))
2873+ of (Tok.COMMENT(x), span, strm') => (x, span, strm')
2874+ | _ => fail()
2875+(* end case *))
2876+fun matchPCDATA strm = (case (lex(strm))
2877+ of (Tok.PCDATA(x), span, strm') => (x, span, strm')
2878+ | _ => fail()
2879+(* end case *))
2880+fun matchDOCTYPE strm = (case (lex(strm))
2881+ of (Tok.DOCTYPE(x), span, strm') => (x, span, strm')
2882+ | _ => fail()
2883+(* end case *))
2884+fun matchCHAR_REF strm = (case (lex(strm))
2885+ of (Tok.CHAR_REF(x), span, strm') => (x, span, strm')
2886+ | _ => fail()
2887+(* end case *))
2888+fun matchENTITY_REF strm = (case (lex(strm))
2889+ of (Tok.ENTITY_REF(x), span, strm') => (x, span, strm')
2890+ | _ => fail()
2891+(* end case *))
2892+fun matchXML_PROCESSING strm = (case (lex(strm))
2893+ of (Tok.XML_PROCESSING(x), span, strm') => (x, span, strm')
2894+ | _ => fail()
2895+(* end case *))
2896+fun matchSTARTA strm = (case (lex(strm))
2897+ of (Tok.STARTA(x), span, strm') => (x, span, strm')
2898+ | _ => fail()
2899+(* end case *))
2900+fun matchENDA strm = (case (lex(strm))
2901+ of (Tok.ENDA, span, strm') => ((), span, strm')
2902+ | _ => fail()
2903+(* end case *))
2904+fun matchSTARTABBR strm = (case (lex(strm))
2905+ of (Tok.STARTABBR(x), span, strm') => (x, span, strm')
2906+ | _ => fail()
2907+(* end case *))
2908+fun matchENDABBR strm = (case (lex(strm))
2909+ of (Tok.ENDABBR, span, strm') => ((), span, strm')
2910+ | _ => fail()
2911+(* end case *))
2912+fun matchSTARTACRONYM strm = (case (lex(strm))
2913+ of (Tok.STARTACRONYM(x), span, strm') => (x, span, strm')
2914+ | _ => fail()
2915+(* end case *))
2916+fun matchENDACRONYM strm = (case (lex(strm))
2917+ of (Tok.ENDACRONYM, span, strm') => ((), span, strm')
2918+ | _ => fail()
2919+(* end case *))
2920+fun matchSTARTADDRESS strm = (case (lex(strm))
2921+ of (Tok.STARTADDRESS(x), span, strm') => (x, span, strm')
2922+ | _ => fail()
2923+(* end case *))
2924+fun matchENDADDRESS strm = (case (lex(strm))
2925+ of (Tok.ENDADDRESS, span, strm') => ((), span, strm')
2926+ | _ => fail()
2927+(* end case *))
2928+fun matchSTARTAPPLET strm = (case (lex(strm))
2929+ of (Tok.STARTAPPLET(x), span, strm') => (x, span, strm')
2930+ | _ => fail()
2931+(* end case *))
2932+fun matchENDAPPLET strm = (case (lex(strm))
2933+ of (Tok.ENDAPPLET, span, strm') => ((), span, strm')
2934+ | _ => fail()
2935+(* end case *))
2936+fun matchSTARTAREA strm = (case (lex(strm))
2937+ of (Tok.STARTAREA(x), span, strm') => (x, span, strm')
2938+ | _ => fail()
2939+(* end case *))
2940+fun matchSTARTB strm = (case (lex(strm))
2941+ of (Tok.STARTB(x), span, strm') => (x, span, strm')
2942+ | _ => fail()
2943+(* end case *))
2944+fun matchENDB strm = (case (lex(strm))
2945+ of (Tok.ENDB, span, strm') => ((), span, strm')
2946+ | _ => fail()
2947+(* end case *))
2948+fun matchSTARTBASE strm = (case (lex(strm))
2949+ of (Tok.STARTBASE(x), span, strm') => (x, span, strm')
2950+ | _ => fail()
2951+(* end case *))
2952+fun matchSTARTBASEFONT strm = (case (lex(strm))
2953+ of (Tok.STARTBASEFONT(x), span, strm') => (x, span, strm')
2954+ | _ => fail()
2955+(* end case *))
2956+fun matchSTARTBDO strm = (case (lex(strm))
2957+ of (Tok.STARTBDO(x), span, strm') => (x, span, strm')
2958+ | _ => fail()
2959+(* end case *))
2960+fun matchENDBDO strm = (case (lex(strm))
2961+ of (Tok.ENDBDO, span, strm') => ((), span, strm')
2962+ | _ => fail()
2963+(* end case *))
2964+fun matchSTARTBIG strm = (case (lex(strm))
2965+ of (Tok.STARTBIG(x), span, strm') => (x, span, strm')
2966+ | _ => fail()
2967+(* end case *))
2968+fun matchENDBIG strm = (case (lex(strm))
2969+ of (Tok.ENDBIG, span, strm') => ((), span, strm')
2970+ | _ => fail()
2971+(* end case *))
2972+fun matchSTARTBLOCKQUOTE strm = (case (lex(strm))
2973+ of (Tok.STARTBLOCKQUOTE(x), span, strm') => (x, span, strm')
2974+ | _ => fail()
2975+(* end case *))
2976+fun matchENDBLOCKQUOTE strm = (case (lex(strm))
2977+ of (Tok.ENDBLOCKQUOTE, span, strm') => ((), span, strm')
2978+ | _ => fail()
2979+(* end case *))
2980+fun matchSTARTBODY strm = (case (lex(strm))
2981+ of (Tok.STARTBODY(x), span, strm') => (x, span, strm')
2982+ | _ => fail()
2983+(* end case *))
2984+fun matchENDBODY strm = (case (lex(strm))
2985+ of (Tok.ENDBODY, span, strm') => ((), span, strm')
2986+ | _ => fail()
2987+(* end case *))
2988+fun matchSTARTBR strm = (case (lex(strm))
2989+ of (Tok.STARTBR(x), span, strm') => (x, span, strm')
2990+ | _ => fail()
2991+(* end case *))
2992+fun matchSTARTBUTTON strm = (case (lex(strm))
2993+ of (Tok.STARTBUTTON(x), span, strm') => (x, span, strm')
2994+ | _ => fail()
2995+(* end case *))
2996+fun matchENDBUTTON strm = (case (lex(strm))
2997+ of (Tok.ENDBUTTON, span, strm') => ((), span, strm')
2998+ | _ => fail()
2999+(* end case *))
3000+fun matchSTARTCAPTION strm = (case (lex(strm))
3001+ of (Tok.STARTCAPTION(x), span, strm') => (x, span, strm')
3002+ | _ => fail()
3003+(* end case *))
3004+fun matchENDCAPTION strm = (case (lex(strm))
3005+ of (Tok.ENDCAPTION, span, strm') => ((), span, strm')
3006+ | _ => fail()
3007+(* end case *))
3008+fun matchSTARTCENTER strm = (case (lex(strm))
3009+ of (Tok.STARTCENTER(x), span, strm') => (x, span, strm')
3010+ | _ => fail()
3011+(* end case *))
3012+fun matchENDCENTER strm = (case (lex(strm))
3013+ of (Tok.ENDCENTER, span, strm') => ((), span, strm')
3014+ | _ => fail()
3015+(* end case *))
3016+fun matchSTARTCITE strm = (case (lex(strm))
3017+ of (Tok.STARTCITE(x), span, strm') => (x, span, strm')
3018+ | _ => fail()
3019+(* end case *))
3020+fun matchENDCITE strm = (case (lex(strm))
3021+ of (Tok.ENDCITE, span, strm') => ((), span, strm')
3022+ | _ => fail()
3023+(* end case *))
3024+fun matchSTARTCODE strm = (case (lex(strm))
3025+ of (Tok.STARTCODE(x), span, strm') => (x, span, strm')
3026+ | _ => fail()
3027+(* end case *))
3028+fun matchENDCODE strm = (case (lex(strm))
3029+ of (Tok.ENDCODE, span, strm') => ((), span, strm')
3030+ | _ => fail()
3031+(* end case *))
3032+fun matchSTARTCOL strm = (case (lex(strm))
3033+ of (Tok.STARTCOL(x), span, strm') => (x, span, strm')
3034+ | _ => fail()
3035+(* end case *))
3036+fun matchSTARTCOLGROUP strm = (case (lex(strm))
3037+ of (Tok.STARTCOLGROUP(x), span, strm') => (x, span, strm')
3038+ | _ => fail()
3039+(* end case *))
3040+fun matchENDCOLGROUP strm = (case (lex(strm))
3041+ of (Tok.ENDCOLGROUP, span, strm') => ((), span, strm')
3042+ | _ => fail()
3043+(* end case *))
3044+fun matchSTARTDD strm = (case (lex(strm))
3045+ of (Tok.STARTDD(x), span, strm') => (x, span, strm')
3046+ | _ => fail()
3047+(* end case *))
3048+fun matchENDDD strm = (case (lex(strm))
3049+ of (Tok.ENDDD, span, strm') => ((), span, strm')
3050+ | _ => fail()
3051+(* end case *))
3052+fun matchSTARTDEL strm = (case (lex(strm))
3053+ of (Tok.STARTDEL(x), span, strm') => (x, span, strm')
3054+ | _ => fail()
3055+(* end case *))
3056+fun matchENDDEL strm = (case (lex(strm))
3057+ of (Tok.ENDDEL, span, strm') => ((), span, strm')
3058+ | _ => fail()
3059+(* end case *))
3060+fun matchSTARTDFN strm = (case (lex(strm))
3061+ of (Tok.STARTDFN(x), span, strm') => (x, span, strm')
3062+ | _ => fail()
3063+(* end case *))
3064+fun matchENDDFN strm = (case (lex(strm))
3065+ of (Tok.ENDDFN, span, strm') => ((), span, strm')
3066+ | _ => fail()
3067+(* end case *))
3068+fun matchSTARTDIR strm = (case (lex(strm))
3069+ of (Tok.STARTDIR(x), span, strm') => (x, span, strm')
3070+ | _ => fail()
3071+(* end case *))
3072+fun matchENDDIR strm = (case (lex(strm))
3073+ of (Tok.ENDDIR, span, strm') => ((), span, strm')
3074+ | _ => fail()
3075+(* end case *))
3076+fun matchSTARTDIV strm = (case (lex(strm))
3077+ of (Tok.STARTDIV(x), span, strm') => (x, span, strm')
3078+ | _ => fail()
3079+(* end case *))
3080+fun matchENDDIV strm = (case (lex(strm))
3081+ of (Tok.ENDDIV, span, strm') => ((), span, strm')
3082+ | _ => fail()
3083+(* end case *))
3084+fun matchSTARTDL strm = (case (lex(strm))
3085+ of (Tok.STARTDL(x), span, strm') => (x, span, strm')
3086+ | _ => fail()
3087+(* end case *))
3088+fun matchENDDL strm = (case (lex(strm))
3089+ of (Tok.ENDDL, span, strm') => ((), span, strm')
3090+ | _ => fail()
3091+(* end case *))
3092+fun matchSTARTDT strm = (case (lex(strm))
3093+ of (Tok.STARTDT(x), span, strm') => (x, span, strm')
3094+ | _ => fail()
3095+(* end case *))
3096+fun matchENDDT strm = (case (lex(strm))
3097+ of (Tok.ENDDT, span, strm') => ((), span, strm')
3098+ | _ => fail()
3099+(* end case *))
3100+fun matchSTARTEM strm = (case (lex(strm))
3101+ of (Tok.STARTEM(x), span, strm') => (x, span, strm')
3102+ | _ => fail()
3103+(* end case *))
3104+fun matchENDEM strm = (case (lex(strm))
3105+ of (Tok.ENDEM, span, strm') => ((), span, strm')
3106+ | _ => fail()
3107+(* end case *))
3108+fun matchSTARTFIELDSET strm = (case (lex(strm))
3109+ of (Tok.STARTFIELDSET(x), span, strm') => (x, span, strm')
3110+ | _ => fail()
3111+(* end case *))
3112+fun matchENDFIELDSET strm = (case (lex(strm))
3113+ of (Tok.ENDFIELDSET, span, strm') => ((), span, strm')
3114+ | _ => fail()
3115+(* end case *))
3116+fun matchSTARTFONT strm = (case (lex(strm))
3117+ of (Tok.STARTFONT(x), span, strm') => (x, span, strm')
3118+ | _ => fail()
3119+(* end case *))
3120+fun matchENDFONT strm = (case (lex(strm))
3121+ of (Tok.ENDFONT, span, strm') => ((), span, strm')
3122+ | _ => fail()
3123+(* end case *))
3124+fun matchSTARTFORM strm = (case (lex(strm))
3125+ of (Tok.STARTFORM(x), span, strm') => (x, span, strm')
3126+ | _ => fail()
3127+(* end case *))
3128+fun matchENDFORM strm = (case (lex(strm))
3129+ of (Tok.ENDFORM, span, strm') => ((), span, strm')
3130+ | _ => fail()
3131+(* end case *))
3132+fun matchSTARTFRAME strm = (case (lex(strm))
3133+ of (Tok.STARTFRAME(x), span, strm') => (x, span, strm')
3134+ | _ => fail()
3135+(* end case *))
3136+fun matchSTARTFRAMESET strm = (case (lex(strm))
3137+ of (Tok.STARTFRAMESET(x), span, strm') => (x, span, strm')
3138+ | _ => fail()
3139+(* end case *))
3140+fun matchENDFRAMESET strm = (case (lex(strm))
3141+ of (Tok.ENDFRAMESET, span, strm') => ((), span, strm')
3142+ | _ => fail()
3143+(* end case *))
3144+fun matchSTARTH1 strm = (case (lex(strm))
3145+ of (Tok.STARTH1(x), span, strm') => (x, span, strm')
3146+ | _ => fail()
3147+(* end case *))
3148+fun matchENDH1 strm = (case (lex(strm))
3149+ of (Tok.ENDH1, span, strm') => ((), span, strm')
3150+ | _ => fail()
3151+(* end case *))
3152+fun matchSTARTH2 strm = (case (lex(strm))
3153+ of (Tok.STARTH2(x), span, strm') => (x, span, strm')
3154+ | _ => fail()
3155+(* end case *))
3156+fun matchENDH2 strm = (case (lex(strm))
3157+ of (Tok.ENDH2, span, strm') => ((), span, strm')
3158+ | _ => fail()
3159+(* end case *))
3160+fun matchSTARTH3 strm = (case (lex(strm))
3161+ of (Tok.STARTH3(x), span, strm') => (x, span, strm')
3162+ | _ => fail()
3163+(* end case *))
3164+fun matchENDH3 strm = (case (lex(strm))
3165+ of (Tok.ENDH3, span, strm') => ((), span, strm')
3166+ | _ => fail()
3167+(* end case *))
3168+fun matchSTARTH4 strm = (case (lex(strm))
3169+ of (Tok.STARTH4(x), span, strm') => (x, span, strm')
3170+ | _ => fail()
3171+(* end case *))
3172+fun matchENDH4 strm = (case (lex(strm))
3173+ of (Tok.ENDH4, span, strm') => ((), span, strm')
3174+ | _ => fail()
3175+(* end case *))
3176+fun matchSTARTH5 strm = (case (lex(strm))
3177+ of (Tok.STARTH5(x), span, strm') => (x, span, strm')
3178+ | _ => fail()
3179+(* end case *))
3180+fun matchENDH5 strm = (case (lex(strm))
3181+ of (Tok.ENDH5, span, strm') => ((), span, strm')
3182+ | _ => fail()
3183+(* end case *))
3184+fun matchSTARTH6 strm = (case (lex(strm))
3185+ of (Tok.STARTH6(x), span, strm') => (x, span, strm')
3186+ | _ => fail()
3187+(* end case *))
3188+fun matchENDH6 strm = (case (lex(strm))
3189+ of (Tok.ENDH6, span, strm') => ((), span, strm')
3190+ | _ => fail()
3191+(* end case *))
3192+fun matchSTARTHEAD strm = (case (lex(strm))
3193+ of (Tok.STARTHEAD(x), span, strm') => (x, span, strm')
3194+ | _ => fail()
3195+(* end case *))
3196+fun matchENDHEAD strm = (case (lex(strm))
3197+ of (Tok.ENDHEAD, span, strm') => ((), span, strm')
3198+ | _ => fail()
3199+(* end case *))
3200+fun matchSTARTHR strm = (case (lex(strm))
3201+ of (Tok.STARTHR(x), span, strm') => (x, span, strm')
3202+ | _ => fail()
3203+(* end case *))
3204+fun matchSTARTHTML strm = (case (lex(strm))
3205+ of (Tok.STARTHTML(x), span, strm') => (x, span, strm')
3206+ | _ => fail()
3207+(* end case *))
3208+fun matchENDHTML strm = (case (lex(strm))
3209+ of (Tok.ENDHTML, span, strm') => ((), span, strm')
3210+ | _ => fail()
3211+(* end case *))
3212+fun matchSTARTI strm = (case (lex(strm))
3213+ of (Tok.STARTI(x), span, strm') => (x, span, strm')
3214+ | _ => fail()
3215+(* end case *))
3216+fun matchENDI strm = (case (lex(strm))
3217+ of (Tok.ENDI, span, strm') => ((), span, strm')
3218+ | _ => fail()
3219+(* end case *))
3220+fun matchSTARTIFRAME strm = (case (lex(strm))
3221+ of (Tok.STARTIFRAME(x), span, strm') => (x, span, strm')
3222+ | _ => fail()
3223+(* end case *))
3224+fun matchENDIFRAME strm = (case (lex(strm))
3225+ of (Tok.ENDIFRAME, span, strm') => ((), span, strm')
3226+ | _ => fail()
3227+(* end case *))
3228+fun matchSTARTIMG strm = (case (lex(strm))
3229+ of (Tok.STARTIMG(x), span, strm') => (x, span, strm')
3230+ | _ => fail()
3231+(* end case *))
3232+fun matchSTARTINPUT strm = (case (lex(strm))
3233+ of (Tok.STARTINPUT(x), span, strm') => (x, span, strm')
3234+ | _ => fail()
3235+(* end case *))
3236+fun matchSTARTINS strm = (case (lex(strm))
3237+ of (Tok.STARTINS(x), span, strm') => (x, span, strm')
3238+ | _ => fail()
3239+(* end case *))
3240+fun matchENDINS strm = (case (lex(strm))
3241+ of (Tok.ENDINS, span, strm') => ((), span, strm')
3242+ | _ => fail()
3243+(* end case *))
3244+fun matchSTARTISINDEX strm = (case (lex(strm))
3245+ of (Tok.STARTISINDEX(x), span, strm') => (x, span, strm')
3246+ | _ => fail()
3247+(* end case *))
3248+fun matchSTARTKBD strm = (case (lex(strm))
3249+ of (Tok.STARTKBD(x), span, strm') => (x, span, strm')
3250+ | _ => fail()
3251+(* end case *))
3252+fun matchENDKBD strm = (case (lex(strm))
3253+ of (Tok.ENDKBD, span, strm') => ((), span, strm')
3254+ | _ => fail()
3255+(* end case *))
3256+fun matchSTARTLABEL strm = (case (lex(strm))
3257+ of (Tok.STARTLABEL(x), span, strm') => (x, span, strm')
3258+ | _ => fail()
3259+(* end case *))
3260+fun matchENDLABEL strm = (case (lex(strm))
3261+ of (Tok.ENDLABEL, span, strm') => ((), span, strm')
3262+ | _ => fail()
3263+(* end case *))
3264+fun matchSTARTLEGEND strm = (case (lex(strm))
3265+ of (Tok.STARTLEGEND(x), span, strm') => (x, span, strm')
3266+ | _ => fail()
3267+(* end case *))
3268+fun matchENDLEGEND strm = (case (lex(strm))
3269+ of (Tok.ENDLEGEND, span, strm') => ((), span, strm')
3270+ | _ => fail()
3271+(* end case *))
3272+fun matchSTARTLI strm = (case (lex(strm))
3273+ of (Tok.STARTLI(x), span, strm') => (x, span, strm')
3274+ | _ => fail()
3275+(* end case *))
3276+fun matchENDLI strm = (case (lex(strm))
3277+ of (Tok.ENDLI, span, strm') => ((), span, strm')
3278+ | _ => fail()
3279+(* end case *))
3280+fun matchSTARTLINK strm = (case (lex(strm))
3281+ of (Tok.STARTLINK(x), span, strm') => (x, span, strm')
3282+ | _ => fail()
3283+(* end case *))
3284+fun matchSTARTMAP strm = (case (lex(strm))
3285+ of (Tok.STARTMAP(x), span, strm') => (x, span, strm')
3286+ | _ => fail()
3287+(* end case *))
3288+fun matchENDMAP strm = (case (lex(strm))
3289+ of (Tok.ENDMAP, span, strm') => ((), span, strm')
3290+ | _ => fail()
3291+(* end case *))
3292+fun matchSTARTMENU strm = (case (lex(strm))
3293+ of (Tok.STARTMENU(x), span, strm') => (x, span, strm')
3294+ | _ => fail()
3295+(* end case *))
3296+fun matchENDMENU strm = (case (lex(strm))
3297+ of (Tok.ENDMENU, span, strm') => ((), span, strm')
3298+ | _ => fail()
3299+(* end case *))
3300+fun matchSTARTMETA strm = (case (lex(strm))
3301+ of (Tok.STARTMETA(x), span, strm') => (x, span, strm')
3302+ | _ => fail()
3303+(* end case *))
3304+fun matchSTARTNOFRAMES strm = (case (lex(strm))
3305+ of (Tok.STARTNOFRAMES(x), span, strm') => (x, span, strm')
3306+ | _ => fail()
3307+(* end case *))
3308+fun matchENDNOFRAMES strm = (case (lex(strm))
3309+ of (Tok.ENDNOFRAMES, span, strm') => ((), span, strm')
3310+ | _ => fail()
3311+(* end case *))
3312+fun matchSTARTNOSCRIPT strm = (case (lex(strm))
3313+ of (Tok.STARTNOSCRIPT(x), span, strm') => (x, span, strm')
3314+ | _ => fail()
3315+(* end case *))
3316+fun matchENDNOSCRIPT strm = (case (lex(strm))
3317+ of (Tok.ENDNOSCRIPT, span, strm') => ((), span, strm')
3318+ | _ => fail()
3319+(* end case *))
3320+fun matchSTARTOBJECT strm = (case (lex(strm))
3321+ of (Tok.STARTOBJECT(x), span, strm') => (x, span, strm')
3322+ | _ => fail()
3323+(* end case *))
3324+fun matchENDOBJECT strm = (case (lex(strm))
3325+ of (Tok.ENDOBJECT, span, strm') => ((), span, strm')
3326+ | _ => fail()
3327+(* end case *))
3328+fun matchSTARTOL strm = (case (lex(strm))
3329+ of (Tok.STARTOL(x), span, strm') => (x, span, strm')
3330+ | _ => fail()
3331+(* end case *))
3332+fun matchENDOL strm = (case (lex(strm))
3333+ of (Tok.ENDOL, span, strm') => ((), span, strm')
3334+ | _ => fail()
3335+(* end case *))
3336+fun matchSTARTOPTGROUP strm = (case (lex(strm))
3337+ of (Tok.STARTOPTGROUP(x), span, strm') => (x, span, strm')
3338+ | _ => fail()
3339+(* end case *))
3340+fun matchENDOPTGROUP strm = (case (lex(strm))
3341+ of (Tok.ENDOPTGROUP, span, strm') => ((), span, strm')
3342+ | _ => fail()
3343+(* end case *))
3344+fun matchSTARTOPTION strm = (case (lex(strm))
3345+ of (Tok.STARTOPTION(x), span, strm') => (x, span, strm')
3346+ | _ => fail()
3347+(* end case *))
3348+fun matchENDOPTION strm = (case (lex(strm))
3349+ of (Tok.ENDOPTION, span, strm') => ((), span, strm')
3350+ | _ => fail()
3351+(* end case *))
3352+fun matchSTARTP strm = (case (lex(strm))
3353+ of (Tok.STARTP(x), span, strm') => (x, span, strm')
3354+ | _ => fail()
3355+(* end case *))
3356+fun matchENDP strm = (case (lex(strm))
3357+ of (Tok.ENDP, span, strm') => ((), span, strm')
3358+ | _ => fail()
3359+(* end case *))
3360+fun matchSTARTPARAM strm = (case (lex(strm))
3361+ of (Tok.STARTPARAM(x), span, strm') => (x, span, strm')
3362+ | _ => fail()
3363+(* end case *))
3364+fun matchSTARTPRE strm = (case (lex(strm))
3365+ of (Tok.STARTPRE(x), span, strm') => (x, span, strm')
3366+ | _ => fail()
3367+(* end case *))
3368+fun matchENDPRE strm = (case (lex(strm))
3369+ of (Tok.ENDPRE, span, strm') => ((), span, strm')
3370+ | _ => fail()
3371+(* end case *))
3372+fun matchSTARTQ strm = (case (lex(strm))
3373+ of (Tok.STARTQ(x), span, strm') => (x, span, strm')
3374+ | _ => fail()
3375+(* end case *))
3376+fun matchENDQ strm = (case (lex(strm))
3377+ of (Tok.ENDQ, span, strm') => ((), span, strm')
3378+ | _ => fail()
3379+(* end case *))
3380+fun matchSTARTS strm = (case (lex(strm))
3381+ of (Tok.STARTS(x), span, strm') => (x, span, strm')
3382+ | _ => fail()
3383+(* end case *))
3384+fun matchENDS strm = (case (lex(strm))
3385+ of (Tok.ENDS, span, strm') => ((), span, strm')
3386+ | _ => fail()
3387+(* end case *))
3388+fun matchSTARTSAMP strm = (case (lex(strm))
3389+ of (Tok.STARTSAMP(x), span, strm') => (x, span, strm')
3390+ | _ => fail()
3391+(* end case *))
3392+fun matchENDSAMP strm = (case (lex(strm))
3393+ of (Tok.ENDSAMP, span, strm') => ((), span, strm')
3394+ | _ => fail()
3395+(* end case *))
3396+fun matchSTARTSCRIPT strm = (case (lex(strm))
3397+ of (Tok.STARTSCRIPT(x), span, strm') => (x, span, strm')
3398+ | _ => fail()
3399+(* end case *))
3400+fun matchENDSCRIPT strm = (case (lex(strm))
3401+ of (Tok.ENDSCRIPT, span, strm') => ((), span, strm')
3402+ | _ => fail()
3403+(* end case *))
3404+fun matchSTARTSELECT strm = (case (lex(strm))
3405+ of (Tok.STARTSELECT(x), span, strm') => (x, span, strm')
3406+ | _ => fail()
3407+(* end case *))
3408+fun matchENDSELECT strm = (case (lex(strm))
3409+ of (Tok.ENDSELECT, span, strm') => ((), span, strm')
3410+ | _ => fail()
3411+(* end case *))
3412+fun matchSTARTSMALL strm = (case (lex(strm))
3413+ of (Tok.STARTSMALL(x), span, strm') => (x, span, strm')
3414+ | _ => fail()
3415+(* end case *))
3416+fun matchENDSMALL strm = (case (lex(strm))
3417+ of (Tok.ENDSMALL, span, strm') => ((), span, strm')
3418+ | _ => fail()
3419+(* end case *))
3420+fun matchSTARTSPAN strm = (case (lex(strm))
3421+ of (Tok.STARTSPAN(x), span, strm') => (x, span, strm')
3422+ | _ => fail()
3423+(* end case *))
3424+fun matchENDSPAN strm = (case (lex(strm))
3425+ of (Tok.ENDSPAN, span, strm') => ((), span, strm')
3426+ | _ => fail()
3427+(* end case *))
3428+fun matchSTARTSTRIKE strm = (case (lex(strm))
3429+ of (Tok.STARTSTRIKE(x), span, strm') => (x, span, strm')
3430+ | _ => fail()
3431+(* end case *))
3432+fun matchENDSTRIKE strm = (case (lex(strm))
3433+ of (Tok.ENDSTRIKE, span, strm') => ((), span, strm')
3434+ | _ => fail()
3435+(* end case *))
3436+fun matchSTARTSTRONG strm = (case (lex(strm))
3437+ of (Tok.STARTSTRONG(x), span, strm') => (x, span, strm')
3438+ | _ => fail()
3439+(* end case *))
3440+fun matchENDSTRONG strm = (case (lex(strm))
3441+ of (Tok.ENDSTRONG, span, strm') => ((), span, strm')
3442+ | _ => fail()
3443+(* end case *))
3444+fun matchSTARTSTYLE strm = (case (lex(strm))
3445+ of (Tok.STARTSTYLE(x), span, strm') => (x, span, strm')
3446+ | _ => fail()
3447+(* end case *))
3448+fun matchENDSTYLE strm = (case (lex(strm))
3449+ of (Tok.ENDSTYLE, span, strm') => ((), span, strm')
3450+ | _ => fail()
3451+(* end case *))
3452+fun matchSTARTSUB strm = (case (lex(strm))
3453+ of (Tok.STARTSUB(x), span, strm') => (x, span, strm')
3454+ | _ => fail()
3455+(* end case *))
3456+fun matchENDSUB strm = (case (lex(strm))
3457+ of (Tok.ENDSUB, span, strm') => ((), span, strm')
3458+ | _ => fail()
3459+(* end case *))
3460+fun matchSTARTSUP strm = (case (lex(strm))
3461+ of (Tok.STARTSUP(x), span, strm') => (x, span, strm')
3462+ | _ => fail()
3463+(* end case *))
3464+fun matchENDSUP strm = (case (lex(strm))
3465+ of (Tok.ENDSUP, span, strm') => ((), span, strm')
3466+ | _ => fail()
3467+(* end case *))
3468+fun matchSTARTTABLE strm = (case (lex(strm))
3469+ of (Tok.STARTTABLE(x), span, strm') => (x, span, strm')
3470+ | _ => fail()
3471+(* end case *))
3472+fun matchENDTABLE strm = (case (lex(strm))
3473+ of (Tok.ENDTABLE, span, strm') => ((), span, strm')
3474+ | _ => fail()
3475+(* end case *))
3476+fun matchSTARTTBODY strm = (case (lex(strm))
3477+ of (Tok.STARTTBODY(x), span, strm') => (x, span, strm')
3478+ | _ => fail()
3479+(* end case *))
3480+fun matchENDTBODY strm = (case (lex(strm))
3481+ of (Tok.ENDTBODY, span, strm') => ((), span, strm')
3482+ | _ => fail()
3483+(* end case *))
3484+fun matchSTARTTD strm = (case (lex(strm))
3485+ of (Tok.STARTTD(x), span, strm') => (x, span, strm')
3486+ | _ => fail()
3487+(* end case *))
3488+fun matchENDTD strm = (case (lex(strm))
3489+ of (Tok.ENDTD, span, strm') => ((), span, strm')
3490+ | _ => fail()
3491+(* end case *))
3492+fun matchSTARTTEXTAREA strm = (case (lex(strm))
3493+ of (Tok.STARTTEXTAREA(x), span, strm') => (x, span, strm')
3494+ | _ => fail()
3495+(* end case *))
3496+fun matchENDTEXTAREA strm = (case (lex(strm))
3497+ of (Tok.ENDTEXTAREA, span, strm') => ((), span, strm')
3498+ | _ => fail()
3499+(* end case *))
3500+fun matchSTARTTFOOT strm = (case (lex(strm))
3501+ of (Tok.STARTTFOOT(x), span, strm') => (x, span, strm')
3502+ | _ => fail()
3503+(* end case *))
3504+fun matchENDTFOOT strm = (case (lex(strm))
3505+ of (Tok.ENDTFOOT, span, strm') => ((), span, strm')
3506+ | _ => fail()
3507+(* end case *))
3508+fun matchSTARTTH strm = (case (lex(strm))
3509+ of (Tok.STARTTH(x), span, strm') => (x, span, strm')
3510+ | _ => fail()
3511+(* end case *))
3512+fun matchENDTH strm = (case (lex(strm))
3513+ of (Tok.ENDTH, span, strm') => ((), span, strm')
3514+ | _ => fail()
3515+(* end case *))
3516+fun matchSTARTTHEAD strm = (case (lex(strm))
3517+ of (Tok.STARTTHEAD(x), span, strm') => (x, span, strm')
3518+ | _ => fail()
3519+(* end case *))
3520+fun matchENDTHEAD strm = (case (lex(strm))
3521+ of (Tok.ENDTHEAD, span, strm') => ((), span, strm')
3522+ | _ => fail()
3523+(* end case *))
3524+fun matchSTARTTITLE strm = (case (lex(strm))
3525+ of (Tok.STARTTITLE(x), span, strm') => (x, span, strm')
3526+ | _ => fail()
3527+(* end case *))
3528+fun matchENDTITLE strm = (case (lex(strm))
3529+ of (Tok.ENDTITLE, span, strm') => ((), span, strm')
3530+ | _ => fail()
3531+(* end case *))
3532+fun matchSTARTTR strm = (case (lex(strm))
3533+ of (Tok.STARTTR(x), span, strm') => (x, span, strm')
3534+ | _ => fail()
3535+(* end case *))
3536+fun matchENDTR strm = (case (lex(strm))
3537+ of (Tok.ENDTR, span, strm') => ((), span, strm')
3538+ | _ => fail()
3539+(* end case *))
3540+fun matchSTARTTT strm = (case (lex(strm))
3541+ of (Tok.STARTTT(x), span, strm') => (x, span, strm')
3542+ | _ => fail()
3543+(* end case *))
3544+fun matchENDTT strm = (case (lex(strm))
3545+ of (Tok.ENDTT, span, strm') => ((), span, strm')
3546+ | _ => fail()
3547+(* end case *))
3548+fun matchSTARTU strm = (case (lex(strm))
3549+ of (Tok.STARTU(x), span, strm') => (x, span, strm')
3550+ | _ => fail()
3551+(* end case *))
3552+fun matchENDU strm = (case (lex(strm))
3553+ of (Tok.ENDU, span, strm') => ((), span, strm')
3554+ | _ => fail()
3555+(* end case *))
3556+fun matchSTARTUL strm = (case (lex(strm))
3557+ of (Tok.STARTUL(x), span, strm') => (x, span, strm')
3558+ | _ => fail()
3559+(* end case *))
3560+fun matchENDUL strm = (case (lex(strm))
3561+ of (Tok.ENDUL, span, strm') => ((), span, strm')
3562+ | _ => fail()
3563+(* end case *))
3564+fun matchSTARTVAR strm = (case (lex(strm))
3565+ of (Tok.STARTVAR(x), span, strm') => (x, span, strm')
3566+ | _ => fail()
3567+(* end case *))
3568+fun matchENDVAR strm = (case (lex(strm))
3569+ of (Tok.ENDVAR, span, strm') => ((), span, strm')
3570+ | _ => fail()
3571+(* end case *))
3572+fun matchEOF strm = (case (lex(strm))
3573+ of (Tok.EOF, span, strm') => ((), span, strm')
3574+ | _ => fail()
3575+(* end case *))
3576
3577 val (document_NT, body_NT, flow_NT, block_NT, inline_NT, cdata_opt_NT) =
3578 let
3579diff --git a/HTML4/pp-init.sml b/HTML4/pp-init.sml
3580new file mode 100644
3581index 0000000..ca97b62
3582--- /dev/null
3583+++ b/HTML4/pp-init.sml
3584@@ -0,0 +1,67 @@
3585+ (* pp-init.sml
3586+ *
3587+ * COPYRIGHT (c) 2003 The SML/NJ Fellowship
3588+ *
3589+ * An implementation of SML/NJ's PP interface.
3590+ * - This is an (almost) literal copy of the original code in
3591+ * smlnj-lib/PP/examples/old-pp.sml
3592+ *)
3593+
3594+
3595+signature PRETTYPRINT =
3596+sig
3597+ include PP_STREAM
3598+ val with_pp : device -> (stream -> unit) -> unit
3599+ val pp_to_string : int -> (stream -> 'a -> unit) -> 'a -> string
3600+end
3601+
3602+structure PrettyPrint : PRETTYPRINT =
3603+struct
3604+
3605+ type ppconsumer = {
3606+ consumer : string -> unit,
3607+ linewidth : int,
3608+ flush : unit -> unit
3609+ }
3610+
3611+ structure Dev =
3612+ struct
3613+ type device = ppconsumer
3614+ type style = unit
3615+ fun sameStyle _ = true
3616+ fun pushStyle _ = ()
3617+ fun popStyle _ = ()
3618+ fun defaultStyle _ = ()
3619+ fun depth _ = NONE
3620+ fun lineWidth {consumer, linewidth, flush} = SOME linewidth
3621+ fun textWidth _ = NONE
3622+ fun space ({consumer, linewidth, flush}, n) =
3623+ consumer (StringCvt.padLeft #" " n "")
3624+ fun newline {consumer, linewidth, flush} = consumer "\n"
3625+ fun string ({consumer, linewidth, flush}, s) = consumer s
3626+ fun char ({consumer, linewidth, flush}, c) = consumer(str c)
3627+ fun flush {consumer, linewidth, flush} = flush()
3628+ end
3629+
3630+ structure PP = PPStreamFn
3631+ (structure Token = StringToken
3632+ structure Device = Dev)
3633+
3634+ open PP
3635+
3636+ fun with_pp device (f: PP.stream -> unit) =
3637+ let val ppstrm = PP.openStream device
3638+ in f ppstrm;
3639+ PP.closeStream ppstrm
3640+ end
3641+
3642+ fun pp_to_string wid ppFn obj =
3643+ let val l = ref ([] : string list)
3644+ fun attach s = l := s :: !l
3645+ val device = {consumer = attach, linewidth = wid, flush = fn()=>()}
3646+ in with_pp device
3647+ (fn ppStrm => ppFn ppStrm obj);
3648+ String.concat(List.rev(!l))
3649+ end
3650+
3651+end (* structure PrettyPrint *)
3652diff --git a/HashCons/hash-cons-lib.mlb b/HashCons/hash-cons-lib.mlb
3653new file mode 100644
3654index 0000000..d7d2a24
3655--- /dev/null
3656+++ b/HashCons/hash-cons-lib.mlb
3657@@ -0,0 +1,145 @@
3658+
3659+ann
3660+ "nonexhaustiveBind warn" "nonexhaustiveMatch warn"
3661+ "redundantBind warn" "redundantMatch warn"
3662+ "sequenceNonUnit ignore"
3663+ "warnUnused false" "forceUsed"
3664+in
3665+
3666+local
3667+ basis l8 =
3668+ bas
3669+ (* $/basis.cm ====> *) $(SML_LIB)/basis/basis.mlb
3670+ end
3671+ basis l4 =
3672+ bas
3673+ (* $/smlnj-lib.cm ====> *) $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
3674+ end
3675+in
3676+local
3677+ $(SML_LIB)/basis/pervasive.mlb
3678+ local
3679+ open l4
3680+ in
3681+ structure gs_0 = PrimeSizes
3682+ end
3683+ local
3684+ open l8
3685+ in
3686+ structure gs_1 = Array
3687+ end
3688+ local
3689+ open l8
3690+ in
3691+ structure gs_2 = Word
3692+ end
3693+ local
3694+ open l8
3695+ in
3696+ structure gs_3 = List
3697+ end
3698+ local
3699+ hash-cons-sig.sml
3700+ in
3701+ signature gs_4 = HASH_CONS
3702+ end
3703+ local
3704+ structure Array = gs_1
3705+ signature HASH_CONS = gs_4
3706+ structure List = gs_3
3707+ structure PrimeSizes = gs_0
3708+ structure Word = gs_2
3709+ hash-cons.sml
3710+ in
3711+ structure gs_5 = HashCons
3712+ end
3713+ local
3714+ structure HashCons = gs_5
3715+ hash-cons-set-sig.sml
3716+ in
3717+ signature gs_6 = HASH_CONS_SET
3718+ end
3719+ local
3720+ structure HashCons = gs_5
3721+ hash-cons-map-sig.sml
3722+ in
3723+ signature gs_7 = HASH_CONS_MAP
3724+ end
3725+ local
3726+ open l4
3727+ in
3728+ structure gs_8 = WordRedBlackMap
3729+ end
3730+ local
3731+ signature HASH_CONS_SET = gs_6
3732+ structure HashCons = gs_5
3733+ structure List = gs_3
3734+ structure WordRedBlackMap = gs_8
3735+ hash-cons-set.sml
3736+ in
3737+ structure gs_9 = HashConsSet
3738+ end
3739+ local
3740+ open l8
3741+ in
3742+ structure gs_10 = Option
3743+ end
3744+ local
3745+ signature HASH_CONS_MAP = gs_7
3746+ structure HashCons = gs_5
3747+ structure Option = gs_10
3748+ structure WordRedBlackMap = gs_8
3749+ hash-cons-map.sml
3750+ in
3751+ structure gs_11 = HashConsMap
3752+ end
3753+ local
3754+ open l4
3755+ in
3756+ structure gs_12 = HashString
3757+ end
3758+ local
3759+ open l4
3760+ in
3761+ signature gs_13 = HASH_KEY
3762+ end
3763+ local
3764+ signature HASH_KEY = gs_13
3765+ structure HashCons = gs_5
3766+ hash-cons-ground-fn.sml
3767+ in
3768+ functor gs_14 = HashConsGroundFn
3769+ end
3770+ local
3771+ functor HashConsGroundFn = gs_14
3772+ structure HashString = gs_12
3773+ hash-cons-string.sml
3774+ in
3775+ structure gs_15 = HashConsString
3776+ end
3777+ local
3778+ open l4
3779+ in
3780+ structure gs_16 = Atom
3781+ end
3782+ local
3783+ structure Atom = gs_16
3784+ functor HashConsGroundFn = gs_14
3785+ hash-cons-atom.sml
3786+ in
3787+ structure gs_17 = HashConsAtom
3788+ end
3789+in
3790+ signature HASH_CONS = gs_4
3791+ signature HASH_CONS_MAP = gs_7
3792+ signature HASH_CONS_SET = gs_6
3793+ structure HashCons = gs_5
3794+ structure HashConsAtom = gs_17
3795+ functor HashConsGroundFn = gs_14
3796+ structure HashConsMap = gs_11
3797+ structure HashConsSet = gs_9
3798+ structure HashConsString = gs_15
3799+end
3800+end
3801+
3802+end
3803diff --git a/INet/inet-lib.mlb b/INet/inet-lib.mlb
3804new file mode 100644
3805index 0000000..8e91bef
3806--- /dev/null
3807+++ b/INet/inet-lib.mlb
3808@@ -0,0 +1,145 @@
3809+
3810+ann
3811+ "nonexhaustiveBind warn" "nonexhaustiveMatch warn"
3812+ "redundantBind warn" "redundantMatch warn"
3813+ "sequenceNonUnit ignore"
3814+ "warnUnused false" "forceUsed"
3815+in
3816+
3817+local
3818+ basis l4 =
3819+ bas
3820+ (* $/basis.cm ====> *) $(SML_LIB)/basis/basis.mlb
3821+ end
3822+ basis l31 =
3823+ bas
3824+ (* $/smlnj-lib.cm ====> *) $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
3825+ end
3826+in
3827+local
3828+ $(SML_LIB)/basis/pervasive.mlb
3829+ local
3830+ open l4
3831+ in
3832+ structure gs_0 = StringCvt
3833+ end
3834+ local
3835+ open l4
3836+ in
3837+ structure gs_1 = Word8Array
3838+ end
3839+ local
3840+ open l4
3841+ in
3842+ structure gs_2 = Word8Vector
3843+ end
3844+ local
3845+ open l4
3846+ in
3847+ structure gs_3 = NetHostDB
3848+ end
3849+ local
3850+ open l4
3851+ in
3852+ structure gs_4 = Socket
3853+ end
3854+ local
3855+ open l4
3856+ in
3857+ structure gs_5 = INetSock
3858+ end
3859+ local
3860+ structure INetSock = gs_5
3861+ structure NetHostDB = gs_3
3862+ structure Socket = gs_4
3863+ structure StringCvt = gs_0
3864+ structure Word8Array = gs_1
3865+ structure Word8Vector = gs_2
3866+ sock-util-sig.sml
3867+ in
3868+ signature gs_6 = SOCK_UTIL
3869+ end
3870+ local
3871+ open l4
3872+ in
3873+ structure gs_7 = UnixSock
3874+ end
3875+ local
3876+ open l31
3877+ in
3878+ structure gs_8 = ParserComb
3879+ end
3880+ local
3881+ open l4
3882+ in
3883+ structure gs_9 = Char
3884+ end
3885+ local
3886+ open l4
3887+ in
3888+ structure gs_10 = Word8VectorSlice
3889+ end
3890+ local
3891+ open l4
3892+ in
3893+ structure gs_11 = Word8ArraySlice
3894+ end
3895+ local
3896+ open l4
3897+ in
3898+ structure gs_12 = NetServDB
3899+ end
3900+ local
3901+ open l4
3902+ in
3903+ structure gs_13 = Byte
3904+ end
3905+ local
3906+ open l4
3907+ in
3908+ structure gs_14 = Int
3909+ end
3910+ local
3911+ open l4
3912+ in
3913+ structure gs_15 = OS
3914+ end
3915+ local
3916+ structure Byte = gs_13
3917+ structure Char = gs_9
3918+ structure INetSock = gs_5
3919+ structure Int = gs_14
3920+ structure NetHostDB = gs_3
3921+ structure NetServDB = gs_12
3922+ structure OS = gs_15
3923+ structure ParserComb = gs_8
3924+ signature SOCK_UTIL = gs_6
3925+ structure Socket = gs_4
3926+ structure StringCvt = gs_0
3927+ structure Word8Array = gs_1
3928+ structure Word8ArraySlice = gs_11
3929+ structure Word8Vector = gs_2
3930+ structure Word8VectorSlice = gs_10
3931+ sock-util.sml
3932+ in
3933+ structure gs_16 = SockUtil
3934+ end
3935+ local
3936+ signature SOCK_UTIL = gs_6
3937+ structure SockUtil = gs_16
3938+ structure Socket = gs_4
3939+ structure UnixSock = gs_7
3940+ unix-sock-util.sml
3941+ in
3942+ signature gs_17 = UNIX_SOCK_UTIL
3943+ structure gs_18 = UnixSockUtil
3944+ end
3945+in
3946+ signature SOCK_UTIL = gs_6
3947+ structure SockUtil = gs_16
3948+ signature UNIX_SOCK_UTIL = gs_17
3949+ structure UnixSockUtil = gs_18
3950+end
3951+end
3952+
3953+end
3954diff --git a/JSON/json-lib.mlb b/JSON/json-lib.mlb
3955index ff960d3..cda206f 100644
3956--- a/JSON/json-lib.mlb
3957+++ b/JSON/json-lib.mlb
3958@@ -1,47 +1,203 @@
3959-(* json-lib.mlb
3960- *
3961- * COPYRIGHT (c) 2008 The Fellowship of SML/NJ (http://www.smlnj.org)
3962- * All rights reserved.
3963- *
3964- * An MLB file for the JSON library, so that it can be used by MLton programs.
3965- *
3966- * TODO:
3967- * This is not complete, since MLton does not have the ml-lpt-lib yet.
3968- *)
3969-
3970-local
3971-
3972- $(SML_LIB)/basis/basis.mlb
3973- $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
3974- $(SML_LIB)/mllpt-lib/ml-lpt-lib.mlb
3975-
3976- ann
3977- "nonexhaustiveMatch warn" "redundantMatch warn"
3978- "sequenceNonUnit ignore"
3979- "warnUnused false" "forceUsed"
3980- in
3981-
3982- json-tokens.sml
3983- json.lex.sml
3984- json.sml
3985- json-stream-parser.sml
3986- json-parser.sml
3987- json-stream-printer.sml
3988- json-printer.sml
3989- json-util.sml
3990-
3991- end
3992
3993+ann
3994+ "nonexhaustiveBind ignore" "nonexhaustiveMatch warn"
3995+ "redundantBind warn" "redundantMatch warn"
3996+ "sequenceNonUnit ignore"
3997+ "warnUnused false" "forceUsed"
3998 in
3999
4000-(* DOM-style API (tree based) *)
4001- structure JSON
4002- structure JSONParser
4003- structure JSONPrinter
4004- structure JSONUtil
4005-
4006-(* SAX-style API (event based) *)
4007- structure JSONStreamParser
4008- structure JSONStreamPrinter
4009+local
4010+ basis l4 =
4011+ bas
4012+ (* $/basis.cm ====> *) $(SML_LIB)/basis/basis.mlb
4013+ end
4014+ basis l75 =
4015+ bas
4016+ (* $/smlnj-lib.cm ====> *) $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
4017+ end
4018+ basis l8 =
4019+ bas
4020+ (* $/ml-lpt-lib.cm ====> *) $(SML_LIB)/mllpt-lib/mllpt-lib.mlb
4021+ end
4022+in
4023+local
4024+ $(SML_LIB)/basis/pervasive.mlb
4025+ local
4026+ open l4
4027+ in
4028+ structure gs_0 = IntInf
4029+ end
4030+ local
4031+ open l8
4032+ in
4033+ structure gs_1 = AntlrStreamPos
4034+ end
4035+ local
4036+ open l4
4037+ in
4038+ structure gs_2 = TextIO
4039+ end
4040+ local
4041+ open l4
4042+ in
4043+ structure gs_3 = String
4044+ end
4045+ local
4046+ open l8
4047+ in
4048+ structure gs_4 = UTF8
4049+ end
4050+ local
4051+ open l4
4052+ in
4053+ structure gs_5 = Real
4054+ end
4055+ local
4056+ open l4
4057+ in
4058+ structure gs_6 = List
4059+ end
4060+ local
4061+ structure IntInf = gs_0
4062+ structure List = gs_6
4063+ structure Real = gs_5
4064+ structure String = gs_3
4065+ structure UTF8 = gs_4
4066+ json-tokens.sml
4067+ in
4068+ structure gs_7 = JSONTokens
4069+ end
4070+ local
4071+ open l4
4072+ in
4073+ structure gs_8 = StringCvt
4074+ end
4075+ local
4076+ open l4
4077+ in
4078+ structure gs_9 = LargeReal
4079+ end
4080+ local
4081+ open l4
4082+ in
4083+ structure gs_10 = Substring
4084+ end
4085+ local
4086+ open l4
4087+ in
4088+ structure gs_11 = Vector
4089+ end
4090+ local
4091+ open l8
4092+ in
4093+ structure gs_12 = ULexBuffer
4094+ end
4095+ local
4096+ open l4
4097+ in
4098+ structure gs_13 = Word
4099+ end
4100+ local
4101+ structure AntlrStreamPos = gs_1
4102+ structure IntInf = gs_0
4103+ structure JSONTokens = gs_7
4104+ structure LargeReal = gs_9
4105+ structure List = gs_6
4106+ structure String = gs_3
4107+ structure StringCvt = gs_8
4108+ structure Substring = gs_10
4109+ structure TextIO = gs_2
4110+ structure ULexBuffer = gs_12
4111+ structure UTF8 = gs_4
4112+ structure Vector = gs_11
4113+ structure Word = gs_13
4114+ json.lex.sml
4115+ in
4116+ structure gs_14 = JSONLexer
4117+ end
4118+ local
4119+ structure AntlrStreamPos = gs_1
4120+ structure IntInf = gs_0
4121+ structure JSONLexer = gs_14
4122+ structure JSONTokens = gs_7
4123+ structure TextIO = gs_2
4124+ json-stream-parser.sml
4125+ in
4126+ structure gs_15 = JSONStreamParser
4127+ end
4128+ local
4129+ structure IntInf = gs_0
4130+ json.sml
4131+ in
4132+ structure gs_16 = JSON
4133+ end
4134+ local
4135+ structure AntlrStreamPos = gs_1
4136+ structure JSON = gs_16
4137+ structure JSONLexer = gs_14
4138+ structure JSONTokens = gs_7
4139+ structure List = gs_6
4140+ structure TextIO = gs_2
4141+ json-parser.sml
4142+ in
4143+ structure gs_17 = JSONParser
4144+ end
4145+ local
4146+ open l4
4147+ in
4148+ structure gs_18 = General
4149+ end
4150+ local
4151+ open l4
4152+ in
4153+ structure gs_19 = Int
4154+ end
4155+ local
4156+ structure General = gs_18
4157+ structure Int = gs_19
4158+ structure IntInf = gs_0
4159+ structure JSON = gs_16
4160+ structure List = gs_6
4161+ structure Real = gs_5
4162+ structure String = gs_3
4163+ structure Vector = gs_11
4164+ json-util.sml
4165+ in
4166+ structure gs_20 = JSONUtil
4167+ end
4168+ local
4169+ open l75
4170+ in
4171+ structure gs_21 = Format
4172+ end
4173+ local
4174+ structure Format = gs_21
4175+ structure IntInf = gs_0
4176+ structure List = gs_6
4177+ structure String = gs_3
4178+ structure TextIO = gs_2
4179+ structure UTF8 = gs_4
4180+ json-stream-printer.sml
4181+ in
4182+ structure gs_22 = JSONStreamPrinter
4183+ end
4184+ local
4185+ structure JSON = gs_16
4186+ structure JSONStreamPrinter = gs_22
4187+ structure List = gs_6
4188+ structure TextIO = gs_2
4189+ json-printer.sml
4190+ in
4191+ structure gs_23 = JSONPrinter
4192+ end
4193+in
4194+ structure JSON = gs_16
4195+ structure JSONParser = gs_17
4196+ structure JSONPrinter = gs_23
4197+ structure JSONStreamParser = gs_15
4198+ structure JSONStreamPrinter = gs_22
4199+ structure JSONUtil = gs_20
4200+end
4201+end
4202
4203 end
4204diff --git a/JSON/json.lex.sml b/JSON/json.lex.sml
4205index 87e5f17..d488353 100644
4206--- a/JSON/json.lex.sml
4207+++ b/JSON/json.lex.sml
4208@@ -2,6 +2,8 @@ structure JSONLexer = struct
4209
4210 datatype yystart_state =
4211 S | INITIAL
4212+ local
4213+
4214 structure UserDeclarations =
4215 struct
4216
4217@@ -23,10 +25,8 @@ S | INITIAL
4218 end
4219 fun finishString () = (T.STRING(String.concat(List.rev(!sbuf))) before sbuf := [])
4220
4221-
4222 end
4223
4224- local
4225 datatype yymatch
4226 = yyNO_MATCH
4227 | yyMATCH of ULexBuffer.stream * action * yymatch
4228@@ -70,7 +70,7 @@ Vector.fromList []
4229 (* start position of token -- can be updated via skip() *)
4230 val yystartPos = ref (yygetPos())
4231 (* get one char of input *)
4232- fun yygetc strm = (case UTF8.getu ULexBuffer.getc strm
4233+ fun yygetc strm = (case ULexBuffer.getu strm
4234 of (SOME (0w10, s')) =>
4235 (AntlrStreamPos.markNewLine yysm (ULexBuffer.getpos strm);
4236 SOME (0w10, s'))
4237@@ -104,7 +104,7 @@ Vector.fromList []
4238 (fn (~1, _, oldMatches) => yystuck oldMatches
4239 | (curState, strm, oldMatches) => let
4240 val (transitions, finals') = Vector.sub (yytable, curState)
4241- val finals = map (fn i => Vector.sub (actTable, i)) finals'
4242+ val finals = List.map (fn i => Vector.sub (actTable, i)) finals'
4243 fun tryfinal() =
4244 yystuck (yyactsToMatches (strm, finals, oldMatches))
4245 fun find (c, []) = NONE
4246diff --git a/PP/pp-lib.mlb b/PP/pp-lib.mlb
4247new file mode 100644
4248index 0000000..6619100
4249--- /dev/null
4250+++ b/PP/pp-lib.mlb
4251@@ -0,0 +1,213 @@
4252+
4253+ann
4254+ "nonexhaustiveBind warn" "nonexhaustiveMatch warn"
4255+ "redundantBind warn" "redundantMatch warn"
4256+ "sequenceNonUnit ignore"
4257+ "warnUnused false" "forceUsed"
4258+in
4259+
4260+local
4261+ basis l4 =
4262+ bas
4263+ (* $/basis.cm ====> *) $(SML_LIB)/basis/basis.mlb
4264+ end
4265+ basis l26 =
4266+ bas
4267+ (* $/smlnj-lib.cm ====> *) $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
4268+ end
4269+ basis l83 =
4270+ bas
4271+ (* $/html-lib.cm ====> *) $(SML_LIB)/smlnj-lib/HTML/html-lib.mlb
4272+ end
4273+in
4274+local
4275+ $(SML_LIB)/basis/pervasive.mlb
4276+ local
4277+ open l4
4278+ in
4279+ structure gs_0 = TextIO
4280+ end
4281+ local
4282+ src/pp-stream-sig.sml
4283+ in
4284+ signature gs_1 = PP_STREAM
4285+ end
4286+ local
4287+ signature PP_STREAM = gs_1
4288+ structure TextIO = gs_0
4289+ src/pp-debug-fn.sml
4290+ in
4291+ functor gs_2 = PPDebugFn
4292+ end
4293+ local
4294+ src/pp-device-sig.sml
4295+ in
4296+ signature gs_3 = PP_DEVICE
4297+ end
4298+ local
4299+ open l4
4300+ in
4301+ structure gs_4 = StringCvt
4302+ end
4303+ local
4304+ signature PP_DEVICE = gs_3
4305+ structure StringCvt = gs_4
4306+ structure TextIO = gs_0
4307+ devices/simple-textio-dev.sml
4308+ in
4309+ structure gs_5 = SimpleTextIODev
4310+ end
4311+ local
4312+ open l26
4313+ in
4314+ structure gs_6 = Format
4315+ end
4316+ local
4317+ open l26
4318+ in
4319+ structure gs_7 = Queue
4320+ end
4321+ local
4322+ open l26
4323+ in
4324+ structure gs_8 = ListFormat
4325+ end
4326+ local
4327+ open l4
4328+ in
4329+ structure gs_9 = String
4330+ end
4331+ local
4332+ open l4
4333+ in
4334+ structure gs_10 = Option
4335+ end
4336+ local
4337+ open l4
4338+ in
4339+ structure gs_11 = Int
4340+ end
4341+ local
4342+ src/pp-token-sig.sml
4343+ in
4344+ signature gs_12 = PP_TOKEN
4345+ end
4346+ local
4347+ structure Format = gs_6
4348+ structure Int = gs_11
4349+ structure ListFormat = gs_8
4350+ structure Option = gs_10
4351+ signature PP_DEVICE = gs_3
4352+ signature PP_STREAM = gs_1
4353+ signature PP_TOKEN = gs_12
4354+ structure Queue = gs_7
4355+ structure String = gs_9
4356+ structure TextIO = gs_0
4357+ src/pp-stream-fn.sml
4358+ in
4359+ functor gs_13 = PPStreamFn
4360+ end
4361+ local
4362+ signature PP_STREAM = gs_1
4363+ src/pp-desc-sig.sml
4364+ in
4365+ signature gs_14 = PP_DESC
4366+ end
4367+ local
4368+ signature PP_DESC = gs_14
4369+ signature PP_STREAM = gs_1
4370+ src/pp-desc-fn.sml
4371+ in
4372+ functor gs_15 = PPDescFn
4373+ end
4374+ local
4375+ signature PP_TOKEN = gs_12
4376+ structure String = gs_9
4377+ devices/string-token.sml
4378+ in
4379+ structure gs_16 = StringToken
4380+ end
4381+ local
4382+ functor PPStreamFn = gs_13
4383+ signature PP_STREAM = gs_1
4384+ structure SimpleTextIODev = gs_5
4385+ structure StringToken = gs_16
4386+ structure TextIO = gs_0
4387+ devices/textio-pp.sml
4388+ in
4389+ structure gs_17 = TextIOPP
4390+ end
4391+ local
4392+ open l26
4393+ in
4394+ structure gs_18 = ANSITerm
4395+ end
4396+ local
4397+ open l4
4398+ in
4399+ structure gs_19 = TextPrimIO
4400+ end
4401+ local
4402+ open l4
4403+ in
4404+ structure gs_20 = OS
4405+ end
4406+ local
4407+ structure ANSITerm = gs_18
4408+ structure OS = gs_20
4409+ signature PP_DEVICE = gs_3
4410+ structure StringCvt = gs_4
4411+ structure TextIO = gs_0
4412+ structure TextPrimIO = gs_19
4413+ devices/ansi-term-dev.sml
4414+ in
4415+ structure gs_21 = ANSITermDev
4416+ end
4417+ local
4418+ open l4
4419+ in
4420+ structure gs_22 = List
4421+ end
4422+ local
4423+ open l83
4424+ in
4425+ structure gs_23 = HTML
4426+ end
4427+ local
4428+ structure HTML = gs_23
4429+ structure List = gs_22
4430+ signature PP_DEVICE = gs_3
4431+ structure String = gs_9
4432+ devices/html-dev.sml
4433+ in
4434+ structure gs_24 = HTMLDev
4435+ end
4436+ local
4437+ structure ANSITermDev = gs_21
4438+ functor PPStreamFn = gs_13
4439+ signature PP_STREAM = gs_1
4440+ signature PP_TOKEN = gs_12
4441+ structure String = gs_9
4442+ structure TextIO = gs_0
4443+ devices/ansi-term-pp.sml
4444+ in
4445+ structure gs_25 = ANSITermPP
4446+ end
4447+in
4448+ structure ANSITermDev = gs_21
4449+ structure ANSITermPP = gs_25
4450+ structure HTMLDev = gs_24
4451+ functor PPDebugFn = gs_2
4452+ functor PPDescFn = gs_15
4453+ functor PPStreamFn = gs_13
4454+ signature PP_DESC = gs_14
4455+ signature PP_DEVICE = gs_3
4456+ signature PP_STREAM = gs_1
4457+ signature PP_TOKEN = gs_12
4458+ structure SimpleTextIODev = gs_5
4459+ structure StringToken = gs_16
4460+ structure TextIOPP = gs_17
4461+end
4462+end
4463+
4464+end
4465diff --git a/README.mlton b/README.mlton
4466new file mode 100644
4467index 0000000..96eeebc
4468--- /dev/null
4469+++ b/README.mlton
4470@@ -0,0 +1,11 @@
4471+The following changes were made to the SML/NJ Library, in addition to
4472+deriving the `.mlb` files from the `.cm` files:
4473+
4474+* `HTML4/pp-init.sml` (added): Implements `structure PrettyPrint` using the SML/NJ PP Library. This implementation is taken from the SML/NJ compiler source, since the SML/NJ HTML4 Library used the `structure PrettyPrint` provided by the SML/NJ compiler itself.
4475+* `Util/base64.sml` (modified): Rewrote use of `Unsafe.CharVector.create` and `Unsafe.CharVector.update`; MLton assumes that vectors are immutable.
4476+* `Util/engine.mlton.sml` (added, not exported): Implements `structure Engine`, providing time-limited, resumable computations using <:MLtonThread:>, <:MLtonSignal:>, and <:MLtonItimer:>.
4477+* `Util/graph-scc-fn.sml` (modified): Rewrote use of `where` structure specification.
4478+* `Util/redblack-map-fn.sml` (modified): Rewrote use of `where` structure specification.
4479+* `Util/redblack-set-fn.sml` (modified): Rewrote use of `where` structure specification.
4480+* `Util/time-limit.mlb` (added): Exports `structure TimeLimit`, which is _not_ exported by `smlnj-lib.mlb`. Since MLton is very conservative in the presence of threads and signals, program performance may be adversely affected by unnecessarily including `structure TimeLimit`.
4481+* `Util/time-limit.mlton.sml` (added): Implements `structure TimeLimit` using `structure Engine`. The SML/NJ implementation of `structure TimeLimit` uses SML/NJ's first-class continuations, signals, and interval timer.
4482diff --git a/Reactive/reactive-lib.mlb b/Reactive/reactive-lib.mlb
4483new file mode 100644
4484index 0000000..ceb3bff
4485--- /dev/null
4486+++ b/Reactive/reactive-lib.mlb
4487@@ -0,0 +1,72 @@
4488+
4489+ann
4490+ "nonexhaustiveBind warn" "nonexhaustiveMatch warn"
4491+ "redundantBind warn" "redundantMatch warn"
4492+ "sequenceNonUnit ignore"
4493+ "warnUnused false" "forceUsed"
4494+in
4495+
4496+local
4497+ basis l14 =
4498+ bas
4499+ (* $/basis.cm ====> *) $(SML_LIB)/basis/basis.mlb
4500+ end
4501+ basis l4 =
4502+ bas
4503+ (* $/smlnj-lib.cm ====> *) $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
4504+ end
4505+in
4506+local
4507+ $(SML_LIB)/basis/pervasive.mlb
4508+ local
4509+ open l4
4510+ in
4511+ structure gs_0 = Atom
4512+ end
4513+ local
4514+ structure Atom = gs_0
4515+ reactive-sig.sml
4516+ in
4517+ signature gs_1 = REACTIVE
4518+ end
4519+ local
4520+ open l4
4521+ in
4522+ structure gs_2 = AtomBinaryMap
4523+ end
4524+ local
4525+ open l14
4526+ in
4527+ structure gs_3 = List
4528+ end
4529+ local
4530+ structure Atom = gs_0
4531+ instruction.sml
4532+ in
4533+ structure gs_4 = Instruction
4534+ end
4535+ local
4536+ structure Atom = gs_0
4537+ structure Instruction = gs_4
4538+ structure List = gs_3
4539+ machine.sml
4540+ in
4541+ structure gs_5 = Machine
4542+ end
4543+ local
4544+ structure AtomBinaryMap = gs_2
4545+ structure Instruction = gs_4
4546+ structure List = gs_3
4547+ structure Machine = gs_5
4548+ signature REACTIVE = gs_1
4549+ reactive.sml
4550+ in
4551+ structure gs_6 = Reactive
4552+ end
4553+in
4554+ signature REACTIVE = gs_1
4555+ structure Reactive = gs_6
4556+end
4557+end
4558+
4559+end
4560diff --git a/RegExp/regexp-lib.mlb b/RegExp/regexp-lib.mlb
4561new file mode 100644
4562index 0000000..3c701d6
4563--- /dev/null
4564+++ b/RegExp/regexp-lib.mlb
4565@@ -0,0 +1,236 @@
4566+
4567+ann
4568+ "nonexhaustiveBind ignore" "nonexhaustiveMatch ignore"
4569+ "redundantBind warn" "redundantMatch warn"
4570+ "sequenceNonUnit ignore"
4571+ "warnUnused false" "forceUsed"
4572+in
4573+
4574+local
4575+ basis l4 =
4576+ bas
4577+ (* $/basis.cm ====> *) $(SML_LIB)/basis/basis.mlb
4578+ end
4579+ basis l16 =
4580+ bas
4581+ (* $/smlnj-lib.cm ====> *) $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
4582+ end
4583+in
4584+local
4585+ $(SML_LIB)/basis/pervasive.mlb
4586+ local
4587+ open l4
4588+ in
4589+ structure gs_0 = StringCvt
4590+ end
4591+ local
4592+ open l4
4593+ in
4594+ structure gs_1 = List
4595+ end
4596+ local
4597+ structure List = gs_1
4598+ Glue/match-tree.sml
4599+ in
4600+ signature gs_2 = MATCH_TREE
4601+ structure gs_3 = MatchTree
4602+ end
4603+ local
4604+ open l16
4605+ in
4606+ functor gs_4 = ListSetFn
4607+ end
4608+ local
4609+ open l4
4610+ in
4611+ structure gs_5 = Char
4612+ end
4613+ local
4614+ open l16
4615+ in
4616+ signature gs_6 = ORD_SET
4617+ end
4618+ local
4619+ signature ORD_SET = gs_6
4620+ FrontEnd/syntax-sig.sml
4621+ in
4622+ signature gs_7 = REGEXP_SYNTAX
4623+ end
4624+ local
4625+ structure Char = gs_5
4626+ structure List = gs_1
4627+ functor ListSetFn = gs_4
4628+ signature REGEXP_SYNTAX = gs_7
4629+ FrontEnd/syntax.sml
4630+ in
4631+ structure gs_8 = RegExpSyntax
4632+ end
4633+ local
4634+ signature MATCH_TREE = gs_2
4635+ structure MatchTree = gs_3
4636+ structure RegExpSyntax = gs_8
4637+ structure StringCvt = gs_0
4638+ BackEnd/engine-sig.sml
4639+ in
4640+ signature gs_9 = REGEXP_ENGINE
4641+ end
4642+ local
4643+ open l4
4644+ in
4645+ structure gs_10 = Array
4646+ end
4647+ local
4648+ open l4
4649+ in
4650+ structure gs_11 = Vector
4651+ end
4652+ local
4653+ open l4
4654+ in
4655+ structure gs_12 = Int
4656+ end
4657+ local
4658+ structure Array = gs_10
4659+ structure Char = gs_5
4660+ structure Int = gs_12
4661+ structure List = gs_1
4662+ signature MATCH_TREE = gs_2
4663+ structure MatchTree = gs_3
4664+ signature REGEXP_ENGINE = gs_9
4665+ structure RegExpSyntax = gs_8
4666+ structure StringCvt = gs_0
4667+ structure Vector = gs_11
4668+ BackEnd/thompson-engine.sml
4669+ in
4670+ structure gs_13 = ThompsonEngine
4671+ end
4672+ local
4673+ open l16
4674+ in
4675+ functor gs_14 = ListMapFn
4676+ end
4677+ local
4678+ open l4
4679+ in
4680+ structure gs_15 = Array2
4681+ end
4682+ local
4683+ open l4
4684+ in
4685+ structure gs_16 = TextIO
4686+ end
4687+ local
4688+ open l4
4689+ in
4690+ structure gs_17 = ListPair
4691+ end
4692+ local
4693+ structure Array = gs_10
4694+ structure Array2 = gs_15
4695+ structure Char = gs_5
4696+ structure Int = gs_12
4697+ structure List = gs_1
4698+ functor ListMapFn = gs_14
4699+ structure ListPair = gs_17
4700+ functor ListSetFn = gs_4
4701+ signature ORD_SET = gs_6
4702+ structure RegExpSyntax = gs_8
4703+ structure TextIO = gs_16
4704+ BackEnd/fsm.sml
4705+ in
4706+ signature gs_18 = DFA
4707+ structure gs_19 = Dfa
4708+ signature gs_20 = NFA
4709+ structure gs_21 = Nfa
4710+ end
4711+ local
4712+ signature DFA = gs_18
4713+ structure Dfa = gs_19
4714+ signature MATCH_TREE = gs_2
4715+ structure MatchTree = gs_3
4716+ signature NFA = gs_20
4717+ structure Nfa = gs_21
4718+ signature REGEXP_ENGINE = gs_9
4719+ structure RegExpSyntax = gs_8
4720+ structure Vector = gs_11
4721+ BackEnd/dfa-engine.sml
4722+ in
4723+ structure gs_22 = DfaEngine
4724+ end
4725+ local
4726+ signature MATCH_TREE = gs_2
4727+ structure MatchTree = gs_3
4728+ structure StringCvt = gs_0
4729+ Glue/regexp-sig.sml
4730+ in
4731+ signature gs_23 = REGEXP
4732+ end
4733+ local
4734+ structure RegExpSyntax = gs_8
4735+ structure StringCvt = gs_0
4736+ FrontEnd/parser-sig.sml
4737+ in
4738+ signature gs_24 = REGEXP_PARSER
4739+ end
4740+ local
4741+ signature MATCH_TREE = gs_2
4742+ structure MatchTree = gs_3
4743+ signature REGEXP = gs_23
4744+ signature REGEXP_ENGINE = gs_9
4745+ signature REGEXP_PARSER = gs_24
4746+ structure RegExpSyntax = gs_8
4747+ structure StringCvt = gs_0
4748+ Glue/regexp-fn.sml
4749+ in
4750+ functor gs_25 = RegExpFn
4751+ end
4752+ local
4753+ open l4
4754+ in
4755+ structure gs_26 = Word8
4756+ end
4757+ local
4758+ structure Char = gs_5
4759+ structure Int = gs_12
4760+ structure List = gs_1
4761+ signature REGEXP_PARSER = gs_24
4762+ structure RegExpSyntax = gs_8
4763+ structure StringCvt = gs_0
4764+ structure Word8 = gs_26
4765+ FrontEnd/awk-syntax.sml
4766+ in
4767+ structure gs_27 = AwkSyntax
4768+ end
4769+ local
4770+ open l4
4771+ in
4772+ structure gs_28 = Option
4773+ end
4774+ local
4775+ structure List = gs_1
4776+ signature MATCH_TREE = gs_2
4777+ structure MatchTree = gs_3
4778+ structure Option = gs_28
4779+ signature REGEXP_ENGINE = gs_9
4780+ structure RegExpSyntax = gs_8
4781+ BackEnd/bt-engine.sml
4782+ in
4783+ structure gs_29 = BackTrackEngine
4784+ end
4785+in
4786+ structure AwkSyntax = gs_27
4787+ structure BackTrackEngine = gs_29
4788+ structure DfaEngine = gs_22
4789+ signature MATCH_TREE = gs_2
4790+ structure MatchTree = gs_3
4791+ signature REGEXP = gs_23
4792+ signature REGEXP_ENGINE = gs_9
4793+ signature REGEXP_PARSER = gs_24
4794+ signature REGEXP_SYNTAX = gs_7
4795+ functor RegExpFn = gs_25
4796+ structure RegExpSyntax = gs_8
4797+ structure ThompsonEngine = gs_13
4798+end
4799+end
4800+
4801+end
4802diff --git a/SExp/sexp-lib.mlb b/SExp/sexp-lib.mlb
4803index d7287e5..47e2c8c 100644
4804--- a/SExp/sexp-lib.mlb
4805+++ b/SExp/sexp-lib.mlb
4806@@ -1,51 +1,172 @@
4807-(* sexp-lib.mlb
4808- *
4809- * COPYRIGHT (c) 2011 The Fellowship of SML/NJ (http://www.smlnj.org)
4810- * All rights reserved.
4811- *
4812- * Author: Damon Wang (with modifications by John Reppy)
4813- *
4814- * An MLB file for the JSON library, so that it can be used by MLton programs.
4815- *
4816- * TODO:
4817- * This is not complete, since MLton does not have the ml-lpt-lib yet.
4818- *)
4819-
4820-local
4821-
4822- $(SML_LIB)/basis/basis.mlb
4823- $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
4824-(* I don't know what the path to this library will be
4825- ??/ml-lpt-lib/ml-lpt-lib.mlb
4826-*)
4827-
4828- ann
4829- "nonexhaustiveMatch warn" "redundantMatch warn"
4830- "sequenceNonUnit ignore"
4831- "warnUnused false" "forceUsed"
4832- in
4833-
4834- sexp-tokens.sml
4835- sexp.lex.sml
4836- sexp.sml
4837-(* sexp-stream-parser.sml *)
4838- sexp-parser.sml
4839-(* sexp-stream-printer.sml *)
4840- sexp-printer.sml
4841-
4842- end
4843
4844+ann
4845+ "nonexhaustiveBind ignore" "nonexhaustiveMatch warn"
4846+ "redundantBind warn" "redundantMatch warn"
4847+ "sequenceNonUnit ignore"
4848+ "warnUnused false" "forceUsed"
4849 in
4850
4851-(* DOM-style API (tree based) *)
4852- structure SExp
4853- structure SExpParser
4854- structure SExpPrinter
4855-
4856-(* SAX-style API (event based) *)
4857-(*
4858- structure SExpStreamParser
4859- structure SExpStreamPrinter
4860-*)
4861+local
4862+ basis l8 =
4863+ bas
4864+ (* $/basis.cm ====> *) $(SML_LIB)/basis/basis.mlb
4865+ end
4866+ basis l4 =
4867+ bas
4868+ (* $/smlnj-lib.cm ====> *) $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
4869+ end
4870+ basis l38 =
4871+ bas
4872+ (* $/ml-lpt-lib.cm ====> *) $(SML_LIB)/mllpt-lib/mllpt-lib.mlb
4873+ end
4874+in
4875+local
4876+ $(SML_LIB)/basis/pervasive.mlb
4877+ local
4878+ open l4
4879+ in
4880+ structure gs_0 = Format
4881+ end
4882+ local
4883+ open l8
4884+ in
4885+ structure gs_1 = TextIO
4886+ end
4887+ local
4888+ open l8
4889+ in
4890+ structure gs_2 = String
4891+ end
4892+ local
4893+ open l8
4894+ in
4895+ structure gs_3 = List
4896+ end
4897+ local
4898+ open l4
4899+ in
4900+ structure gs_4 = Atom
4901+ end
4902+ local
4903+ open l8
4904+ in
4905+ structure gs_5 = IntInf
4906+ end
4907+ local
4908+ open l8
4909+ in
4910+ structure gs_6 = ListPair
4911+ end
4912+ local
4913+ open l8
4914+ in
4915+ structure gs_7 = Real
4916+ end
4917+ local
4918+ structure Atom = gs_4
4919+ structure IntInf = gs_5
4920+ structure ListPair = gs_6
4921+ structure Real = gs_7
4922+ sexp.sml
4923+ in
4924+ structure gs_8 = SExp
4925+ end
4926+ local
4927+ structure Atom = gs_4
4928+ structure Format = gs_0
4929+ structure List = gs_3
4930+ structure SExp = gs_8
4931+ structure String = gs_2
4932+ structure TextIO = gs_1
4933+ sexp-printer.sml
4934+ in
4935+ structure gs_9 = SExpPrinter
4936+ end
4937+ local
4938+ open l38
4939+ in
4940+ structure gs_10 = AntlrStreamPos
4941+ end
4942+ local
4943+ open l38
4944+ in
4945+ structure gs_11 = UTF8
4946+ end
4947+ local
4948+ structure IntInf = gs_5
4949+ structure List = gs_3
4950+ structure Real = gs_7
4951+ structure String = gs_2
4952+ structure UTF8 = gs_11
4953+ sexp-tokens.sml
4954+ in
4955+ structure gs_12 = SExpTokens
4956+ end
4957+ local
4958+ open l8
4959+ in
4960+ structure gs_13 = StringCvt
4961+ end
4962+ local
4963+ open l8
4964+ in
4965+ structure gs_14 = LargeReal
4966+ end
4967+ local
4968+ open l8
4969+ in
4970+ structure gs_15 = Substring
4971+ end
4972+ local
4973+ open l8
4974+ in
4975+ structure gs_16 = Vector
4976+ end
4977+ local
4978+ open l38
4979+ in
4980+ structure gs_17 = ULexBuffer
4981+ end
4982+ local
4983+ open l8
4984+ in
4985+ structure gs_18 = Word
4986+ end
4987+ local
4988+ structure AntlrStreamPos = gs_10
4989+ structure IntInf = gs_5
4990+ structure LargeReal = gs_14
4991+ structure List = gs_3
4992+ structure SExpTokens = gs_12
4993+ structure String = gs_2
4994+ structure StringCvt = gs_13
4995+ structure Substring = gs_15
4996+ structure TextIO = gs_1
4997+ structure ULexBuffer = gs_17
4998+ structure UTF8 = gs_11
4999+ structure Vector = gs_16
5000+ structure Word = gs_18
5001+ sexp.lex.sml
5002+ in
5003+ structure gs_19 = SExpLexer
5004+ end
5005+ local
5006+ structure AntlrStreamPos = gs_10
5007+ structure Atom = gs_4
5008+ structure List = gs_3
5009+ structure SExp = gs_8
5010+ structure SExpLexer = gs_19
5011+ structure SExpTokens = gs_12
5012+ structure TextIO = gs_1
5013+ sexp-parser.sml
5014+ in
5015+ structure gs_20 = SExpParser
5016+ end
5017+in
5018+ structure SExp = gs_8
5019+ structure SExpParser = gs_20
5020+ structure SExpPrinter = gs_9
5021+end
5022+end
5023
5024 end
5025diff --git a/SExp/sexp.lex.sml b/SExp/sexp.lex.sml
5026index 9a5cb8e..7c0b9a6 100644
5027--- a/SExp/sexp.lex.sml
5028+++ b/SExp/sexp.lex.sml
5029@@ -2,6 +2,8 @@ structure SExpLexer = struct
5030
5031 datatype yystart_state =
5032 S | INITIAL
5033+ local
5034+
5035 structure UserDeclarations =
5036 struct
5037
5038@@ -23,10 +25,8 @@ S | INITIAL
5039 end
5040 fun finishString () = (T.STRING(String.concat(List.rev(!sbuf))) before sbuf := [])
5041
5042-
5043 end
5044
5045- local
5046 datatype yymatch
5047 = yyNO_MATCH
5048 | yyMATCH of ULexBuffer.stream * action * yymatch
5049@@ -104,7 +104,7 @@ Vector.fromList []
5050 (fn (~1, _, oldMatches) => yystuck oldMatches
5051 | (curState, strm, oldMatches) => let
5052 val (transitions, finals') = Vector.sub (yytable, curState)
5053- val finals = map (fn i => Vector.sub (actTable, i)) finals'
5054+ val finals = List.map (fn i => Vector.sub (actTable, i)) finals'
5055 fun tryfinal() =
5056 yystuck (yyactsToMatches (strm, finals, oldMatches))
5057 fun find (c, []) = NONE
5058diff --git a/Unix/unix-lib.mlb b/Unix/unix-lib.mlb
5059new file mode 100644
5060index 0000000..1481806
5061--- /dev/null
5062+++ b/Unix/unix-lib.mlb
5063@@ -0,0 +1,46 @@
5064+
5065+ann
5066+ "nonexhaustiveBind warn" "nonexhaustiveMatch warn"
5067+ "redundantBind warn" "redundantMatch warn"
5068+ "sequenceNonUnit ignore"
5069+ "warnUnused false" "forceUsed"
5070+in
5071+
5072+local
5073+ basis l4 =
5074+ bas
5075+ (* $/basis.cm ====> *) $(SML_LIB)/basis/basis.mlb
5076+ end
5077+in
5078+local
5079+ $(SML_LIB)/basis/pervasive.mlb
5080+ local
5081+ open l4
5082+ in
5083+ structure gs_0 = Substring
5084+ end
5085+ local
5086+ open l4
5087+ in
5088+ structure gs_1 = Posix
5089+ end
5090+ local
5091+ unix-env-sig.sml
5092+ in
5093+ signature gs_2 = UNIX_ENV
5094+ end
5095+ local
5096+ structure Posix = gs_1
5097+ structure Substring = gs_0
5098+ signature UNIX_ENV = gs_2
5099+ unix-env.sml
5100+ in
5101+ structure gs_3 = UnixEnv
5102+ end
5103+in
5104+ signature UNIX_ENV = gs_2
5105+ structure UnixEnv = gs_3
5106+end
5107+end
5108+
5109+end
5110diff --git a/Util/base64.sml b/Util/base64.sml
5111index 2432737..8e989c8 100644
5112--- a/Util/base64.sml
5113+++ b/Util/base64.sml
5114@@ -11,9 +11,11 @@
5115 structure Base64 : BASE64 =
5116 struct
5117
5118+ structure CA = CharArray
5119 structure W8 = Word8
5120 structure W8V = Word8Vector
5121 structure W8A = Word8Array
5122+ structure UCA = Unsafe.CharArray
5123 structure UCV = Unsafe.CharVector
5124 structure UW8V = Unsafe.Word8Vector
5125
5126@@ -59,16 +61,16 @@ structure Base64 : BASE64 =
5127 local
5128 fun encode64 (vec, start, len) = let
5129 val outLen = 4 * Int.quot(len + 2, 3)
5130- val outBuf = Unsafe.CharVector.create outLen
5131+ val outBuf = UCA.create outLen
5132 val nTriples = Int.quot(len, 3)
5133 val extra = Int.rem(len, 3)
5134 fun insBuf (i, (c1, c2, c3, c4)) = let
5135 val idx = 4*i
5136 in
5137- UCV.update(outBuf, idx, c1);
5138- UCV.update(outBuf, idx+1, c2);
5139- UCV.update(outBuf, idx+2, c3);
5140- UCV.update(outBuf, idx+3, c4)
5141+ UCA.update(outBuf, idx, c1);
5142+ UCA.update(outBuf, idx+1, c2);
5143+ UCA.update(outBuf, idx+2, c3);
5144+ UCA.update(outBuf, idx+3, c4)
5145 end
5146 fun loop (i, idx) = if (i < nTriples)
5147 then (
5148@@ -81,7 +83,7 @@ structure Base64 : BASE64 =
5149 (* end case *))
5150 in
5151 loop (0, start);
5152- outBuf
5153+ CA.vector outBuf
5154 end
5155 in
5156
5157diff --git a/Util/engine.mlton.sml b/Util/engine.mlton.sml
5158new file mode 100644
5159index 0000000..deb0c42
5160--- /dev/null
5161+++ b/Util/engine.mlton.sml
5162@@ -0,0 +1,99 @@
5163+(* Copyright (C) 1999-2004 Henry Cejtin, Matthew Fluet, Suresh
5164+ * Jagannathan, and Stephen Weeks.
5165+ *
5166+ * MLton is released under the GNU General Public License (GPL).
5167+ * Please see the file MLton-LICENSE for license information.
5168+ *)
5169+
5170+signature ENGINE =
5171+ sig
5172+ type 'a t
5173+
5174+ datatype 'a res =
5175+ Done of 'a
5176+ | Raise of exn
5177+ | TimeOut of 'a t
5178+
5179+ val new: (unit -> 'a) -> 'a t
5180+ val repeat: {thunk: unit -> 'a,
5181+ limit: Time.time,
5182+ tries: int} -> 'a option
5183+ val run: 'a t * Time.time -> 'a res
5184+ val timeLimit: Time.time * (unit -> 'a) -> 'a option
5185+ end
5186+
5187+structure Engine: ENGINE =
5188+struct
5189+
5190+open MLton
5191+
5192+datatype 'a t = T of {return: 'a res Thread.t option ref,
5193+ thread: Thread.Runnable.t}
5194+and 'a res =
5195+ Done of 'a
5196+ | Raise of exn
5197+ | TimeOut of 'a t
5198+
5199+val which = Itimer.Real
5200+val signal = Itimer.signal which
5201+
5202+fun done (return): unit =
5203+ (return := NONE
5204+ ; Itimer.set (which, {value = Time.zeroTime,
5205+ interval = Time.zeroTime})
5206+ ; Signal.setHandler (signal, Signal.Handler.default))
5207+
5208+fun new (f: unit -> 'a): 'a t =
5209+ let
5210+ val return = ref NONE
5211+ val thread =
5212+ Thread.new
5213+ (fn () =>
5214+ let
5215+ val res = Done (f ()) handle e => Raise e
5216+ val ret = valOf (!return)
5217+ val _ = done return
5218+ in
5219+ Thread.switch (fn _ => Thread.prepare (ret, res))
5220+ end)
5221+ val thread = Thread.prepare (thread, ())
5222+ in
5223+ T {return = return, thread = thread}
5224+ end
5225+
5226+fun run (T {return, thread}, time: Time.time): 'a res =
5227+ Thread.switch
5228+ (fn cur: 'a res Thread.t =>
5229+ let
5230+ val _ = return := SOME cur
5231+ fun handler (me: Thread.Runnable.t): Thread.Runnable.t =
5232+ Thread.prepare
5233+ (Thread.prepend (cur, fn () => (done return
5234+ ; TimeOut (T {return = return,
5235+ thread = me}))),
5236+ ())
5237+ val _ = Signal.setHandler (signal, Signal.Handler.handler handler)
5238+ val _ = Itimer.set (which, {value = time,
5239+ interval = Time.zeroTime})
5240+ in
5241+ thread
5242+ end)
5243+
5244+fun timeLimit (t: Time.time, f: unit -> 'a): 'a option =
5245+ case run (new f, t) of
5246+ Done a => SOME a
5247+ | Raise e => raise e
5248+ | TimeOut _ => NONE
5249+
5250+fun repeat {thunk, limit, tries} =
5251+ let
5252+ fun loop (n: int) =
5253+ if n <= 0
5254+ then NONE
5255+ else (case timeLimit (limit, thunk) of
5256+ NONE => loop (n - 1)
5257+ | SOME a => SOME a)
5258+ in loop tries
5259+ end
5260+
5261+end
5262diff --git a/Util/graph-scc-fn.sml b/Util/graph-scc-fn.sml
5263index 0dc3b32..4ae2d01 100644
5264--- a/Util/graph-scc-fn.sml
5265+++ b/Util/graph-scc-fn.sml
5266@@ -8,7 +8,7 @@
5267 * author: Matthias Blume
5268 *)
5269
5270-functor GraphSCCFn (Nd: ORD_KEY) :> GRAPH_SCC where Nd = Nd =
5271+functor GraphSCCFn (Nd: ORD_KEY) :> GRAPH_SCC where type Nd.ord_key = Nd.ord_key =
5272 struct
5273 structure Nd = Nd
5274
5275diff --git a/Util/redblack-map-fn.sml b/Util/redblack-map-fn.sml
5276index 526bdc1..c26cb8f 100644
5277--- a/Util/redblack-map-fn.sml
5278+++ b/Util/redblack-map-fn.sml
5279@@ -23,7 +23,7 @@
5280 * will be black and its child will be a red leaf.
5281 *)
5282
5283-functor RedBlackMapFn (K : ORD_KEY) :> ORD_MAP where Key = K =
5284+functor RedBlackMapFn (K : ORD_KEY) :> ORD_MAP where type Key.ord_key = K.ord_key =
5285 struct
5286
5287 structure Key = K
5288diff --git a/Util/redblack-set-fn.sml b/Util/redblack-set-fn.sml
5289index 3a16a82..ebfbb5a 100644
5290--- a/Util/redblack-set-fn.sml
5291+++ b/Util/redblack-set-fn.sml
5292@@ -23,7 +23,7 @@
5293 * will be black and its child will be a red leaf.
5294 *)
5295
5296-functor RedBlackSetFn (K : ORD_KEY) :> ORD_SET where Key = K =
5297+functor RedBlackSetFn (K : ORD_KEY) :> ORD_SET where type Key.ord_key = K.ord_key =
5298 struct
5299
5300 structure Key = K
5301diff --git a/Util/smlnj-lib.mlb b/Util/smlnj-lib.mlb
5302new file mode 100644
5303index 0000000..7194e93
5304--- /dev/null
5305+++ b/Util/smlnj-lib.mlb
5306@@ -0,0 +1,1173 @@
5307+
5308+ann
5309+ "nonexhaustiveBind ignore" "nonexhaustiveMatch warn"
5310+ "redundantBind ignore" "redundantMatch warn"
5311+ "sequenceNonUnit ignore"
5312+ "warnUnused false" "forceUsed"
5313+in
5314+
5315+local
5316+ basis l4 =
5317+ bas
5318+ (* $/basis.cm ====> *) $(SML_LIB)/basis/basis.mlb $(SML_LIB)/basis/unsafe.mlb $(SML_LIB)/basis/sml-nj.mlb
5319+ end
5320+in
5321+local
5322+ $(SML_LIB)/basis/pervasive.mlb
5323+ local
5324+ open l4
5325+ in
5326+ structure gs_0 = List
5327+ end
5328+ local
5329+ ord-key-sig.sml
5330+ in
5331+ signature gs_1 = ORD_KEY
5332+ end
5333+ local
5334+ signature ORD_KEY = gs_1
5335+ ord-set-sig.sml
5336+ in
5337+ signature gs_2 = ORD_SET
5338+ end
5339+ local
5340+ open l4
5341+ in
5342+ structure gs_3 = Int
5343+ end
5344+ local
5345+ lib-base-sig.sml
5346+ in
5347+ signature gs_4 = LIB_BASE
5348+ end
5349+ local
5350+ structure Int = gs_3
5351+ signature LIB_BASE = gs_4
5352+ lib-base.sml
5353+ in
5354+ structure gs_5 = LibBase
5355+ end
5356+ local
5357+ structure LibBase = gs_5
5358+ structure List = gs_0
5359+ signature ORD_KEY = gs_1
5360+ signature ORD_SET = gs_2
5361+ list-set-fn.sml
5362+ in
5363+ functor gs_6 = ListSetFn
5364+ end
5365+ local
5366+ signature ORD_KEY = gs_1
5367+ ord-map-sig.sml
5368+ in
5369+ signature gs_7 = ORD_MAP
5370+ end
5371+ local
5372+ structure LibBase = gs_5
5373+ structure List = gs_0
5374+ signature ORD_KEY = gs_1
5375+ signature ORD_MAP = gs_7
5376+ list-map-fn.sml
5377+ in
5378+ functor gs_8 = ListMapFn
5379+ end
5380+ local
5381+ structure Int = gs_3
5382+ structure LibBase = gs_5
5383+ structure List = gs_0
5384+ signature ORD_SET = gs_2
5385+ int-binary-set.sml
5386+ in
5387+ structure gs_9 = IntBinarySet
5388+ end
5389+ local
5390+ structure Int = gs_3
5391+ structure LibBase = gs_5
5392+ signature ORD_MAP = gs_7
5393+ int-binary-map.sml
5394+ in
5395+ structure gs_10 = IntBinaryMap
5396+ end
5397+ local
5398+ prime-sizes.sml
5399+ in
5400+ structure gs_11 = PrimeSizes
5401+ end
5402+ local
5403+ open l4
5404+ in
5405+ structure gs_12 = Array
5406+ end
5407+ local
5408+ open l4
5409+ in
5410+ structure gs_13 = ArraySlice
5411+ end
5412+ local
5413+ open l4
5414+ in
5415+ structure gs_14 = General
5416+ end
5417+ local
5418+ dynamic-array-sig.sml
5419+ in
5420+ signature gs_15 = DYNAMIC_ARRAY
5421+ end
5422+ local
5423+ structure Array = gs_12
5424+ structure ArraySlice = gs_13
5425+ signature DYNAMIC_ARRAY = gs_15
5426+ structure General = gs_14
5427+ structure Int = gs_3
5428+ dynamic-array.sml
5429+ in
5430+ structure gs_16 = DynamicArray
5431+ end
5432+ local
5433+ io-util-sig.sml
5434+ in
5435+ signature gs_17 = IO_UTIL
5436+ end
5437+ local
5438+ splaytree-sig.sml
5439+ in
5440+ signature gs_18 = SPLAY_TREE
5441+ end
5442+ local
5443+ signature SPLAY_TREE = gs_18
5444+ splaytree.sml
5445+ in
5446+ structure gs_19 = SplayTree
5447+ end
5448+ local
5449+ structure LibBase = gs_5
5450+ structure List = gs_0
5451+ signature ORD_KEY = gs_1
5452+ signature ORD_SET = gs_2
5453+ structure SplayTree = gs_19
5454+ splay-set-fn.sml
5455+ in
5456+ functor gs_20 = SplaySetFn
5457+ end
5458+ local
5459+ structure LibBase = gs_5
5460+ signature ORD_KEY = gs_1
5461+ signature ORD_MAP = gs_7
5462+ structure SplayTree = gs_19
5463+ splay-map-fn.sml
5464+ in
5465+ functor gs_21 = SplayMapFn
5466+ end
5467+ local
5468+ open l4
5469+ in
5470+ structure gs_22 = TextIO
5471+ end
5472+ local
5473+ structure Int = gs_3
5474+ structure List = gs_0
5475+ structure TextIO = gs_22
5476+ ansi-term.sml
5477+ in
5478+ structure gs_23 = ANSITerm
5479+ end
5480+ local
5481+ signature IO_UTIL = gs_17
5482+ structure TextIO = gs_22
5483+ io-util.sml
5484+ in
5485+ structure gs_24 = IOUtil
5486+ end
5487+ local
5488+ plist-sig.sml
5489+ in
5490+ signature gs_25 = PROP_LIST
5491+ end
5492+ local
5493+ open l4
5494+ in
5495+ structure gs_26 = Substring
5496+ end
5497+ local
5498+ open l4
5499+ in
5500+ structure gs_27 = StringCvt
5501+ end
5502+ local
5503+ open l4
5504+ in
5505+ structure gs_28 = String
5506+ end
5507+ local
5508+ open l4
5509+ in
5510+ structure gs_29 = Option
5511+ end
5512+ local
5513+ open l4
5514+ in
5515+ structure gs_30 = Char
5516+ end
5517+ local
5518+ getopt-sig.sml
5519+ in
5520+ signature gs_31 = GET_OPT
5521+ end
5522+ local
5523+ structure Char = gs_30
5524+ signature GET_OPT = gs_31
5525+ structure Int = gs_3
5526+ structure List = gs_0
5527+ structure Option = gs_29
5528+ structure String = gs_28
5529+ structure StringCvt = gs_27
5530+ structure Substring = gs_26
5531+ getopt.sml
5532+ in
5533+ structure gs_32 = GetOpt
5534+ end
5535+ local
5536+ interval-domain-sig.sml
5537+ in
5538+ signature gs_33 = INTERVAL_DOMAIN
5539+ end
5540+ local
5541+ signature INTERVAL_DOMAIN = gs_33
5542+ interval-set-sig.sml
5543+ in
5544+ signature gs_34 = INTERVAL_SET
5545+ end
5546+ local
5547+ structure StringCvt = gs_27
5548+ parser-comb-sig.sml
5549+ in
5550+ signature gs_35 = PARSER_COMB
5551+ end
5552+ local
5553+ open l4
5554+ in
5555+ structure gs_36 = Word8
5556+ end
5557+ local
5558+ open l4
5559+ in
5560+ structure gs_37 = CharVector
5561+ end
5562+ local
5563+ open l4
5564+ in
5565+ structure gs_38 = LargeWord
5566+ end
5567+ local
5568+ open l4
5569+ in
5570+ structure gs_39 = LargeInt
5571+ end
5572+ local
5573+ open l4
5574+ in
5575+ structure gs_40 = Word
5576+ end
5577+ local
5578+ open l4
5579+ in
5580+ structure gs_41 = Real
5581+ end
5582+ local
5583+ open l4
5584+ in
5585+ structure gs_42 = LargeReal
5586+ end
5587+ local
5588+ atom-sig.sml
5589+ in
5590+ signature gs_43 = ATOM
5591+ end
5592+ local
5593+ open l4
5594+ in
5595+ structure gs_44 = Unsafe
5596+ end
5597+ local
5598+ structure Char = gs_30
5599+ structure Substring = gs_26
5600+ structure Unsafe = gs_44
5601+ structure Word = gs_40
5602+ hash-string.sml
5603+ in
5604+ structure gs_45 = HashString
5605+ end
5606+ local
5607+ signature ATOM = gs_43
5608+ structure Array = gs_12
5609+ structure HashString = gs_45
5610+ structure String = gs_28
5611+ structure Substring = gs_26
5612+ structure Word = gs_40
5613+ atom.sml
5614+ in
5615+ structure gs_46 = Atom
5616+ end
5617+ local
5618+ structure Atom = gs_46
5619+ structure Int = gs_3
5620+ structure LargeInt = gs_39
5621+ structure LargeReal = gs_42
5622+ structure LargeWord = gs_38
5623+ structure Real = gs_41
5624+ structure Word = gs_40
5625+ structure Word8 = gs_36
5626+ format-sig.sml
5627+ in
5628+ signature gs_47 = FORMAT
5629+ end
5630+ local
5631+ structure Int = gs_3
5632+ structure String = gs_28
5633+ structure StringCvt = gs_27
5634+ real-format.sml
5635+ in
5636+ structure gs_48 = RealFormat
5637+ end
5638+ local
5639+ structure Atom = gs_46
5640+ structure Char = gs_30
5641+ structure Int = gs_3
5642+ structure LargeInt = gs_39
5643+ structure LargeReal = gs_42
5644+ structure LargeWord = gs_38
5645+ structure Real = gs_41
5646+ structure StringCvt = gs_27
5647+ structure Substring = gs_26
5648+ structure Word = gs_40
5649+ structure Word8 = gs_36
5650+ fmt-fields.sml
5651+ in
5652+ structure gs_49 = FmtFields
5653+ end
5654+ local
5655+ structure Atom = gs_46
5656+ structure Char = gs_30
5657+ structure CharVector = gs_37
5658+ signature FORMAT = gs_47
5659+ structure FmtFields = gs_49
5660+ structure Int = gs_3
5661+ structure LargeInt = gs_39
5662+ structure LargeWord = gs_38
5663+ structure Real = gs_41
5664+ structure RealFormat = gs_48
5665+ structure String = gs_28
5666+ structure StringCvt = gs_27
5667+ structure Substring = gs_26
5668+ structure Word = gs_40
5669+ structure Word8 = gs_36
5670+ format.sml
5671+ in
5672+ structure gs_50 = Format
5673+ end
5674+ local
5675+ priority-sig.sml
5676+ in
5677+ signature gs_51 = PRIORITY
5678+ end
5679+ local
5680+ hash-key-sig.sml
5681+ in
5682+ signature gs_52 = HASH_KEY
5683+ end
5684+ local
5685+ signature HASH_KEY = gs_52
5686+ mono-hash-table-sig.sml
5687+ in
5688+ signature gs_53 = MONO_HASH_TABLE
5689+ end
5690+ local
5691+ structure Array = gs_12
5692+ structure Word = gs_40
5693+ hash-table-rep.sml
5694+ in
5695+ structure gs_54 = HashTableRep
5696+ end
5697+ local
5698+ structure Array = gs_12
5699+ structure HashTableRep = gs_54
5700+ signature MONO_HASH_TABLE = gs_53
5701+ structure Word = gs_40
5702+ int-hash-table.sml
5703+ in
5704+ structure gs_55 = IntHashTable
5705+ end
5706+ local
5707+ open l4
5708+ in
5709+ signature gs_56 = MONO_ARRAY
5710+ end
5711+ local
5712+ signature MONO_ARRAY = gs_56
5713+ bit-array-sig.sml
5714+ in
5715+ signature gs_57 = BIT_ARRAY
5716+ end
5717+ local
5718+ structure LibBase = gs_5
5719+ structure List = gs_0
5720+ signature ORD_KEY = gs_1
5721+ signature ORD_SET = gs_2
5722+ redblack-set-fn.sml
5723+ in
5724+ functor gs_58 = RedBlackSetFn
5725+ end
5726+ local
5727+ structure Atom = gs_46
5728+ functor RedBlackSetFn = gs_58
5729+ atom-redblack-set.sml
5730+ in
5731+ structure gs_59 = AtomRedBlackSet
5732+ end
5733+ local
5734+ structure AtomRedBlackSet = gs_59
5735+ atom-set.sml
5736+ in
5737+ structure gs_60 = AtomSet
5738+ end
5739+ local
5740+ structure LibBase = gs_5
5741+ signature ORD_KEY = gs_1
5742+ signature ORD_MAP = gs_7
5743+ redblack-map-fn.sml
5744+ in
5745+ functor gs_61 = RedBlackMapFn
5746+ end
5747+ local
5748+ structure Atom = gs_46
5749+ functor RedBlackMapFn = gs_61
5750+ atom-redblack-map.sml
5751+ in
5752+ structure gs_62 = AtomRedBlackMap
5753+ end
5754+ local
5755+ structure AtomRedBlackMap = gs_62
5756+ atom-map.sml
5757+ in
5758+ structure gs_63 = AtomMap
5759+ end
5760+ local
5761+ open l4
5762+ in
5763+ structure gs_64 = Word8Array
5764+ end
5765+ local
5766+ open l4
5767+ in
5768+ structure gs_65 = Word8Vector
5769+ end
5770+ local
5771+ open l4
5772+ in
5773+ structure gs_66 = CharArray
5774+ end
5775+ local
5776+ open l4
5777+ in
5778+ structure gs_67 = Word8VectorSlice
5779+ end
5780+ local
5781+ open l4
5782+ in
5783+ structure gs_68 = Word8ArraySlice
5784+ end
5785+ local
5786+ structure Word8Vector = gs_65
5787+ structure Word8VectorSlice = gs_67
5788+ base64-sig.sml
5789+ in
5790+ signature gs_69 = BASE64
5791+ end
5792+ local
5793+ signature BASE64 = gs_69
5794+ structure Char = gs_30
5795+ structure CharArray = gs_66
5796+ structure CharVector = gs_37
5797+ structure Int = gs_3
5798+ structure String = gs_28
5799+ structure Substring = gs_26
5800+ structure Unsafe = gs_44
5801+ structure Word = gs_40
5802+ structure Word8 = gs_36
5803+ structure Word8Array = gs_64
5804+ structure Word8ArraySlice = gs_68
5805+ structure Word8Vector = gs_65
5806+ structure Word8VectorSlice = gs_67
5807+ base64.sml
5808+ in
5809+ structure gs_70 = Base64
5810+ end
5811+ local
5812+ structure List = gs_0
5813+ signature PROP_LIST = gs_25
5814+ plist.sml
5815+ in
5816+ structure gs_71 = PropList
5817+ end
5818+ local
5819+ open l4
5820+ in
5821+ structure gs_72 = Vector
5822+ end
5823+ local
5824+ char-map-sig.sml
5825+ in
5826+ signature gs_73 = CHAR_MAP
5827+ end
5828+ local
5829+ structure Array = gs_12
5830+ signature CHAR_MAP = gs_73
5831+ structure Char = gs_30
5832+ structure String = gs_28
5833+ structure Vector = gs_72
5834+ char-map.sml
5835+ in
5836+ structure gs_74 = CharMap
5837+ end
5838+ local
5839+ list-xprod-sig.sml
5840+ in
5841+ signature gs_75 = LIST_XPROD
5842+ end
5843+ local
5844+ signature ORD_KEY = gs_1
5845+ graph-scc-sig.sml
5846+ in
5847+ signature gs_76 = GRAPH_SCC
5848+ end
5849+ local
5850+ signature GRAPH_SCC = gs_76
5851+ structure List = gs_0
5852+ signature ORD_KEY = gs_1
5853+ functor RedBlackMapFn = gs_61
5854+ graph-scc-fn.sml
5855+ in
5856+ functor gs_77 = GraphSCCFn
5857+ end
5858+ local
5859+ structure Array = gs_12
5860+ signature HASH_KEY = gs_52
5861+ structure HashTableRep = gs_54
5862+ signature MONO_HASH_TABLE = gs_53
5863+ structure Word = gs_40
5864+ hash-table-fn.sml
5865+ in
5866+ functor gs_78 = HashTableFn
5867+ end
5868+ local
5869+ structure Atom = gs_46
5870+ functor HashTableFn = gs_78
5871+ atom-table.sml
5872+ in
5873+ structure gs_79 = AtomTable
5874+ end
5875+ local
5876+ structure StringCvt = gs_27
5877+ list-format-sig.sml
5878+ in
5879+ signature gs_80 = LIST_FORMAT
5880+ end
5881+ local
5882+ signature LIST_FORMAT = gs_80
5883+ structure String = gs_28
5884+ structure StringCvt = gs_27
5885+ list-format.sml
5886+ in
5887+ structure gs_81 = ListFormat
5888+ end
5889+ local
5890+ open l4
5891+ in
5892+ signature gs_82 = MONO_VECTOR
5893+ end
5894+ local
5895+ signature MONO_VECTOR = gs_82
5896+ bit-vector-sig.sml
5897+ in
5898+ signature gs_83 = BIT_VECTOR
5899+ end
5900+ local
5901+ signature PARSER_COMB = gs_35
5902+ structure StringCvt = gs_27
5903+ structure Substring = gs_26
5904+ parser-comb.sml
5905+ in
5906+ structure gs_84 = ParserComb
5907+ end
5908+ local
5909+ signature HASH_KEY = gs_52
5910+ mono-hash2-table-sig.sml
5911+ in
5912+ signature gs_85 = MONO_HASH2_TABLE
5913+ end
5914+ local
5915+ signature INTERVAL_DOMAIN = gs_33
5916+ signature INTERVAL_SET = gs_34
5917+ structure List = gs_0
5918+ interval-set-fn.sml
5919+ in
5920+ functor gs_86 = IntervalSetFn
5921+ end
5922+ local
5923+ structure LibBase = gs_5
5924+ structure List = gs_0
5925+ signature ORD_SET = gs_2
5926+ structure Word = gs_40
5927+ word-redblack-set.sml
5928+ in
5929+ structure gs_87 = WordRedBlackSet
5930+ end
5931+ local
5932+ structure LibBase = gs_5
5933+ signature ORD_MAP = gs_7
5934+ structure Word = gs_40
5935+ word-redblack-map.sml
5936+ in
5937+ structure gs_88 = WordRedBlackMap
5938+ end
5939+ local
5940+ structure Int = gs_3
5941+ structure LibBase = gs_5
5942+ structure List = gs_0
5943+ signature ORD_SET = gs_2
5944+ int-list-set.sml
5945+ in
5946+ structure gs_89 = IntListSet
5947+ end
5948+ local
5949+ structure Int = gs_3
5950+ structure LibBase = gs_5
5951+ structure List = gs_0
5952+ signature ORD_MAP = gs_7
5953+ int-list-map.sml
5954+ in
5955+ structure gs_90 = IntListMap
5956+ end
5957+ local
5958+ open l4
5959+ in
5960+ structure gs_91 = OS
5961+ end
5962+ local
5963+ path-util-sig.sml
5964+ in
5965+ signature gs_92 = PATH_UTIL
5966+ end
5967+ local
5968+ structure OS = gs_91
5969+ signature PATH_UTIL = gs_92
5970+ path-util.sml
5971+ in
5972+ structure gs_93 = PathUtil
5973+ end
5974+ local
5975+ structure LibBase = gs_5
5976+ structure List = gs_0
5977+ signature ORD_KEY = gs_1
5978+ signature ORD_SET = gs_2
5979+ binary-set-fn.sml
5980+ in
5981+ functor gs_94 = BinarySetFn
5982+ end
5983+ local
5984+ structure LibBase = gs_5
5985+ signature ORD_KEY = gs_1
5986+ signature ORD_MAP = gs_7
5987+ binary-map-fn.sml
5988+ in
5989+ functor gs_95 = BinaryMapFn
5990+ end
5991+ local
5992+ open l4
5993+ in
5994+ structure gs_96 = Math
5995+ end
5996+ local
5997+ open l4
5998+ in
5999+ structure gs_97 = PackWord32Big
6000+ end
6001+ local
6002+ open l4
6003+ in
6004+ structure gs_98 = Word31
6005+ end
6006+ local
6007+ open l4
6008+ in
6009+ structure gs_99 = Byte
6010+ end
6011+ local
6012+ random-sig.sml
6013+ in
6014+ signature gs_100 = RANDOM
6015+ end
6016+ local
6017+ structure Array = gs_12
6018+ structure Byte = gs_99
6019+ structure LargeWord = gs_38
6020+ structure LibBase = gs_5
6021+ structure PackWord32Big = gs_97
6022+ signature RANDOM = gs_100
6023+ structure Word31 = gs_98
6024+ structure Word8Array = gs_64
6025+ structure Word8Vector = gs_65
6026+ random.sml
6027+ in
6028+ structure gs_101 = Random
6029+ end
6030+ local
6031+ structure Array = gs_12
6032+ structure ArraySlice = gs_13
6033+ structure Random = gs_101
6034+ structure Real = gs_41
6035+ structure Unsafe = gs_44
6036+ structure Word = gs_40
6037+ real-order-stats.sml
6038+ in
6039+ structure gs_102 = RealOrderStats
6040+ end
6041+ local
6042+ structure Array = gs_12
6043+ structure ArraySlice = gs_13
6044+ structure Math = gs_96
6045+ structure RealOrderStats = gs_102
6046+ structure Unsafe = gs_44
6047+ univariate-stats.sml
6048+ in
6049+ structure gs_103 = UnivariateStats
6050+ end
6051+ local
6052+ signature BIT_ARRAY = gs_57
6053+ structure Byte = gs_99
6054+ structure Int = gs_3
6055+ structure LibBase = gs_5
6056+ structure List = gs_0
6057+ structure Unsafe = gs_44
6058+ structure Word = gs_40
6059+ structure Word8 = gs_36
6060+ structure Word8Array = gs_64
6061+ structure Word8Vector = gs_65
6062+ bit-array.sml
6063+ in
6064+ structure gs_104 = BitArray
6065+ end
6066+ local
6067+ structure Array = gs_12
6068+ signature MONO_ARRAY = gs_56
6069+ structure Vector = gs_72
6070+ mono-array-fn.sml
6071+ in
6072+ functor gs_105 = MonoArrayFn
6073+ end
6074+ local
6075+ signature MONO_ARRAY = gs_56
6076+ bsearch-fn.sml
6077+ in
6078+ functor gs_106 = BSearchFn
6079+ end
6080+ local
6081+ mono-dynamic-array-sig.sml
6082+ in
6083+ signature gs_107 = MONO_DYNAMIC_ARRAY
6084+ end
6085+ local
6086+ open l4
6087+ in
6088+ structure gs_108 = Bool
6089+ end
6090+ local
6091+ structure StringCvt = gs_27
6092+ format-comb-sig.sml
6093+ in
6094+ signature gs_109 = FORMAT_COMB
6095+ end
6096+ local
6097+ structure Bool = gs_108
6098+ structure Char = gs_30
6099+ signature FORMAT_COMB = gs_109
6100+ structure Int = gs_3
6101+ structure List = gs_0
6102+ structure Real = gs_41
6103+ structure String = gs_28
6104+ structure StringCvt = gs_27
6105+ format-comb.sml
6106+ in
6107+ structure gs_110 = FormatComb
6108+ end
6109+ local
6110+ queue-sig.sml
6111+ in
6112+ signature gs_111 = QUEUE
6113+ end
6114+ local
6115+ fifo-sig.sml
6116+ in
6117+ signature gs_112 = FIFO
6118+ end
6119+ local
6120+ signature FIFO = gs_112
6121+ structure List = gs_0
6122+ fifo.sml
6123+ in
6124+ structure gs_113 = Fifo
6125+ end
6126+ local
6127+ structure Fifo = gs_113
6128+ signature QUEUE = gs_111
6129+ queue.sml
6130+ in
6131+ structure gs_114 = Queue
6132+ end
6133+ local
6134+ structure Array = gs_12
6135+ signature HASH_KEY = gs_52
6136+ structure HashTableRep = gs_54
6137+ signature MONO_HASH2_TABLE = gs_85
6138+ structure Word = gs_40
6139+ hash2-table-fn.sml
6140+ in
6141+ functor gs_115 = Hash2TableFn
6142+ end
6143+ local
6144+ structure Array = gs_12
6145+ structure HashTableRep = gs_54
6146+ signature MONO_HASH_TABLE = gs_53
6147+ structure Word = gs_40
6148+ word-hash-table.sml
6149+ in
6150+ structure gs_116 = WordHashTable
6151+ end
6152+ local
6153+ structure Atom = gs_46
6154+ structure AtomTable = gs_79
6155+ structure List = gs_0
6156+ keyword-fn.sml
6157+ in
6158+ functor gs_117 = KeywordFn
6159+ end
6160+ local
6161+ mono-priorityq-sig.sml
6162+ in
6163+ signature gs_118 = MONO_PRIORITYQ
6164+ end
6165+ local
6166+ structure List = gs_0
6167+ signature MONO_PRIORITYQ = gs_118
6168+ signature PRIORITY = gs_51
6169+ left-priorityq-fn.sml
6170+ in
6171+ functor gs_119 = LeftPriorityQFn
6172+ end
6173+ local
6174+ hash-table-sig.sml
6175+ in
6176+ signature gs_120 = HASH_TABLE
6177+ end
6178+ local
6179+ structure Array = gs_12
6180+ signature HASH_TABLE = gs_120
6181+ structure HashTableRep = gs_54
6182+ structure Word = gs_40
6183+ hash-table.sml
6184+ in
6185+ structure gs_121 = HashTable
6186+ end
6187+ local
6188+ structure Array = gs_12
6189+ signature HASH_KEY = gs_52
6190+ structure List = gs_0
6191+ structure Word = gs_40
6192+ hash-set-fn.sml
6193+ in
6194+ signature gs_122 = HASH_SET
6195+ functor gs_123 = HashSetFn
6196+ end
6197+ local
6198+ structure General = gs_14
6199+ structure Int = gs_3
6200+ signature MONO_ARRAY = gs_56
6201+ signature MONO_DYNAMIC_ARRAY = gs_107
6202+ dynamic-array-fn.sml
6203+ in
6204+ functor gs_124 = DynamicArrayFn
6205+ end
6206+ local
6207+ signature MONO_ARRAY = gs_56
6208+ mono-array-sort-sig.sml
6209+ in
6210+ signature gs_125 = MONO_ARRAY_SORT
6211+ end
6212+ local
6213+ structure Int = gs_3
6214+ structure LibBase = gs_5
6215+ structure List = gs_0
6216+ signature ORD_SET = gs_2
6217+ int-redblack-set.sml
6218+ in
6219+ structure gs_126 = IntRedBlackSet
6220+ end
6221+ local
6222+ structure Int = gs_3
6223+ structure LibBase = gs_5
6224+ signature ORD_MAP = gs_7
6225+ int-redblack-map.sml
6226+ in
6227+ structure gs_127 = IntRedBlackMap
6228+ end
6229+ local
6230+ array-sort-sig.sml
6231+ in
6232+ signature gs_128 = ARRAY_SORT
6233+ end
6234+ local
6235+ signature ARRAY_SORT = gs_128
6236+ structure Array = gs_12
6237+ structure Int = gs_3
6238+ structure Unsafe = gs_44
6239+ array-qsort.sml
6240+ in
6241+ structure gs_129 = ArrayQSort
6242+ end
6243+ local
6244+ uref-sig.sml
6245+ in
6246+ signature gs_130 = UREF
6247+ end
6248+ local
6249+ signature UREF = gs_130
6250+ simple-uref.sml
6251+ in
6252+ structure gs_131 = SimpleURef
6253+ end
6254+ local
6255+ listsort-sig.sml
6256+ in
6257+ signature gs_132 = LIST_SORT
6258+ end
6259+ local
6260+ signature LIST_SORT = gs_132
6261+ list-mergesort.sml
6262+ in
6263+ structure gs_133 = ListMergeSort
6264+ end
6265+ local
6266+ structure Int = gs_3
6267+ signature MONO_ARRAY = gs_56
6268+ signature MONO_ARRAY_SORT = gs_125
6269+ array-qsort-fn.sml
6270+ in
6271+ functor gs_134 = ArrayQSortFn
6272+ end
6273+ local
6274+ structure Atom = gs_46
6275+ functor BinarySetFn = gs_94
6276+ atom-binary-set.sml
6277+ in
6278+ structure gs_135 = AtomBinarySet
6279+ end
6280+ local
6281+ structure Atom = gs_46
6282+ functor BinaryMapFn = gs_95
6283+ atom-binary-map.sml
6284+ in
6285+ structure gs_136 = AtomBinaryMap
6286+ end
6287+ local
6288+ structure StringCvt = gs_27
6289+ utf8-sig.sml
6290+ in
6291+ signature gs_137 = UTF8
6292+ end
6293+ local
6294+ structure Char = gs_30
6295+ structure String = gs_28
6296+ structure StringCvt = gs_27
6297+ structure Substring = gs_26
6298+ signature UTF8 = gs_137
6299+ structure Word = gs_40
6300+ utf8.sml
6301+ in
6302+ structure gs_138 = UTF8
6303+ end
6304+ local
6305+ signature UREF = gs_130
6306+ uref.sml
6307+ in
6308+ structure gs_139 = URef
6309+ end
6310+ local
6311+ structure Atom = gs_46
6312+ structure Int = gs_3
6313+ structure LargeInt = gs_39
6314+ structure LargeReal = gs_42
6315+ structure LargeWord = gs_38
6316+ structure Real = gs_41
6317+ structure StringCvt = gs_27
6318+ structure Word = gs_40
6319+ structure Word8 = gs_36
6320+ scan-sig.sml
6321+ in
6322+ signature gs_140 = SCAN
6323+ end
6324+ local
6325+ structure Bool = gs_108
6326+ structure Char = gs_30
6327+ structure FmtFields = gs_49
6328+ structure Int = gs_3
6329+ structure LargeInt = gs_39
6330+ structure LargeReal = gs_42
6331+ signature SCAN = gs_140
6332+ structure StringCvt = gs_27
6333+ structure Substring = gs_26
6334+ structure Word8Array = gs_64
6335+ scan.sml
6336+ in
6337+ structure gs_141 = Scan
6338+ end
6339+ local
6340+ open l4
6341+ in
6342+ structure gs_142 = Int32
6343+ end
6344+ local
6345+ structure Word31 = gs_98
6346+ rand-sig.sml
6347+ in
6348+ signature gs_143 = RAND
6349+ end
6350+ local
6351+ structure Int32 = gs_142
6352+ structure LibBase = gs_5
6353+ signature RAND = gs_143
6354+ structure Real = gs_41
6355+ structure Word31 = gs_98
6356+ rand.sml
6357+ in
6358+ structure gs_144 = Rand
6359+ end
6360+ local
6361+ signature LIST_XPROD = gs_75
6362+ list-xprod.sml
6363+ in
6364+ structure gs_145 = ListXProd
6365+ end
6366+in
6367+ structure ANSITerm = gs_23
6368+ signature ARRAY_SORT = gs_128
6369+ signature ATOM = gs_43
6370+ structure ArrayQSort = gs_129
6371+ functor ArrayQSortFn = gs_134
6372+ structure Atom = gs_46
6373+ structure AtomBinaryMap = gs_136
6374+ structure AtomBinarySet = gs_135
6375+ structure AtomMap = gs_63
6376+ structure AtomRedBlackMap = gs_62
6377+ structure AtomRedBlackSet = gs_59
6378+ structure AtomSet = gs_60
6379+ structure AtomTable = gs_79
6380+ signature BASE64 = gs_69
6381+ signature BIT_ARRAY = gs_57
6382+ signature BIT_VECTOR = gs_83
6383+ functor BSearchFn = gs_106
6384+ structure Base64 = gs_70
6385+ functor BinaryMapFn = gs_95
6386+ functor BinarySetFn = gs_94
6387+ structure BitArray = gs_104
6388+ signature CHAR_MAP = gs_73
6389+ structure CharMap = gs_74
6390+ signature DYNAMIC_ARRAY = gs_15
6391+ structure DynamicArray = gs_16
6392+ functor DynamicArrayFn = gs_124
6393+ signature FIFO = gs_112
6394+ signature FORMAT = gs_47
6395+ signature FORMAT_COMB = gs_109
6396+ structure Fifo = gs_113
6397+ structure Format = gs_50
6398+ structure FormatComb = gs_110
6399+ signature GET_OPT = gs_31
6400+ signature GRAPH_SCC = gs_76
6401+ structure GetOpt = gs_32
6402+ functor GraphSCCFn = gs_77
6403+ signature HASH_KEY = gs_52
6404+ signature HASH_SET = gs_122
6405+ signature HASH_TABLE = gs_120
6406+ functor Hash2TableFn = gs_115
6407+ functor HashSetFn = gs_123
6408+ structure HashString = gs_45
6409+ structure HashTable = gs_121
6410+ functor HashTableFn = gs_78
6411+ signature INTERVAL_DOMAIN = gs_33
6412+ signature INTERVAL_SET = gs_34
6413+ structure IOUtil = gs_24
6414+ signature IO_UTIL = gs_17
6415+ structure IntBinaryMap = gs_10
6416+ structure IntBinarySet = gs_9
6417+ structure IntHashTable = gs_55
6418+ structure IntListMap = gs_90
6419+ structure IntListSet = gs_89
6420+ structure IntRedBlackMap = gs_127
6421+ structure IntRedBlackSet = gs_126
6422+ functor IntervalSetFn = gs_86
6423+ functor KeywordFn = gs_117
6424+ signature LIB_BASE = gs_4
6425+ signature LIST_FORMAT = gs_80
6426+ signature LIST_SORT = gs_132
6427+ signature LIST_XPROD = gs_75
6428+ functor LeftPriorityQFn = gs_119
6429+ structure LibBase = gs_5
6430+ structure ListFormat = gs_81
6431+ functor ListMapFn = gs_8
6432+ structure ListMergeSort = gs_133
6433+ functor ListSetFn = gs_6
6434+ structure ListXProd = gs_145
6435+ signature MONO_ARRAY_SORT = gs_125
6436+ signature MONO_DYNAMIC_ARRAY = gs_107
6437+ signature MONO_HASH2_TABLE = gs_85
6438+ signature MONO_HASH_TABLE = gs_53
6439+ signature MONO_PRIORITYQ = gs_118
6440+ functor MonoArrayFn = gs_105
6441+ signature ORD_KEY = gs_1
6442+ signature ORD_MAP = gs_7
6443+ signature ORD_SET = gs_2
6444+ signature PARSER_COMB = gs_35
6445+ signature PATH_UTIL = gs_92
6446+ signature PRIORITY = gs_51
6447+ signature PROP_LIST = gs_25
6448+ structure ParserComb = gs_84
6449+ structure PathUtil = gs_93
6450+ structure PrimeSizes = gs_11
6451+ structure PropList = gs_71
6452+ signature QUEUE = gs_111
6453+ structure Queue = gs_114
6454+ signature RAND = gs_143
6455+ signature RANDOM = gs_100
6456+ structure Rand = gs_144
6457+ structure Random = gs_101
6458+ structure RealOrderStats = gs_102
6459+ functor RedBlackMapFn = gs_61
6460+ functor RedBlackSetFn = gs_58
6461+ signature SCAN = gs_140
6462+ signature SPLAY_TREE = gs_18
6463+ structure Scan = gs_141
6464+ structure SimpleURef = gs_131
6465+ functor SplayMapFn = gs_21
6466+ functor SplaySetFn = gs_20
6467+ structure SplayTree = gs_19
6468+ signature UREF = gs_130
6469+ structure URef = gs_139
6470+ signature UTF8 = gs_137
6471+ structure UTF8 = gs_138
6472+ structure UnivariateStats = gs_103
6473+ structure WordHashTable = gs_116
6474+ structure WordRedBlackMap = gs_88
6475+ structure WordRedBlackSet = gs_87
6476+end
6477+end
6478+
6479+end
6480diff --git a/Util/time-limit.mlb b/Util/time-limit.mlb
6481new file mode 100644
6482index 0000000..c4ca078
6483--- /dev/null
6484+++ b/Util/time-limit.mlb
6485@@ -0,0 +1,16 @@
6486+ann
6487+ "nonexhaustiveMatch warn" "redundantMatch warn"
6488+ "sequenceNonUnit warn"
6489+ "warnUnused false" "forceUsed"
6490+in
6491+
6492+local
6493+ $(SML_LIB)/basis/basis.mlb
6494+ $(SML_LIB)/basis/mlton.mlb
6495+ engine.mlton.sml
6496+ time-limit.mlton.sml
6497+in
6498+ structure TimeLimit = TimeLimit
6499+end
6500+
6501+end
6502diff --git a/Util/time-limit.mlton.sml b/Util/time-limit.mlton.sml
6503new file mode 100644
6504index 0000000..0f585b7
6505--- /dev/null
6506+++ b/Util/time-limit.mlton.sml
6507@@ -0,0 +1,24 @@
6508+(* time-limit.mlton.sml
6509+ *
6510+ * Copyright (C) 1999-2004 Henry Cejtin, Matthew Fluet, Suresh
6511+ * Jagannathan, and Stephen Weeks.
6512+ *
6513+ * MLton is released under the GNU General Public License (GPL).
6514+ * Please see the file MLton-LICENSE for license information.
6515+ *
6516+ *)
6517+
6518+structure TimeLimit:
6519+sig
6520+ exception TimeOut
6521+ val timeLimit : Time.time -> ('a -> 'b) -> 'a -> 'b
6522+end =
6523+struct
6524+ exception TimeOut
6525+
6526+ fun timeLimit t f x =
6527+ case Engine.run (Engine.new (fn () => f x), t) of
6528+ Engine.Done res => res
6529+ | Engine.Raise exn => raise exn
6530+ | Engine.TimeOut _ => raise TimeOut
6531+end
6532diff --git a/XML/xml-lexer.lex.sml b/XML/xml-lexer.lex.sml
6533index a162cf4..6652b22 100644
6534--- a/XML/xml-lexer.lex.sml
6535+++ b/XML/xml-lexer.lex.sml
6536@@ -2,6 +2,8 @@ structure XMLLexer = struct
6537
6538 datatype yystart_state =
6539 COM | TAG | LIT1 | LIT2 | INITIAL | DOCTYPE
6540+ local
6541+
6542 structure UserDeclarations =
6543 struct
6544
6545@@ -24,10 +26,8 @@ COM | TAG | LIT1 | LIT2 | INITIAL | DOCTYPE
6546 (* trim m characters from the left and n characters from the right *)
6547 fun trim (m, ss, n) = Substring.string(Substring.triml m (Substring.trimr n ss))
6548
6549-
6550 end
6551
6552- local
6553 datatype yymatch
6554 = yyNO_MATCH
6555 | yyMATCH of ULexBuffer.stream * action * yymatch
6556@@ -105,7 +105,7 @@ Vector.fromList []
6557 (fn (~1, _, oldMatches) => yystuck oldMatches
6558 | (curState, strm, oldMatches) => let
6559 val (transitions, finals') = Vector.sub (yytable, curState)
6560- val finals = map (fn i => Vector.sub (actTable, i)) finals'
6561+ val finals = List.map (fn i => Vector.sub (actTable, i)) finals'
6562 fun tryfinal() =
6563 yystuck (yyactsToMatches (strm, finals, oldMatches))
6564 fun find (c, []) = NONE
6565diff --git a/XML/xml-lib.mlb b/XML/xml-lib.mlb
6566new file mode 100644
6567index 0000000..5b59f54
6568--- /dev/null
6569+++ b/XML/xml-lib.mlb
6570@@ -0,0 +1,167 @@
6571+
6572+ann
6573+ "nonexhaustiveBind warn" "nonexhaustiveMatch warn"
6574+ "redundantBind warn" "redundantMatch warn"
6575+ "sequenceNonUnit ignore"
6576+ "warnUnused false" "forceUsed"
6577+in
6578+
6579+local
6580+ basis l4 =
6581+ bas
6582+ (* $/basis.cm ====> *) $(SML_LIB)/basis/basis.mlb
6583+ end
6584+ basis l11 =
6585+ bas
6586+ (* $/smlnj-lib.cm ====> *) $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
6587+ end
6588+ basis l30 =
6589+ bas
6590+ (* $/ml-lpt-lib.cm ====> *) $(SML_LIB)/mllpt-lib/mllpt-lib.mlb
6591+ end
6592+in
6593+local
6594+ $(SML_LIB)/basis/pervasive.mlb
6595+ local
6596+ open l4
6597+ in
6598+ structure gs_0 = CharVector
6599+ end
6600+ local
6601+ open l4
6602+ in
6603+ structure gs_1 = Char
6604+ end
6605+ local
6606+ open l11
6607+ in
6608+ structure gs_2 = Atom
6609+ end
6610+ local
6611+ xml-schema-sig.sml
6612+ in
6613+ signature gs_3 = XML_SCHEMA
6614+ end
6615+ local
6616+ signature XML_SCHEMA = gs_3
6617+ xml-tree-sig.sml
6618+ in
6619+ signature gs_4 = XML_TREE
6620+ end
6621+ local
6622+ signature XML_SCHEMA = gs_3
6623+ signature XML_TREE = gs_4
6624+ xml-tree-fn.sml
6625+ in
6626+ functor gs_5 = XMLTreeFn
6627+ end
6628+ local
6629+ structure Atom = gs_2
6630+ structure Char = gs_1
6631+ structure CharVector = gs_0
6632+ functor XMLTreeFn = gs_5
6633+ generic-xml-tree.sml
6634+ in
6635+ structure gs_6 = GenericXMLTree
6636+ end
6637+ local
6638+ open l30
6639+ in
6640+ structure gs_7 = AntlrStreamPos
6641+ end
6642+ local
6643+ open l4
6644+ in
6645+ structure gs_8 = TextIO
6646+ end
6647+ local
6648+ open l4
6649+ in
6650+ structure gs_9 = String
6651+ end
6652+ local
6653+ open l4
6654+ in
6655+ structure gs_10 = List
6656+ end
6657+ local
6658+ open l4
6659+ in
6660+ structure gs_11 = Substring
6661+ end
6662+ local
6663+ open l4
6664+ in
6665+ structure gs_12 = Vector
6666+ end
6667+ local
6668+ open l30
6669+ in
6670+ structure gs_13 = ULexBuffer
6671+ end
6672+ local
6673+ open l4
6674+ in
6675+ structure gs_14 = Option
6676+ end
6677+ local
6678+ open l4
6679+ in
6680+ structure gs_15 = Word
6681+ end
6682+ local
6683+ open l30
6684+ in
6685+ structure gs_16 = UTF8
6686+ end
6687+ local
6688+ open l4
6689+ in
6690+ structure gs_17 = Int
6691+ end
6692+ local
6693+ xml-tokens.sml
6694+ in
6695+ structure gs_18 = XMLTokens
6696+ end
6697+ local
6698+ structure AntlrStreamPos = gs_7
6699+ structure Int = gs_17
6700+ structure List = gs_10
6701+ structure Option = gs_14
6702+ structure String = gs_9
6703+ structure Substring = gs_11
6704+ structure TextIO = gs_8
6705+ structure ULexBuffer = gs_13
6706+ structure UTF8 = gs_16
6707+ structure Vector = gs_12
6708+ structure Word = gs_15
6709+ structure XMLTokens = gs_18
6710+ xml-lexer.lex.sml
6711+ in
6712+ structure gs_19 = XMLLexer
6713+ end
6714+ local
6715+ structure AntlrStreamPos = gs_7
6716+ structure List = gs_10
6717+ structure String = gs_9
6718+ structure TextIO = gs_8
6719+ structure XMLLexer = gs_19
6720+ structure XMLTokens = gs_18
6721+ signature XML_TREE = gs_4
6722+ xml-parser-fn.sml
6723+ in
6724+ functor gs_20 = XMLParserFn
6725+ signature gs_21 = XML_PARSER
6726+ end
6727+in
6728+ structure GenericXMLTree = gs_6
6729+ functor XMLParserFn = gs_20
6730+ functor XMLTreeFn = gs_5
6731+ signature XML_PARSER = gs_21
6732+ signature XML_SCHEMA = gs_3
6733+ signature XML_TREE = gs_4
6734+end
6735+end
6736+
6737+end
6738diff --git a/smlnj-lib.mlb b/smlnj-lib.mlb
6739new file mode 100644
6740index 0000000..6a916cf
6741--- /dev/null
6742+++ b/smlnj-lib.mlb
6743@@ -0,0 +1,17 @@
6744+local
6745+ Controls/controls-lib.mlb
6746+ HTML/html-lib.mlb
6747+ HTML4/html4-lib.mlb
6748+ HashCons/hash-cons-lib.mlb
6749+ INet/inet-lib.mlb
6750+ JSON/json-lib.mlb
6751+ PP/pp-lib.mlb
6752+ Reactive/reactive-lib.mlb
6753+ RegExp/regexp-lib.mlb
6754+ SExp/sexp-lib.mlb
6755+ Unix/unix-lib.mlb
6756+ Util/smlnj-lib.mlb
6757+ Util/time-limit.mlb
6758+ XML/xml-lib.mlb
6759+in
6760+end