forked from RobertHarper/cmyacc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparsemain.cmyacc.sml
814 lines (626 loc) · 28.9 KB
/
parsemain.cmyacc.sml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
functor ParseMainFun
(structure Streamable : STREAMABLE
structure Arg :
sig
type string
type int
type symbol
type label
type constituent
type constituents
type precedence
type production
type productions
type directive
type directives
val cons_directives : directive * directives -> directives
val nil_directives : unit -> directives
val follower_directive : symbol -> directive
val start_directive : symbol -> directive
val nonterminal_directive : symbol * symbol * productions -> directive
val terminal_of_directive : symbol * symbol * precedence -> directive
val terminal_directive : symbol * precedence -> directive
val name_directive : string -> directive
val cons_productions : production * productions -> productions
val nil_productions : unit -> productions
val sole_production : constituents * symbol * precedence -> production
val no_precedence : unit -> precedence
val right_precedence : int -> precedence
val left_precedence : int -> precedence
val empty_precedence : unit -> precedence
val cons_constituents : constituent * constituents -> constituents
val nil_constituents : unit -> constituents
val paren_item : constituent -> constituent
val labeled_item : label * symbol -> constituent
val unlabeled_item : symbol -> constituent
val number_label : int -> label
val ident_label : symbol -> label
val sole_number : int -> int
val sole_ident : string -> symbol
datatype terminal =
IDENT of string
| NUMBER of int
| ARROW
| COLON
| EQUAL
| FOLLOWER
| NAME
| NONTERMINAL
| NOPREC
| LPAREN
| OF
| PRECL
| PRECR
| RPAREN
| START
| TERMINAL
val error : terminal Streamable.t -> exn
end)
:>
sig
val parse : Arg.terminal Streamable.t -> Arg.directives * Arg.terminal Streamable.t
end
=
(*
State 0:
start -> . Directives / 0
16 : Directive -> . NAME IDENT / 1
17 : Directive -> . TERMINAL Ident Precedence / 1
18 : Directive -> . TERMINAL Ident OF Ident Precedence / 1
19 : Directive -> . NONTERMINAL Ident COLON Ident EQUAL Productions / 1
20 : Directive -> . START Ident / 1
21 : Directive -> . FOLLOWER Ident / 1
22 : Directives -> . / 0
23 : Directives -> . Directive Directives / 0
$ => reduce 22
FOLLOWER => shift 2
NAME => shift 4
NONTERMINAL => shift 3
START => shift 6
TERMINAL => shift 5
Directive => goto 1
Directives => goto 7
-----
State 1:
16 : Directive -> . NAME IDENT / 1
17 : Directive -> . TERMINAL Ident Precedence / 1
18 : Directive -> . TERMINAL Ident OF Ident Precedence / 1
19 : Directive -> . NONTERMINAL Ident COLON Ident EQUAL Productions / 1
20 : Directive -> . START Ident / 1
21 : Directive -> . FOLLOWER Ident / 1
22 : Directives -> . / 0
23 : Directives -> . Directive Directives / 0
23 : Directives -> Directive . Directives / 0
$ => reduce 22
FOLLOWER => shift 2
NAME => shift 4
NONTERMINAL => shift 3
START => shift 6
TERMINAL => shift 5
Directive => goto 1
Directives => goto 8
-----
State 2:
0 : Ident -> . IDENT / 1
21 : Directive -> FOLLOWER . Ident / 1
IDENT => shift 10
Ident => goto 9
-----
State 3:
0 : Ident -> . IDENT / 2
19 : Directive -> NONTERMINAL . Ident COLON Ident EQUAL Productions / 1
IDENT => shift 10
Ident => goto 11
-----
State 4:
16 : Directive -> NAME . IDENT / 1
IDENT => shift 12
-----
State 5:
0 : Ident -> . IDENT / 3
17 : Directive -> TERMINAL . Ident Precedence / 1
18 : Directive -> TERMINAL . Ident OF Ident Precedence / 1
IDENT => shift 10
Ident => goto 13
-----
State 6:
0 : Ident -> . IDENT / 1
20 : Directive -> START . Ident / 1
IDENT => shift 10
Ident => goto 14
-----
State 7:
start -> Directives . / 0
$ => accept
-----
State 8:
23 : Directives -> Directive Directives . / 0
$ => reduce 23
-----
State 9:
21 : Directive -> FOLLOWER Ident . / 1
$ => reduce 21
FOLLOWER => reduce 21
NAME => reduce 21
NONTERMINAL => reduce 21
START => reduce 21
TERMINAL => reduce 21
-----
State 10:
0 : Ident -> IDENT . / 4
$ => reduce 0
IDENT => reduce 0
NUMBER => reduce 0
ARROW => reduce 0
COLON => reduce 0
EQUAL => reduce 0
FOLLOWER => reduce 0
NAME => reduce 0
NONTERMINAL => reduce 0
NOPREC => reduce 0
LPAREN => reduce 0
OF => reduce 0
PRECL => reduce 0
PRECR => reduce 0
RPAREN => reduce 0
START => reduce 0
TERMINAL => reduce 0
-----
State 11:
19 : Directive -> NONTERMINAL Ident . COLON Ident EQUAL Productions / 1
COLON => shift 15
-----
State 12:
16 : Directive -> NAME IDENT . / 1
$ => reduce 16
FOLLOWER => reduce 16
NAME => reduce 16
NONTERMINAL => reduce 16
START => reduce 16
TERMINAL => reduce 16
-----
State 13:
9 : Precedence -> . / 1
10 : Precedence -> . PRECL Number / 1
11 : Precedence -> . PRECR Number / 1
12 : Precedence -> . NOPREC / 1
17 : Directive -> TERMINAL Ident . Precedence / 1
18 : Directive -> TERMINAL Ident . OF Ident Precedence / 1
$ => reduce 9
FOLLOWER => reduce 9
NAME => reduce 9
NONTERMINAL => reduce 9
NOPREC => shift 17
OF => shift 16
PRECL => shift 19
PRECR => shift 20
START => reduce 9
TERMINAL => reduce 9
Precedence => goto 18
-----
State 14:
20 : Directive -> START Ident . / 1
$ => reduce 20
FOLLOWER => reduce 20
NAME => reduce 20
NONTERMINAL => reduce 20
START => reduce 20
TERMINAL => reduce 20
-----
State 15:
0 : Ident -> . IDENT / 5
19 : Directive -> NONTERMINAL Ident COLON . Ident EQUAL Productions / 1
IDENT => shift 10
Ident => goto 21
-----
State 16:
0 : Ident -> . IDENT / 6
18 : Directive -> TERMINAL Ident OF . Ident Precedence / 1
IDENT => shift 10
Ident => goto 22
-----
State 17:
12 : Precedence -> NOPREC . / 7
$ => reduce 12
IDENT => reduce 12
NUMBER => reduce 12
ARROW => reduce 12
FOLLOWER => reduce 12
NAME => reduce 12
NONTERMINAL => reduce 12
LPAREN => reduce 12
START => reduce 12
TERMINAL => reduce 12
-----
State 18:
17 : Directive -> TERMINAL Ident Precedence . / 1
$ => reduce 17
FOLLOWER => reduce 17
NAME => reduce 17
NONTERMINAL => reduce 17
START => reduce 17
TERMINAL => reduce 17
-----
State 19:
1 : Number -> . NUMBER / 7
10 : Precedence -> PRECL . Number / 7
NUMBER => shift 24
Number => goto 23
-----
State 20:
1 : Number -> . NUMBER / 7
11 : Precedence -> PRECR . Number / 7
NUMBER => shift 24
Number => goto 25
-----
State 21:
19 : Directive -> NONTERMINAL Ident COLON Ident . EQUAL Productions / 1
EQUAL => shift 26
-----
State 22:
9 : Precedence -> . / 1
10 : Precedence -> . PRECL Number / 1
11 : Precedence -> . PRECR Number / 1
12 : Precedence -> . NOPREC / 1
18 : Directive -> TERMINAL Ident OF Ident . Precedence / 1
$ => reduce 9
FOLLOWER => reduce 9
NAME => reduce 9
NONTERMINAL => reduce 9
NOPREC => shift 17
PRECL => shift 19
PRECR => shift 20
START => reduce 9
TERMINAL => reduce 9
Precedence => goto 27
-----
State 23:
10 : Precedence -> PRECL Number . / 7
$ => reduce 10
IDENT => reduce 10
NUMBER => reduce 10
ARROW => reduce 10
FOLLOWER => reduce 10
NAME => reduce 10
NONTERMINAL => reduce 10
LPAREN => reduce 10
START => reduce 10
TERMINAL => reduce 10
-----
State 24:
1 : Number -> NUMBER . / 8
$ => reduce 1
IDENT => reduce 1
NUMBER => reduce 1
ARROW => reduce 1
COLON => reduce 1
FOLLOWER => reduce 1
NAME => reduce 1
NONTERMINAL => reduce 1
LPAREN => reduce 1
START => reduce 1
TERMINAL => reduce 1
-----
State 25:
11 : Precedence -> PRECR Number . / 7
$ => reduce 11
IDENT => reduce 11
NUMBER => reduce 11
ARROW => reduce 11
FOLLOWER => reduce 11
NAME => reduce 11
NONTERMINAL => reduce 11
LPAREN => reduce 11
START => reduce 11
TERMINAL => reduce 11
-----
State 26:
0 : Ident -> . IDENT / 9
1 : Number -> . NUMBER / 2
2 : Label -> . Ident / 2
3 : Label -> . Number / 2
4 : Constituent -> . Ident / 10
5 : Constituent -> . Label COLON Ident / 10
6 : Constituent -> . LPAREN Constituent RPAREN / 10
7 : Constituents -> . / 11
8 : Constituents -> . Constituent Constituents / 11
13 : Production -> . Constituents ARROW Ident Precedence / 7
14 : Productions -> . / 1
15 : Productions -> . Production Productions / 1
19 : Directive -> NONTERMINAL Ident COLON Ident EQUAL . Productions / 1
$ => reduce 14
IDENT => shift 10
NUMBER => shift 24
ARROW => reduce 7
FOLLOWER => reduce 14
NAME => reduce 14
NONTERMINAL => reduce 14
LPAREN => shift 33
START => reduce 14
TERMINAL => reduce 14
Ident => goto 34
Number => goto 35
Label => goto 32
Constituent => goto 31
Constituents => goto 30
Production => goto 29
Productions => goto 28
-----
State 27:
18 : Directive -> TERMINAL Ident OF Ident Precedence . / 1
$ => reduce 18
FOLLOWER => reduce 18
NAME => reduce 18
NONTERMINAL => reduce 18
START => reduce 18
TERMINAL => reduce 18
-----
State 28:
19 : Directive -> NONTERMINAL Ident COLON Ident EQUAL Productions . / 1
$ => reduce 19
FOLLOWER => reduce 19
NAME => reduce 19
NONTERMINAL => reduce 19
START => reduce 19
TERMINAL => reduce 19
-----
State 29:
0 : Ident -> . IDENT / 9
1 : Number -> . NUMBER / 2
2 : Label -> . Ident / 2
3 : Label -> . Number / 2
4 : Constituent -> . Ident / 10
5 : Constituent -> . Label COLON Ident / 10
6 : Constituent -> . LPAREN Constituent RPAREN / 10
7 : Constituents -> . / 11
8 : Constituents -> . Constituent Constituents / 11
13 : Production -> . Constituents ARROW Ident Precedence / 7
14 : Productions -> . / 1
15 : Productions -> . Production Productions / 1
15 : Productions -> Production . Productions / 1
$ => reduce 14
IDENT => shift 10
NUMBER => shift 24
ARROW => reduce 7
FOLLOWER => reduce 14
NAME => reduce 14
NONTERMINAL => reduce 14
LPAREN => shift 33
START => reduce 14
TERMINAL => reduce 14
Ident => goto 34
Number => goto 35
Label => goto 32
Constituent => goto 31
Constituents => goto 30
Production => goto 29
Productions => goto 36
-----
State 30:
13 : Production -> Constituents . ARROW Ident Precedence / 7
ARROW => shift 37
-----
State 31:
0 : Ident -> . IDENT / 9
1 : Number -> . NUMBER / 2
2 : Label -> . Ident / 2
3 : Label -> . Number / 2
4 : Constituent -> . Ident / 10
5 : Constituent -> . Label COLON Ident / 10
6 : Constituent -> . LPAREN Constituent RPAREN / 10
7 : Constituents -> . / 11
8 : Constituents -> . Constituent Constituents / 11
8 : Constituents -> Constituent . Constituents / 11
IDENT => shift 10
NUMBER => shift 24
ARROW => reduce 7
LPAREN => shift 33
Ident => goto 34
Number => goto 35
Label => goto 32
Constituent => goto 31
Constituents => goto 38
-----
State 32:
5 : Constituent -> Label . COLON Ident / 12
COLON => shift 39
-----
State 33:
0 : Ident -> . IDENT / 13
1 : Number -> . NUMBER / 2
2 : Label -> . Ident / 2
3 : Label -> . Number / 2
4 : Constituent -> . Ident / 14
5 : Constituent -> . Label COLON Ident / 14
6 : Constituent -> . LPAREN Constituent RPAREN / 14
6 : Constituent -> LPAREN . Constituent RPAREN / 12
IDENT => shift 10
NUMBER => shift 24
LPAREN => shift 33
Ident => goto 34
Number => goto 35
Label => goto 32
Constituent => goto 40
-----
State 34:
2 : Label -> Ident . / 2
4 : Constituent -> Ident . / 12
IDENT => reduce 4
NUMBER => reduce 4
ARROW => reduce 4
COLON => reduce 2
LPAREN => reduce 4
RPAREN => reduce 4
-----
State 35:
3 : Label -> Number . / 2
COLON => reduce 3
-----
State 36:
15 : Productions -> Production Productions . / 1
$ => reduce 15
FOLLOWER => reduce 15
NAME => reduce 15
NONTERMINAL => reduce 15
START => reduce 15
TERMINAL => reduce 15
-----
State 37:
0 : Ident -> . IDENT / 15
13 : Production -> Constituents ARROW . Ident Precedence / 7
IDENT => shift 10
Ident => goto 41
-----
State 38:
8 : Constituents -> Constituent Constituents . / 11
ARROW => reduce 8
-----
State 39:
0 : Ident -> . IDENT / 12
5 : Constituent -> Label COLON . Ident / 12
IDENT => shift 10
Ident => goto 42
-----
State 40:
6 : Constituent -> LPAREN Constituent . RPAREN / 12
RPAREN => shift 43
-----
State 41:
9 : Precedence -> . / 7
10 : Precedence -> . PRECL Number / 7
11 : Precedence -> . PRECR Number / 7
12 : Precedence -> . NOPREC / 7
13 : Production -> Constituents ARROW Ident . Precedence / 7
$ => reduce 9
IDENT => reduce 9
NUMBER => reduce 9
ARROW => reduce 9
FOLLOWER => reduce 9
NAME => reduce 9
NONTERMINAL => reduce 9
NOPREC => shift 17
LPAREN => reduce 9
PRECL => shift 19
PRECR => shift 20
START => reduce 9
TERMINAL => reduce 9
Precedence => goto 44
-----
State 42:
5 : Constituent -> Label COLON Ident . / 12
IDENT => reduce 5
NUMBER => reduce 5
ARROW => reduce 5
LPAREN => reduce 5
RPAREN => reduce 5
-----
State 43:
6 : Constituent -> LPAREN Constituent RPAREN . / 12
IDENT => reduce 6
NUMBER => reduce 6
ARROW => reduce 6
LPAREN => reduce 6
RPAREN => reduce 6
-----
State 44:
13 : Production -> Constituents ARROW Ident Precedence . / 7
$ => reduce 13
IDENT => reduce 13
NUMBER => reduce 13
ARROW => reduce 13
FOLLOWER => reduce 13
NAME => reduce 13
NONTERMINAL => reduce 13
LPAREN => reduce 13
START => reduce 13
TERMINAL => reduce 13
-----
lookahead 0 = $
lookahead 1 = $ FOLLOWER NAME NONTERMINAL START TERMINAL
lookahead 2 = COLON
lookahead 3 = $ FOLLOWER NAME NONTERMINAL NOPREC OF PRECL PRECR START TERMINAL
lookahead 4 = $ IDENT NUMBER ARROW COLON EQUAL FOLLOWER NAME NONTERMINAL NOPREC LPAREN OF PRECL PRECR RPAREN START TERMINAL
lookahead 5 = EQUAL
lookahead 6 = $ FOLLOWER NAME NONTERMINAL NOPREC PRECL PRECR START TERMINAL
lookahead 7 = $ IDENT NUMBER ARROW FOLLOWER NAME NONTERMINAL LPAREN START TERMINAL
lookahead 8 = $ IDENT NUMBER ARROW COLON FOLLOWER NAME NONTERMINAL LPAREN START TERMINAL
lookahead 9 = IDENT NUMBER ARROW COLON LPAREN
lookahead 10 = IDENT NUMBER ARROW LPAREN
lookahead 11 = ARROW
lookahead 12 = IDENT NUMBER ARROW LPAREN RPAREN
lookahead 13 = COLON RPAREN
lookahead 14 = RPAREN
lookahead 15 = $ IDENT NUMBER ARROW FOLLOWER NAME NONTERMINAL NOPREC LPAREN PRECL PRECR START TERMINAL
*)
struct
local
structure Value = struct
datatype nonterminal =
nonterminal
| string of Arg.string
| int of Arg.int
| symbol of Arg.symbol
| label of Arg.label
| constituent of Arg.constituent
| constituents of Arg.constituents
| precedence of Arg.precedence
| production of Arg.production
| productions of Arg.productions
| directive of Arg.directive
| directives of Arg.directives
end
structure ParseEngine = ParseEngineFun (structure Streamable = Streamable
type terminal = Arg.terminal
type value = Value.nonterminal
val dummy = Value.nonterminal
fun read terminal =
(case terminal of
Arg.IDENT x => (1, Value.string x)
| Arg.NUMBER x => (2, Value.int x)
| Arg.ARROW => (3, Value.nonterminal)
| Arg.COLON => (4, Value.nonterminal)
| Arg.EQUAL => (5, Value.nonterminal)
| Arg.FOLLOWER => (6, Value.nonterminal)
| Arg.NAME => (7, Value.nonterminal)
| Arg.NONTERMINAL => (8, Value.nonterminal)
| Arg.NOPREC => (9, Value.nonterminal)
| Arg.LPAREN => (10, Value.nonterminal)
| Arg.OF => (11, Value.nonterminal)
| Arg.PRECL => (12, Value.nonterminal)
| Arg.PRECR => (13, Value.nonterminal)
| Arg.RPAREN => (14, Value.nonterminal)
| Arg.START => (15, Value.nonterminal)
| Arg.TERMINAL => (16, Value.nonterminal)
)
)
in
val parse = ParseEngine.parse (
ParseEngine.next5x1 "h\128\128\128\128\128\131\133\132\128\128\128\128\128\128\135\134\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128h\128\128\128\128\128\131\133\132\128\128\128\128\128\128\135\134\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\139\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\139\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\141\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\139\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\139\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\127\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128g\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128i\128\128\128\128\128iii\128\128\128\128\128\128ii\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128~~~~~~~~~~~~~~~~~\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\144\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128n\128\128\128\128\128nnn\128\128\128\128\128\128nn\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128u\128\128\128\128\128uuu\146\128\145\148\149\128uu\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128j\128\128\128\128\128jjj\128\128\128\128\128\128jj\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\139\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\139\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128rrrr\128\128rrr\128r\128\128\128\128rr\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128m\128\128\128\128\128mmm\128\128\128\128\128\128mm\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\153\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\153\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\155\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128u\128\128\128\128\128uuu\146\128\128\148\149\128uu\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128tttt\128\128ttt\128t\128\128\128\128tt\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128}}}}}\128}}}\128}\128\128\128\128}}\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128ssss\128\128sss\128s\128\128\128\128ss\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128p\139\153w\128\128ppp\128\162\128\128\128\128pp\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128l\128\128\128\128\128lll\128\128\128\128\128\128ll\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128k\128\128\128\128\128kkk\128\128\128\128\128\128kk\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128p\139\153w\128\128ppp\128\162\128\128\128\128pp\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\166\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\139\153w\128\128\128\128\128\128\162\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\168\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\139\153\128\128\128\128\128\128\128\162\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128zzz|\128\128\128\128\128z\128\128\128z\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128{\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128o\128\128\128\128\128ooo\128\128\128\128\128\128oo\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\139\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128v\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\139\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\172\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128uuuu\128\128uuu\146u\128\148\149\128uu\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128yyy\128\128\128\128\128\128y\128\128\128y\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128xxx\128\128\128\128\128\128x\128\128\128x\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128qqqq\128\128qqq\128q\128\128\128\128qq\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128",
ParseEngine.next5x1 "\128\128\128\128\128\128\128\128\129\135\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\129\136\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\137\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\139\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\141\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\142\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\146\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\149\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\150\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\151\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\153\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\155\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\162\163\160\159\158\128\157\156\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\162\163\160\159\158\128\157\164\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\162\163\160\159\166\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\162\163\160\168\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\169\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\170\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\172\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128\128",
Vector.fromList [(0,1,(fn Value.string(arg0)::rest => Value.symbol(Arg.sole_ident arg0)::rest|_=>raise (Fail "bad parser"))),
(1,1,(fn Value.int(arg0)::rest => Value.int(Arg.sole_number arg0)::rest|_=>raise (Fail "bad parser"))),
(2,1,(fn Value.symbol(arg0)::rest => Value.label(Arg.ident_label arg0)::rest|_=>raise (Fail "bad parser"))),
(2,1,(fn Value.int(arg0)::rest => Value.label(Arg.number_label arg0)::rest|_=>raise (Fail "bad parser"))),
(3,1,(fn Value.symbol(arg0)::rest => Value.constituent(Arg.unlabeled_item arg0)::rest|_=>raise (Fail "bad parser"))),
(3,3,(fn Value.symbol(arg0)::_::Value.label(arg1)::rest => Value.constituent(Arg.labeled_item {2=arg0,1=arg1})::rest|_=>raise (Fail "bad parser"))),
(3,3,(fn _::Value.constituent(arg0)::_::rest => Value.constituent(Arg.paren_item arg0)::rest|_=>raise (Fail "bad parser"))),
(4,0,(fn rest => Value.constituents(Arg.nil_constituents {})::rest)),
(4,2,(fn Value.constituents(arg0)::Value.constituent(arg1)::rest => Value.constituents(Arg.cons_constituents {2=arg0,1=arg1})::rest|_=>raise (Fail "bad parser"))),
(5,0,(fn rest => Value.precedence(Arg.empty_precedence {})::rest)),
(5,2,(fn Value.int(arg0)::_::rest => Value.precedence(Arg.left_precedence arg0)::rest|_=>raise (Fail "bad parser"))),
(5,2,(fn Value.int(arg0)::_::rest => Value.precedence(Arg.right_precedence arg0)::rest|_=>raise (Fail "bad parser"))),
(5,1,(fn _::rest => Value.precedence(Arg.no_precedence {})::rest|_=>raise (Fail "bad parser"))),
(6,4,(fn Value.precedence(arg0)::Value.symbol(arg1)::_::Value.constituents(arg2)::rest => Value.production(Arg.sole_production {3=arg0,2=arg1,1=arg2})::rest|_=>raise (Fail "bad parser"))),
(7,0,(fn rest => Value.productions(Arg.nil_productions {})::rest)),
(7,2,(fn Value.productions(arg0)::Value.production(arg1)::rest => Value.productions(Arg.cons_productions {2=arg0,1=arg1})::rest|_=>raise (Fail "bad parser"))),
(8,2,(fn Value.string(arg0)::_::rest => Value.directive(Arg.name_directive arg0)::rest|_=>raise (Fail "bad parser"))),
(8,3,(fn Value.precedence(arg0)::Value.symbol(arg1)::_::rest => Value.directive(Arg.terminal_directive {2=arg0,1=arg1})::rest|_=>raise (Fail "bad parser"))),
(8,5,(fn Value.precedence(arg0)::Value.symbol(arg1)::_::Value.symbol(arg2)::_::rest => Value.directive(Arg.terminal_of_directive {3=arg0,2=arg1,1=arg2})::rest|_=>raise (Fail "bad parser"))),
(8,6,(fn Value.productions(arg0)::_::Value.symbol(arg1)::_::Value.symbol(arg2)::_::rest => Value.directive(Arg.nonterminal_directive {3=arg0,2=arg1,1=arg2})::rest|_=>raise (Fail "bad parser"))),
(8,2,(fn Value.symbol(arg0)::_::rest => Value.directive(Arg.start_directive arg0)::rest|_=>raise (Fail "bad parser"))),
(8,2,(fn Value.symbol(arg0)::_::rest => Value.directive(Arg.follower_directive arg0)::rest|_=>raise (Fail "bad parser"))),
(9,0,(fn rest => Value.directives(Arg.nil_directives {})::rest)),
(9,2,(fn Value.directives(arg0)::Value.directive(arg1)::rest => Value.directives(Arg.cons_directives {2=arg0,1=arg1})::rest|_=>raise (Fail "bad parser")))],
(fn Value.directives x => x | _ => raise (Fail "bad parser")), Arg.error)
end
end