-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLojban.hs
11734 lines (11528 loc) · 598 KB
/
Lojban.hs
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
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- Parser generated by Pappy - do not edit
module Lojban where
import Pappy.Pos
import Pappy.Parse
import Pappy.Basic
{-# LINE 4 "Lojban.pappy" #-}
import JboSyntax
import Logic hiding (Term,Connective)
import Data.Maybe
import Control.Monad.State
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Char (isSpace, isDigit, digitToInt)
data JekJoik = JJJek LogJboConnective | JJJoik Joik
jjJboCon :: (Maybe Tag) -> JekJoik -> Connective
jjJboCon mtag (JJJek lcon) = jboConnLogOrQ mtag lcon
jjJboCon mtag (JJJoik joik) = JboConnJoik mtag joik
jboConnLogOrQ mtag (LogJboConnective _ 'i' _) = JboConnJoik mtag "??"
jboConnLogOrQ mtag lcon = JboConnLog mtag lcon
{-# LINE 1130 "Lojban.pappy" #-}
data LojbanDerivs = LojbanDerivs {
lojbanSub0 :: LojbanDerivs0,
lojbanSub1 :: LojbanDerivs1,
lojbanSub2 :: LojbanDerivs2,
lojbanSub3 :: LojbanDerivs3,
lojbanSub4 :: LojbanDerivs4,
lojbanChar :: Result LojbanDerivs Char,
lojbanPos :: Pos
}
instance Derivs LojbanDerivs where
dvChar d = lojbanChar d
dvPos d = lojbanPos d
data LojbanDerivs0 = LojbanDerivs0 {
lojbanSubStarRule0 :: Result LojbanDerivs ([String]),
lojbanSubfree :: Result LojbanDerivs (Free),
lojbanSubStarRule1 :: Result LojbanDerivs ([COI]),
lojbanSubPlusRule1 :: Result LojbanDerivs ([COI]),
lojbanSubcoi :: Result LojbanDerivs (COI),
lojbanSubindicator :: Result LojbanDerivs (Free),
lojbanSubStarRule3 :: Result LojbanDerivs ([String]),
lojbanSubtext :: Result LojbanDerivs (Text),
lojbanSubStarRule4 :: Result LojbanDerivs ([Free]),
lojbanSubtext1 :: Result LojbanDerivs ([Paragraph]),
lojbanSubPlusRule4 :: Result LojbanDerivs ([String]),
lojbanSubparagraphs :: Result LojbanDerivs ([Paragraph]),
lojbanSubStarRule5 :: Result LojbanDerivs ([Maybe (Either Fragment Statement)]),
lojbanSubstatementOrFragment :: Result LojbanDerivs (Either Fragment Statement),
lojbanSubstatement :: Result LojbanDerivs (Statement),
lojbanSubStarRule9 :: Result LojbanDerivs ([(Connective, Statement1)]),
lojbanSubstatement2 :: Result LojbanDerivs (Statement1),
lojbanSubtermsAndTail :: Result LojbanDerivs (([Term],BridiTail)),
lojbanSubsubsentence :: Result LojbanDerivs (Subsentence)}
data LojbanDerivs1 = LojbanDerivs1 {
lojbanSubbridiTail :: Result LojbanDerivs (BridiTail),
lojbanSubStarRule13 :: Result LojbanDerivs ([(Connective, BridiTail, [Term])]),
lojbanSubbridiTail2 :: Result LojbanDerivs (BridiTail),
lojbanSubgekSentence :: Result LojbanDerivs (GekSentence),
lojbanSubStarRule14 :: Result LojbanDerivs ([Term]),
lojbanSubPlusRule5 :: Result LojbanDerivs ([Term]),
lojbanSubterms1 :: Result LojbanDerivs (Term),
lojbanSubPlusRule6 :: Result LojbanDerivs ([Term]),
lojbanSubterm :: Result LojbanDerivs (Term),
lojbanSubtermsGikTerms :: Result LojbanDerivs (([Term],Bool,[Term])),
lojbanSubsumti :: Result LojbanDerivs (Sumti),
lojbanSubStarRule15 :: Result LojbanDerivs ([(Connective, Sumti)]),
lojbanSubsumti3 :: Result LojbanDerivs (Sumti),
lojbanSubsumti4 :: Result LojbanDerivs (Sumti),
lojbanSubsumti6 :: Result LojbanDerivs (SumtiAtom),
lojbanSubqualifier :: Result LojbanDerivs (SumtiQualifier),
lojbanSubPlusRule7 :: Result LojbanDerivs ([String]),
lojbanSubStarRule17 :: Result LojbanDerivs ([String])}
data LojbanDerivs2 = LojbanDerivs2 {
lojbanSubStarRule18 :: Result LojbanDerivs ([String]),
lojbanSubStarRule19 :: Result LojbanDerivs ([String]),
lojbanSubsumtiTail1 :: Result LojbanDerivs ((Maybe Mex, Either Selbri Sumti, [RelClause])),
lojbanSubStarRule20 :: Result LojbanDerivs ([RelClause]),
lojbanSubrelativeClause :: Result LojbanDerivs (RelClause),
lojbanSubselbri :: Result LojbanDerivs (Selbri),
lojbanSubselbri2 :: Result LojbanDerivs (Selbri2),
lojbanSubselbri3Tail :: Result LojbanDerivs ((Selbri3 -> Selbri3)),
lojbanSubStarRule21 :: Result LojbanDerivs ([(Connective, Selbri3)]),
lojbanSubselbri5 :: Result LojbanDerivs (Selbri3),
lojbanSubselbri6 :: Result LojbanDerivs (Selbri3),
lojbanSubtanruUnitTail :: Result LojbanDerivs ((Selbri3 -> Selbri3)),
lojbanSubStarRule22 :: Result LojbanDerivs ([Free]),
lojbanSubPlusRule8 :: Result LojbanDerivs ([String]),
lojbanSubtanruUnit2 :: Result LojbanDerivs (TanruUnit),
lojbanSubabstractor :: Result LojbanDerivs (Abstractor),
lojbanSublinks :: Result LojbanDerivs ([Term]),
lojbanSubStarRule23 :: Result LojbanDerivs ([Mex -> Mex]),
lojbanSubmex1 :: Result LojbanDerivs (Mex)}
data LojbanDerivs3 = LojbanDerivs3 {
lojbanSubmex2 :: Result LojbanDerivs (Mex),
lojbanSubrpExpressionTail :: Result LojbanDerivs (Mex -> Mex),
lojbanSubStarRule24 :: Result LojbanDerivs ([(Connective, Operator)]),
lojbanSuboperator1 :: Result LojbanDerivs (Operator),
lojbanSuboperator2 :: Result LojbanDerivs (Operator),
lojbanSubmexOperator :: Result LojbanDerivs (Operator),
lojbanSuboperand :: Result LojbanDerivs (Mex),
lojbanSubStarRule25 :: Result LojbanDerivs ([Mex -> Mex]),
lojbanSuboperand2 :: Result LojbanDerivs (Mex),
lojbanSubPlusRule10 :: Result LojbanDerivs ([Mex]),
lojbanSuboperand3 :: Result LojbanDerivs (Mex),
lojbanSubStarRule26 :: Result LojbanDerivs ([Numeral]),
lojbanSubPlusRule11 :: Result LojbanDerivs ([Int]),
lojbanSubStarRule27 :: Result LojbanDerivs ([Lerfu]),
lojbanSublerfuWord :: Result LojbanDerivs (Lerfu),
lojbanSubek :: Result LojbanDerivs (LogJboConnective),
lojbanSubgihek :: Result LojbanDerivs (LogJboConnective),
lojbanSubjek :: Result LojbanDerivs (LogJboConnective)}
data LojbanDerivs4 = LojbanDerivs4 {
lojbanSubjoik :: Result LojbanDerivs (String),
lojbanSubinterval :: Result LojbanDerivs (String),
lojbanSubgek :: Result LojbanDerivs (Bool -> Connective),
lojbanSubguhek :: Result LojbanDerivs (Bool -> LogJboConnective),
lojbanSubStarRule28 :: Result LojbanDerivs ([(Connective, Tag)]),
lojbanSubPlusRule12 :: Result LojbanDerivs ([DecoratedTagUnit]),
lojbanSubdecoratedTagUnit :: Result LojbanDerivs (DecoratedTagUnit),
lojbanSubPlusRule13 :: Result LojbanDerivs ([()]),
lojbanSubPlusRule14 :: Result LojbanDerivs ([Char]),
lojbanSubPlusRule15 :: Result LojbanDerivs ([Char]),
lojbanSubStarRule29 :: Result LojbanDerivs ([Char]),
lojbanSubStarRule30 :: Result LojbanDerivs ([Char]),
lojbanSubPlusRule16 :: Result LojbanDerivs ([Char]),
lojbanSubBU :: Result LojbanDerivs (String),
lojbanSubGOhA :: Result LojbanDerivs (String),
lojbanSubKOhA :: Result LojbanDerivs (String),
lojbanSubPA :: Result LojbanDerivs (String),
lojbanSubUI :: Result LojbanDerivs (String)}
lojbanStarRule0 = lojbanSubStarRule0 . lojbanSub0
lojbanfree = lojbanSubfree . lojbanSub0
lojbanStarRule1 = lojbanSubStarRule1 . lojbanSub0
lojbanPlusRule1 = lojbanSubPlusRule1 . lojbanSub0
lojbancoi = lojbanSubcoi . lojbanSub0
lojbanindicator = lojbanSubindicator . lojbanSub0
lojbanStarRule3 = lojbanSubStarRule3 . lojbanSub0
lojbantext = lojbanSubtext . lojbanSub0
lojbanStarRule4 = lojbanSubStarRule4 . lojbanSub0
lojbantext1 = lojbanSubtext1 . lojbanSub0
lojbanPlusRule4 = lojbanSubPlusRule4 . lojbanSub0
lojbanparagraphs = lojbanSubparagraphs . lojbanSub0
lojbanStarRule5 = lojbanSubStarRule5 . lojbanSub0
lojbanstatementOrFragment = lojbanSubstatementOrFragment . lojbanSub0
lojbanstatement = lojbanSubstatement . lojbanSub0
lojbanStarRule9 = lojbanSubStarRule9 . lojbanSub0
lojbanstatement2 = lojbanSubstatement2 . lojbanSub0
lojbantermsAndTail = lojbanSubtermsAndTail . lojbanSub0
lojbansubsentence = lojbanSubsubsentence . lojbanSub0
lojbanbridiTail = lojbanSubbridiTail . lojbanSub1
lojbanStarRule13 = lojbanSubStarRule13 . lojbanSub1
lojbanbridiTail2 = lojbanSubbridiTail2 . lojbanSub1
lojbangekSentence = lojbanSubgekSentence . lojbanSub1
lojbanStarRule14 = lojbanSubStarRule14 . lojbanSub1
lojbanPlusRule5 = lojbanSubPlusRule5 . lojbanSub1
lojbanterms1 = lojbanSubterms1 . lojbanSub1
lojbanPlusRule6 = lojbanSubPlusRule6 . lojbanSub1
lojbanterm = lojbanSubterm . lojbanSub1
lojbantermsGikTerms = lojbanSubtermsGikTerms . lojbanSub1
lojbansumti = lojbanSubsumti . lojbanSub1
lojbanStarRule15 = lojbanSubStarRule15 . lojbanSub1
lojbansumti3 = lojbanSubsumti3 . lojbanSub1
lojbansumti4 = lojbanSubsumti4 . lojbanSub1
lojbansumti6 = lojbanSubsumti6 . lojbanSub1
lojbanqualifier = lojbanSubqualifier . lojbanSub1
lojbanPlusRule7 = lojbanSubPlusRule7 . lojbanSub1
lojbanStarRule17 = lojbanSubStarRule17 . lojbanSub1
lojbanStarRule18 = lojbanSubStarRule18 . lojbanSub2
lojbanStarRule19 = lojbanSubStarRule19 . lojbanSub2
lojbansumtiTail1 = lojbanSubsumtiTail1 . lojbanSub2
lojbanStarRule20 = lojbanSubStarRule20 . lojbanSub2
lojbanrelativeClause = lojbanSubrelativeClause . lojbanSub2
lojbanselbri = lojbanSubselbri . lojbanSub2
lojbanselbri2 = lojbanSubselbri2 . lojbanSub2
lojbanselbri3Tail = lojbanSubselbri3Tail . lojbanSub2
lojbanStarRule21 = lojbanSubStarRule21 . lojbanSub2
lojbanselbri5 = lojbanSubselbri5 . lojbanSub2
lojbanselbri6 = lojbanSubselbri6 . lojbanSub2
lojbantanruUnitTail = lojbanSubtanruUnitTail . lojbanSub2
lojbanStarRule22 = lojbanSubStarRule22 . lojbanSub2
lojbanPlusRule8 = lojbanSubPlusRule8 . lojbanSub2
lojbantanruUnit2 = lojbanSubtanruUnit2 . lojbanSub2
lojbanabstractor = lojbanSubabstractor . lojbanSub2
lojbanlinks = lojbanSublinks . lojbanSub2
lojbanStarRule23 = lojbanSubStarRule23 . lojbanSub2
lojbanmex1 = lojbanSubmex1 . lojbanSub2
lojbanmex2 = lojbanSubmex2 . lojbanSub3
lojbanrpExpressionTail = lojbanSubrpExpressionTail . lojbanSub3
lojbanStarRule24 = lojbanSubStarRule24 . lojbanSub3
lojbanoperator1 = lojbanSuboperator1 . lojbanSub3
lojbanoperator2 = lojbanSuboperator2 . lojbanSub3
lojbanmexOperator = lojbanSubmexOperator . lojbanSub3
lojbanoperand = lojbanSuboperand . lojbanSub3
lojbanStarRule25 = lojbanSubStarRule25 . lojbanSub3
lojbanoperand2 = lojbanSuboperand2 . lojbanSub3
lojbanPlusRule10 = lojbanSubPlusRule10 . lojbanSub3
lojbanoperand3 = lojbanSuboperand3 . lojbanSub3
lojbanStarRule26 = lojbanSubStarRule26 . lojbanSub3
lojbanPlusRule11 = lojbanSubPlusRule11 . lojbanSub3
lojbanStarRule27 = lojbanSubStarRule27 . lojbanSub3
lojbanlerfuWord = lojbanSublerfuWord . lojbanSub3
lojbanek = lojbanSubek . lojbanSub3
lojbangihek = lojbanSubgihek . lojbanSub3
lojbanjek = lojbanSubjek . lojbanSub3
lojbanjoik = lojbanSubjoik . lojbanSub4
lojbaninterval = lojbanSubinterval . lojbanSub4
lojbangek = lojbanSubgek . lojbanSub4
lojbanguhek = lojbanSubguhek . lojbanSub4
lojbanStarRule28 = lojbanSubStarRule28 . lojbanSub4
lojbanPlusRule12 = lojbanSubPlusRule12 . lojbanSub4
lojbandecoratedTagUnit = lojbanSubdecoratedTagUnit . lojbanSub4
lojbanPlusRule13 = lojbanSubPlusRule13 . lojbanSub4
lojbanPlusRule14 = lojbanSubPlusRule14 . lojbanSub4
lojbanPlusRule15 = lojbanSubPlusRule15 . lojbanSub4
lojbanStarRule29 = lojbanSubStarRule29 . lojbanSub4
lojbanStarRule30 = lojbanSubStarRule30 . lojbanSub4
lojbanPlusRule16 = lojbanSubPlusRule16 . lojbanSub4
lojbanBU = lojbanSubBU . lojbanSub4
lojbanGOhA = lojbanSubGOhA . lojbanSub4
lojbanKOhA = lojbanSubKOhA . lojbanSub4
lojbanPA = lojbanSubPA . lojbanSub4
lojbanUI = lojbanSubUI . lojbanSub4
lojbanParse :: String -> String -> LojbanDerivs
lojbanParse name text = lojbanDerivs (Pos name 1 1) text
lojbanDerivs :: Pos -> String -> LojbanDerivs
lojbanDerivs pos text = dvs where
dvs = LojbanDerivs
(lojbanDerivs0 dvs)
(lojbanDerivs1 dvs)
(lojbanDerivs2 dvs)
(lojbanDerivs3 dvs)
(lojbanDerivs4 dvs)
chr pos
chr = case text of
[] -> NoParse (msgError (lojbanPos dvs) "end of input")
(c:cs) -> Parsed c (lojbanDerivs (nextPos pos c) cs) (ParseError pos [])
lojbanDerivs0 dvs = LojbanDerivs0
(lojbanParseStarRule0 dvs)
(lojbanParsefree dvs)
(lojbanParseStarRule1 dvs)
(lojbanParsePlusRule1 dvs)
(lojbanParsecoi dvs)
(lojbanParseindicator dvs)
(lojbanParseStarRule3 dvs)
(lojbanParsetext dvs)
(lojbanParseStarRule4 dvs)
(lojbanParsetext1 dvs)
(lojbanParsePlusRule4 dvs)
(lojbanParseparagraphs dvs)
(lojbanParseStarRule5 dvs)
(lojbanParsestatementOrFragment dvs)
(lojbanParsestatement dvs)
(lojbanParseStarRule9 dvs)
(lojbanParsestatement2 dvs)
(lojbanParsetermsAndTail dvs)
(lojbanParsesubsentence dvs)
lojbanDerivs1 dvs = LojbanDerivs1
(lojbanParsebridiTail dvs)
(lojbanParseStarRule13 dvs)
(lojbanParsebridiTail2 dvs)
(lojbanParsegekSentence dvs)
(lojbanParseStarRule14 dvs)
(lojbanParsePlusRule5 dvs)
(lojbanParseterms1 dvs)
(lojbanParsePlusRule6 dvs)
(lojbanParseterm dvs)
(lojbanParsetermsGikTerms dvs)
(lojbanParsesumti dvs)
(lojbanParseStarRule15 dvs)
(lojbanParsesumti3 dvs)
(lojbanParsesumti4 dvs)
(lojbanParsesumti6 dvs)
(lojbanParsequalifier dvs)
(lojbanParsePlusRule7 dvs)
(lojbanParseStarRule17 dvs)
lojbanDerivs2 dvs = LojbanDerivs2
(lojbanParseStarRule18 dvs)
(lojbanParseStarRule19 dvs)
(lojbanParsesumtiTail1 dvs)
(lojbanParseStarRule20 dvs)
(lojbanParserelativeClause dvs)
(lojbanParseselbri dvs)
(lojbanParseselbri2 dvs)
(lojbanParseselbri3Tail dvs)
(lojbanParseStarRule21 dvs)
(lojbanParseselbri5 dvs)
(lojbanParseselbri6 dvs)
(lojbanParsetanruUnitTail dvs)
(lojbanParseStarRule22 dvs)
(lojbanParsePlusRule8 dvs)
(lojbanParsetanruUnit2 dvs)
(lojbanParseabstractor dvs)
(lojbanParselinks dvs)
(lojbanParseStarRule23 dvs)
(lojbanParsemex1 dvs)
lojbanDerivs3 dvs = LojbanDerivs3
(lojbanParsemex2 dvs)
(lojbanParserpExpressionTail dvs)
(lojbanParseStarRule24 dvs)
(lojbanParseoperator1 dvs)
(lojbanParseoperator2 dvs)
(lojbanParsemexOperator dvs)
(lojbanParseoperand dvs)
(lojbanParseStarRule25 dvs)
(lojbanParseoperand2 dvs)
(lojbanParsePlusRule10 dvs)
(lojbanParseoperand3 dvs)
(lojbanParseStarRule26 dvs)
(lojbanParsePlusRule11 dvs)
(lojbanParseStarRule27 dvs)
(lojbanParselerfuWord dvs)
(lojbanParseek dvs)
(lojbanParsegihek dvs)
(lojbanParsejek dvs)
lojbanDerivs4 dvs = LojbanDerivs4
(lojbanParsejoik dvs)
(lojbanParseinterval dvs)
(lojbanParsegek dvs)
(lojbanParseguhek dvs)
(lojbanParseStarRule28 dvs)
(lojbanParsePlusRule12 dvs)
(lojbanParsedecoratedTagUnit dvs)
(lojbanParsePlusRule13 dvs)
(lojbanParsePlusRule14 dvs)
(lojbanParsePlusRule15 dvs)
(lojbanParseStarRule29 dvs)
(lojbanParseStarRule30 dvs)
(lojbanParsePlusRule16 dvs)
(lojbanParseBU dvs)
(lojbanParseGOhA dvs)
(lojbanParseKOhA dvs)
(lojbanParsePA dvs)
(lojbanParseUI dvs)
lojbanwholeStatement :: LojbanDerivs -> Result LojbanDerivs (Statement)
lojbanwholeStatement d =
case lojbanstatement d of
Parsed s pappyDvs1 pappyErr1 ->
case pappyResult3 of
Parsed _ pappyDvs3 pappyErr3 ->
Parsed (s) pappyDvs3 (max pappyErr3 pappyErr1)
NoParse pappyErr3 -> NoParse (max pappyErr3 pappyErr1)
where
pappyResult3 =
pappyAlt5_1 (ParseError (lojbanPos pappyDvs1) []) where
pappyAlt5_1 pappyErr5 =
case lojbanPlusRule4 pappyDvs1 of
Parsed _ pappyDvs7 pappyErr7 ->
Parsed (
()) pappyDvs7 (max pappyErr7 pappyErr5)
NoParse pappyErr7 -> pappyAlt5_2 (max pappyErr7 pappyErr5)
pappyAlt5_2 pappyErr5 =
case lojbanI pappyDvs1 of
Parsed _ pappyDvs7 pappyErr7 ->
Parsed (
()) pappyDvs7 (max pappyErr7 pappyErr5)
NoParse pappyErr7 -> pappyAlt5_3 (max pappyErr7 pappyErr5)
pappyAlt5_3 pappyErr5 =
case lojbanChar pappyDvs1 of
NoParse pappyErr7 ->
Parsed (
()) pappyDvs1 (max pappyErr7 pappyErr5)
Parsed _ _ pappyErr7 -> pappyAlt5_4 (max pappyErr7 pappyErr5)
pappyAlt5_4 pappyErr5 = NoParse pappyErr5
NoParse pappyErr1 -> NoParse pappyErr1
lojbanParseStarRule0 :: LojbanDerivs -> Result LojbanDerivs ([String])
lojbanParseStarRule0 d =
pappyAlt1_1 (ParseError (lojbanPos d) []) where
pappyAlt1_1 pappyErr1 =
case pappyResult3 of
Parsed v pappyDvs3 pappyErr3 ->
case lojbanStarRule0 pappyDvs3 of
Parsed vs pappyDvs5 pappyErr5 ->
Parsed (
v : vs) pappyDvs5 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr5 -> pappyAlt1_2 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr3 -> pappyAlt1_2 (max pappyErr3 pappyErr1)
where
pappyResult3 =
pappyAlt5_1 (ParseError (lojbanPos d) []) where
pappyAlt5_1 pappyErr5 =
case lojbanI d of
Parsed i pappyDvs7 pappyErr7 ->
case pappyResult9 of
Parsed _ pappyDvs9 pappyErr9 ->
case pappyResult11 of
Parsed _ pappyDvs11 pappyErr11 ->
Parsed (i) pappyDvs11 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5])
NoParse pappyErr11 -> pappyAlt5_2 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5])
where
pappyResult11 =
case lojbanBO pappyDvs9 of
Parsed pappyVal13 pappyDvs13 pappyErr13 -> Parsed (Just pappyVal13) pappyDvs13 pappyErr13
NoParse pappyErr13 -> Parsed (Nothing) pappyDvs9 pappyErr13
NoParse pappyErr9 -> pappyAlt5_2 (maximum [pappyErr9,pappyErr7,pappyErr5])
where
pappyResult9 =
case lojbanjoikJek pappyDvs7 of
Parsed pappyVal11 pappyDvs11 pappyErr11 -> Parsed (Just pappyVal11) pappyDvs11 pappyErr11
NoParse pappyErr11 -> Parsed (Nothing) pappyDvs7 pappyErr11
NoParse pappyErr7 -> pappyAlt5_2 (max pappyErr7 pappyErr5)
pappyAlt5_2 pappyErr5 =
case lojbanNIhO d of
Parsed pappyVal7 pappyDvs7 pappyErr7 -> Parsed pappyVal7 pappyDvs7 (max pappyErr7 pappyErr5)
NoParse pappyErr7 -> pappyAlt5_3 (max pappyErr7 pappyErr5)
pappyAlt5_3 pappyErr5 = NoParse pappyErr5
pappyAlt1_2 pappyErr1 =
Parsed (
[]) d pappyErr1
pappyAlt1_3 pappyErr1 = NoParse pappyErr1
lojbantextHead :: LojbanDerivs -> Result LojbanDerivs (())
lojbantextHead d =
case lojbanStarRule0 d of
Parsed _ pappyDvs1 pappyErr1 ->
Parsed (
()) pappyDvs1 pappyErr1
NoParse pappyErr1 -> NoParse pappyErr1
lojbanterminatedText :: LojbanDerivs -> Result LojbanDerivs (Text)
lojbanterminatedText d =
case lojbantext d of
Parsed t pappyDvs1 pappyErr1 ->
case pappyResult3 of
Parsed _ pappyDvs3 pappyErr3 ->
case lojbanChar pappyDvs3 of
Parsed '%' pappyDvs5 _ ->
case lojbanChar pappyDvs5 of
Parsed '%' pappyDvs7 _ ->
case lojbanChar pappyDvs7 of
Parsed '%' pappyDvs9 _ ->
case lojbanChar pappyDvs9 of
Parsed 'E' pappyDvs11 _ ->
case lojbanChar pappyDvs11 of
Parsed 'N' pappyDvs13 _ ->
case lojbanChar pappyDvs13 of
Parsed 'D' pappyDvs15 _ ->
case lojbanChar pappyDvs15 of
Parsed '%' pappyDvs17 _ ->
case lojbanChar pappyDvs17 of
Parsed '%' pappyDvs19 _ ->
case lojbanChar pappyDvs19 of
Parsed '%' pappyDvs21 _ ->
Parsed (t) pappyDvs21 (max pappyErr3 pappyErr1)
_ -> NoParse (max pappyErr3 pappyErr1)
_ -> NoParse (max pappyErr3 pappyErr1)
_ -> NoParse (max pappyErr3 pappyErr1)
_ -> NoParse (max pappyErr3 pappyErr1)
_ -> NoParse (max pappyErr3 pappyErr1)
_ -> NoParse (max pappyErr3 pappyErr1)
_ -> NoParse (max pappyErr3 pappyErr1)
_ -> NoParse (max pappyErr3 pappyErr1)
_ -> NoParse (max pappyErr3 pappyErr1)
NoParse pappyErr3 -> NoParse (max pappyErr3 pappyErr1)
where
pappyResult3 =
case pappyResult5 of
Parsed pappyVal5 pappyDvs5 pappyErr5 -> Parsed (Just pappyVal5) pappyDvs5 pappyErr5
NoParse pappyErr5 -> Parsed (Nothing) pappyDvs1 pappyErr5
where
pappyResult5 =
case lojbanPlusRule13 pappyDvs1 of
Parsed _ pappyDvs7 pappyErr7 ->
Parsed (
()) pappyDvs7 pappyErr7
NoParse pappyErr7 -> NoParse pappyErr7
NoParse pappyErr1 -> NoParse pappyErr1
lojbanParsefree :: LojbanDerivs -> Result LojbanDerivs (Free)
lojbanParsefree d =
pappyAlt1_1 (ParseError (lojbanPos d) []) where
pappyAlt1_1 pappyErr1 =
case lojbanSEI d of
Parsed "sei" pappyDvs3 pappyErr3 ->
case lojbanBU pappyDvs3 of
NoParse pappyErr5 ->
case pappyResult7 of
Parsed mts pappyDvs7 pappyErr7 ->
case lojbanselbri pappyDvs7 of
Parsed sb pappyDvs9 pappyErr9 ->
case pappyResult11 of
Parsed _ pappyDvs11 pappyErr11 ->
Parsed (
Discursive $ BridiTail3 sb $ fromMaybe [] mts) pappyDvs11 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr11 -> pappyAlt1_2 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
where
pappyResult11 =
case lojbanSEhU pappyDvs9 of
Parsed pappyVal13 pappyDvs13 pappyErr13 -> Parsed (Just pappyVal13) pappyDvs13 pappyErr13
NoParse pappyErr13 -> Parsed (Nothing) pappyDvs9 pappyErr13
NoParse pappyErr9 -> pappyAlt1_2 (maximum [pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr7 -> pappyAlt1_2 (maximum [pappyErr7,pappyErr5,pappyErr3,pappyErr1])
where
pappyResult7 =
case pappyResult9 of
Parsed pappyVal9 pappyDvs9 pappyErr9 -> Parsed (Just pappyVal9) pappyDvs9 pappyErr9
NoParse pappyErr9 -> Parsed (Nothing) pappyDvs3 pappyErr9
where
pappyResult9 =
case pappyResult11 of
Parsed ts pappyDvs11 pappyErr11 ->
case pappyResult13 of
Parsed _ pappyDvs13 pappyErr13 ->
Parsed (ts) pappyDvs13 (max pappyErr13 pappyErr11)
NoParse pappyErr13 -> NoParse (max pappyErr13 pappyErr11)
where
pappyResult13 =
case lojbanCU pappyDvs11 of
Parsed pappyVal15 pappyDvs15 pappyErr15 -> Parsed (Just pappyVal15) pappyDvs15 pappyErr15
NoParse pappyErr15 -> Parsed (Nothing) pappyDvs11 pappyErr15
NoParse pappyErr11 -> NoParse pappyErr11
where
pappyResult11 =
case lojbanPlusRule5 pappyDvs3 of
Parsed ts pappyDvs13 pappyErr13 ->
Parsed (
ts ) pappyDvs13 pappyErr13
NoParse pappyErr13 -> NoParse pappyErr13
Parsed _ _ pappyErr5 -> pappyAlt1_2 (maximum [pappyErr5,pappyErr3,pappyErr1])
_ -> pappyAlt1_2 (max (ParseError (lojbanPos d) [Expected "sei"]) pappyErr1)
pappyAlt1_2 pappyErr1 =
case lojbanSEI d of
Parsed "ti'o" pappyDvs3 pappyErr3 ->
case lojbanBU pappyDvs3 of
NoParse pappyErr5 ->
case pappyResult7 of
Parsed mts pappyDvs7 pappyErr7 ->
case lojbanselbri pappyDvs7 of
Parsed sb pappyDvs9 pappyErr9 ->
case pappyResult11 of
Parsed _ pappyDvs11 pappyErr11 ->
Parsed (
MexPrecedence $ BridiTail3 sb $ fromMaybe [] mts) pappyDvs11 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr11 -> pappyAlt1_3 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
where
pappyResult11 =
case lojbanSEhU pappyDvs9 of
Parsed pappyVal13 pappyDvs13 pappyErr13 -> Parsed (Just pappyVal13) pappyDvs13 pappyErr13
NoParse pappyErr13 -> Parsed (Nothing) pappyDvs9 pappyErr13
NoParse pappyErr9 -> pappyAlt1_3 (maximum [pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr7 -> pappyAlt1_3 (maximum [pappyErr7,pappyErr5,pappyErr3,pappyErr1])
where
pappyResult7 =
case pappyResult9 of
Parsed pappyVal9 pappyDvs9 pappyErr9 -> Parsed (Just pappyVal9) pappyDvs9 pappyErr9
NoParse pappyErr9 -> Parsed (Nothing) pappyDvs3 pappyErr9
where
pappyResult9 =
case pappyResult11 of
Parsed ts pappyDvs11 pappyErr11 ->
case pappyResult13 of
Parsed _ pappyDvs13 pappyErr13 ->
Parsed (ts) pappyDvs13 (max pappyErr13 pappyErr11)
NoParse pappyErr13 -> NoParse (max pappyErr13 pappyErr11)
where
pappyResult13 =
case lojbanCU pappyDvs11 of
Parsed pappyVal15 pappyDvs15 pappyErr15 -> Parsed (Just pappyVal15) pappyDvs15 pappyErr15
NoParse pappyErr15 -> Parsed (Nothing) pappyDvs11 pappyErr15
NoParse pappyErr11 -> NoParse pappyErr11
where
pappyResult11 =
case lojbanPlusRule5 pappyDvs3 of
Parsed ts pappyDvs13 pappyErr13 ->
Parsed (
ts ) pappyDvs13 pappyErr13
NoParse pappyErr13 -> NoParse pappyErr13
Parsed _ _ pappyErr5 -> pappyAlt1_3 (maximum [pappyErr5,pappyErr3,pappyErr1])
_ -> pappyAlt1_3 (max (ParseError (lojbanPos d) [Expected "ti'o"]) pappyErr1)
pappyAlt1_3 pappyErr1 =
case pappyResult3 of
Parsed s pappyDvs3 pappyErr3 ->
case lojbanpostClause pappyDvs3 of
Parsed _ pappyDvs5 pappyErr5 ->
case lojbanBU pappyDvs5 of
NoParse pappyErr7 ->
case lojbansumti pappyDvs5 of
Parsed s pappyDvs9 pappyErr9 ->
case pappyResult11 of
Parsed ms pappyDvs11 pappyErr11 ->
case pappyResult13 of
Parsed _ pappyDvs13 pappyErr13 ->
Parsed (
SOI s ms ) pappyDvs13 (maximum [pappyErr13,pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr13 -> pappyAlt1_4 (maximum [pappyErr13,pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
where
pappyResult13 =
case lojbanSEhU pappyDvs11 of
Parsed pappyVal15 pappyDvs15 pappyErr15 -> Parsed (Just pappyVal15) pappyDvs15 pappyErr15
NoParse pappyErr15 -> Parsed (Nothing) pappyDvs11 pappyErr15
NoParse pappyErr11 -> pappyAlt1_4 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
where
pappyResult11 =
case lojbansumti pappyDvs9 of
Parsed pappyVal13 pappyDvs13 pappyErr13 -> Parsed (Just pappyVal13) pappyDvs13 pappyErr13
NoParse pappyErr13 -> Parsed (Nothing) pappyDvs9 pappyErr13
NoParse pappyErr9 -> pappyAlt1_4 (maximum [pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
Parsed _ _ pappyErr7 -> pappyAlt1_4 (maximum [pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr5 -> pappyAlt1_4 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr3 -> pappyAlt1_4 (max pappyErr3 pappyErr1)
where
pappyResult3 =
case lojbanChar d of
Parsed 's' pappyDvs5 _ ->
case lojbanChar pappyDvs5 of
Parsed 'o' pappyDvs7 _ ->
case lojbanChar pappyDvs7 of
Parsed 'i' pappyDvs9 _ ->
Parsed (
"soi") pappyDvs9 (ParseError (lojbanPos pappyDvs9) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs7) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs5) [])
_ -> NoParse (ParseError (lojbanPos d) [])
pappyAlt1_4 pappyErr1 =
case lojbanvocative d of
Parsed cs pappyDvs3 pappyErr3 ->
case lojbanBU pappyDvs3 of
NoParse pappyErr5 ->
case lojbanmaybeRelativeClauses pappyDvs3 of
Parsed rels1 pappyDvs7 pappyErr7 ->
case lojbanselbri pappyDvs7 of
Parsed sb pappyDvs9 pappyErr9 ->
case lojbanmaybeRelativeClauses pappyDvs9 of
Parsed rels2 pappyDvs11 pappyErr11 ->
case pappyResult13 of
Parsed _ pappyDvs13 pappyErr13 ->
Parsed (
Vocative cs $ Just (QAtom [] Nothing (rels1++rels2)
(Description "le" Nothing Nothing (Left sb) [] [])) ) pappyDvs13 (maximum [pappyErr13,pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr13 -> pappyAlt1_5 (maximum [pappyErr13,pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
where
pappyResult13 =
case lojbanDOhU pappyDvs11 of
Parsed pappyVal15 pappyDvs15 pappyErr15 -> Parsed (Just pappyVal15) pappyDvs15 pappyErr15
NoParse pappyErr15 -> Parsed (Nothing) pappyDvs11 pappyErr15
NoParse pappyErr11 -> pappyAlt1_5 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr9 -> pappyAlt1_5 (maximum [pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr7 -> pappyAlt1_5 (maximum [pappyErr7,pappyErr5,pappyErr3,pappyErr1])
Parsed _ _ pappyErr5 -> pappyAlt1_5 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr3 -> pappyAlt1_5 (max pappyErr3 pappyErr1)
pappyAlt1_5 pappyErr1 =
case lojbanvocative d of
Parsed cs pappyDvs3 pappyErr3 ->
case lojbanBU pappyDvs3 of
NoParse pappyErr5 ->
case lojbanname pappyDvs3 of
Parsed n pappyDvs7 pappyErr7 ->
case lojbanmaybeRelativeClauses pappyDvs7 of
Parsed rels pappyDvs9 pappyErr9 ->
case pappyResult11 of
Parsed _ pappyDvs11 pappyErr11 ->
Parsed (
Vocative cs $ Just (QAtom [] Nothing rels (n "la")) ) pappyDvs11 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr11 -> pappyAlt1_6 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
where
pappyResult11 =
case lojbanDOhU pappyDvs9 of
Parsed pappyVal13 pappyDvs13 pappyErr13 -> Parsed (Just pappyVal13) pappyDvs13 pappyErr13
NoParse pappyErr13 -> Parsed (Nothing) pappyDvs9 pappyErr13
NoParse pappyErr9 -> pappyAlt1_6 (maximum [pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr7 -> pappyAlt1_6 (maximum [pappyErr7,pappyErr5,pappyErr3,pappyErr1])
Parsed _ _ pappyErr5 -> pappyAlt1_6 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr3 -> pappyAlt1_6 (max pappyErr3 pappyErr1)
pappyAlt1_6 pappyErr1 =
case lojbanvocative d of
Parsed cs pappyDvs3 pappyErr3 ->
case lojbanBU pappyDvs3 of
NoParse pappyErr5 ->
case lojbanfree pappyDvs3 of
NoParse pappyErr7 ->
case pappyResult9 of
Parsed ms pappyDvs9 pappyErr9 ->
case pappyResult11 of
Parsed _ pappyDvs11 pappyErr11 ->
Parsed (
Vocative cs ms ) pappyDvs11 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr11 -> pappyAlt1_7 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
where
pappyResult11 =
case lojbanDOhU pappyDvs9 of
Parsed pappyVal13 pappyDvs13 pappyErr13 -> Parsed (Just pappyVal13) pappyDvs13 pappyErr13
NoParse pappyErr13 -> Parsed (Nothing) pappyDvs9 pappyErr13
NoParse pappyErr9 -> pappyAlt1_7 (maximum [pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
where
pappyResult9 =
case lojbansumti pappyDvs3 of
Parsed pappyVal11 pappyDvs11 pappyErr11 -> Parsed (Just pappyVal11) pappyDvs11 pappyErr11
NoParse pappyErr11 -> Parsed (Nothing) pappyDvs3 pappyErr11
Parsed _ _ pappyErr7 -> pappyAlt1_7 (maximum [pappyErr7,pappyErr5,pappyErr3,pappyErr1])
Parsed _ _ pappyErr5 -> pappyAlt1_7 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr3 -> pappyAlt1_7 (max pappyErr3 pappyErr1)
pappyAlt1_7 pappyErr1 =
case lojbannumberOrLerfuString d of
Parsed q pappyDvs3 pappyErr3 ->
case pappyResult5 of
Parsed s pappyDvs5 pappyErr5 ->
case lojbanpostClause pappyDvs5 of
Parsed _ pappyDvs7 pappyErr7 ->
Parsed (
MAI q ) pappyDvs7 (maximum [pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr7 -> pappyAlt1_8 (maximum [pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr5 -> pappyAlt1_8 (maximum [pappyErr5,pappyErr3,pappyErr1])
where
pappyResult5 =
case lojbanChar pappyDvs3 of
Parsed 'm' pappyDvs7 _ ->
case lojbanChar pappyDvs7 of
Parsed 'o' pappyDvs9 _ ->
case lojbanChar pappyDvs9 of
Parsed '\'' pappyDvs11 _ ->
case lojbanChar pappyDvs11 of
Parsed 'o' pappyDvs13 _ ->
Parsed (
"mo'o") pappyDvs13 (ParseError (lojbanPos pappyDvs13) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs11) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs9) [])
Parsed 'a' pappyDvs9 _ ->
case lojbanChar pappyDvs9 of
Parsed 'i' pappyDvs11 _ ->
Parsed (
"mai") pappyDvs11 (ParseError (lojbanPos pappyDvs11) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs9) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs7) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs3) [])
NoParse pappyErr3 -> pappyAlt1_8 (max pappyErr3 pappyErr1)
pappyAlt1_8 pappyErr1 =
case pappyResult3 of
Parsed s pappyDvs3 pappyErr3 ->
case lojbanpostClause pappyDvs3 of
Parsed _ pappyDvs5 pappyErr5 ->
case lojbanBU pappyDvs5 of
NoParse pappyErr7 ->
case lojbantext pappyDvs5 of
Parsed t pappyDvs9 pappyErr9 ->
case pappyResult11 of
Parsed _ pappyDvs11 pappyErr11 ->
Parsed (
Bracketed t) pappyDvs11 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr11 -> pappyAlt1_9 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
where
pappyResult11 =
case pappyResult13 of
Parsed pappyVal13 pappyDvs13 pappyErr13 -> Parsed (Just pappyVal13) pappyDvs13 pappyErr13
NoParse pappyErr13 -> Parsed (Nothing) pappyDvs9 pappyErr13
where
pappyResult13 =
case pappyResult15 of
Parsed s pappyDvs15 pappyErr15 ->
case lojbanpostClause pappyDvs15 of
Parsed _ pappyDvs17 pappyErr17 ->
Parsed (s) pappyDvs17 (max pappyErr17 pappyErr15)
NoParse pappyErr17 -> NoParse (max pappyErr17 pappyErr15)
NoParse pappyErr15 -> NoParse pappyErr15
where
pappyResult15 =
case lojbanChar pappyDvs9 of
Parsed 't' pappyDvs17 _ ->
case lojbanChar pappyDvs17 of
Parsed 'o' pappyDvs19 _ ->
case lojbanChar pappyDvs19 of
Parsed 'i' pappyDvs21 _ ->
Parsed (
"toi") pappyDvs21 (ParseError (lojbanPos pappyDvs21) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs19) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs17) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs9) [])
NoParse pappyErr9 -> pappyAlt1_9 (maximum [pappyErr9,pappyErr7,pappyErr5,pappyErr3,pappyErr1])
Parsed _ _ pappyErr7 -> pappyAlt1_9 (maximum [pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr5 -> pappyAlt1_9 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr3 -> pappyAlt1_9 (max pappyErr3 pappyErr1)
where
pappyResult3 =
case lojbanChar d of
Parsed 't' pappyDvs5 _ ->
case lojbanChar pappyDvs5 of
Parsed 'o' pappyDvs7 _ ->
case lojbanChar pappyDvs7 of
Parsed '\'' pappyDvs9 _ ->
case lojbanChar pappyDvs9 of
Parsed 'i' pappyDvs11 _ ->
Parsed (
"to'i") pappyDvs11 (ParseError (lojbanPos pappyDvs11) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs9) [])
_ ->
Parsed (
"to") pappyDvs7 (ParseError (lojbanPos pappyDvs7) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs5) [])
_ -> NoParse (ParseError (lojbanPos d) [])
pappyAlt1_9 pappyErr1 =
case pappyResult3 of
Parsed q pappyDvs3 pappyErr3 ->
Parsed (
XI q) pappyDvs3 (max pappyErr3 pappyErr1)
NoParse pappyErr3 -> pappyAlt1_10 (max pappyErr3 pappyErr1)
where
pappyResult3 =
pappyAlt5_1 (ParseError (lojbanPos d) []) where
pappyAlt5_1 pappyErr5 =
case lojbanXI d of
Parsed _ pappyDvs7 pappyErr7 ->
case lojbanBU pappyDvs7 of
NoParse pappyErr9 ->
case lojbannumberOrLerfuString pappyDvs7 of
Parsed q pappyDvs11 pappyErr11 ->
case pappyResult13 of
Parsed _ pappyDvs13 pappyErr13 ->
Parsed (q) pappyDvs13 (maximum [pappyErr13,pappyErr11,pappyErr9,pappyErr7,pappyErr5])
NoParse pappyErr13 -> pappyAlt5_2 (maximum [pappyErr13,pappyErr11,pappyErr9,pappyErr7,pappyErr5])
where
pappyResult13 =
case lojbanBOI pappyDvs11 of
Parsed pappyVal15 pappyDvs15 pappyErr15 -> Parsed (Just pappyVal15) pappyDvs15 pappyErr15
NoParse pappyErr15 -> Parsed (Nothing) pappyDvs11 pappyErr15
NoParse pappyErr11 -> pappyAlt5_2 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5])
Parsed _ _ pappyErr9 -> pappyAlt5_2 (maximum [pappyErr9,pappyErr7,pappyErr5])
NoParse pappyErr7 -> pappyAlt5_2 (max pappyErr7 pappyErr5)
pappyAlt5_2 pappyErr5 =
case lojbanXI d of
Parsed _ pappyDvs7 pappyErr7 ->
case lojbanBU pappyDvs7 of
NoParse pappyErr9 ->
case lojbanVEI pappyDvs7 of
Parsed _ pappyDvs11 pappyErr11 ->
case lojbanmex pappyDvs11 of
Parsed q pappyDvs13 pappyErr13 ->
case pappyResult15 of
Parsed _ pappyDvs15 pappyErr15 ->
Parsed (q) pappyDvs15 (maximum [pappyErr15,pappyErr13,pappyErr11,pappyErr9,pappyErr7,pappyErr5])
NoParse pappyErr15 -> pappyAlt5_3 (maximum [pappyErr15,pappyErr13,pappyErr11,pappyErr9,pappyErr7,pappyErr5])
where
pappyResult15 =
case lojbanVEhO pappyDvs13 of
Parsed pappyVal17 pappyDvs17 pappyErr17 -> Parsed (Just pappyVal17) pappyDvs17 pappyErr17
NoParse pappyErr17 -> Parsed (Nothing) pappyDvs13 pappyErr17
NoParse pappyErr13 -> pappyAlt5_3 (maximum [pappyErr13,pappyErr11,pappyErr9,pappyErr7,pappyErr5])
NoParse pappyErr11 -> pappyAlt5_3 (maximum [pappyErr11,pappyErr9,pappyErr7,pappyErr5])
Parsed _ _ pappyErr9 -> pappyAlt5_3 (maximum [pappyErr9,pappyErr7,pappyErr5])
NoParse pappyErr7 -> pappyAlt5_3 (max pappyErr7 pappyErr5)
pappyAlt5_3 pappyErr5 = NoParse pappyErr5
pappyAlt1_10 pappyErr1 =
case pappyResult3 of
Parsed _ pappyDvs3 pappyErr3 ->
case lojbanindicator pappyDvs3 of
Parsed i pappyDvs5 pappyErr5 ->
Parsed (i) pappyDvs5 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr5 -> pappyAlt1_11 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr3 -> pappyAlt1_11 (max pappyErr3 pappyErr1)
where
pappyResult3 =
case pappyResult5 of
Parsed pappyVal5 pappyDvs5 pappyErr5 -> Parsed (Just pappyVal5) pappyDvs5 pappyErr5
NoParse pappyErr5 -> Parsed (Nothing) d pappyErr5
where
pappyResult5 =
case pappyResult7 of
Parsed s pappyDvs7 pappyErr7 ->
case lojbanpostClause pappyDvs7 of
Parsed _ pappyDvs9 pappyErr9 ->
Parsed (s) pappyDvs9 (max pappyErr9 pappyErr7)
NoParse pappyErr9 -> NoParse (max pappyErr9 pappyErr7)
NoParse pappyErr7 -> NoParse pappyErr7
where
pappyResult7 =
case lojbanChar d of
Parsed 'f' pappyDvs9 _ ->
case lojbanChar pappyDvs9 of
Parsed 'u' pappyDvs11 _ ->
case lojbanChar pappyDvs11 of
Parsed '\'' pappyDvs13 _ ->
case lojbanChar pappyDvs13 of
Parsed 'e' pappyDvs15 _ ->
Parsed (
"fu'e") pappyDvs15 (ParseError (lojbanPos pappyDvs15) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs13) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs11) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs9) [])
_ -> NoParse (ParseError (lojbanPos d) [])
pappyAlt1_11 pappyErr1 =
case pappyResult3 of
Parsed s pappyDvs3 pappyErr3 ->
case lojbanpostClause pappyDvs3 of
Parsed _ pappyDvs5 pappyErr5 ->
Parsed (
NullFree) pappyDvs5 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr5 -> pappyAlt1_12 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr3 -> pappyAlt1_12 (max pappyErr3 pappyErr1)
where
pappyResult3 =
case lojbanChar d of
Parsed 'b' pappyDvs5 _ ->
case lojbanChar pappyDvs5 of
Parsed 'a' pappyDvs7 _ ->
case lojbanChar pappyDvs7 of
Parsed '\'' pappyDvs9 _ ->
case lojbanChar pappyDvs9 of
Parsed 'e' pappyDvs11 _ ->
Parsed (
"ba'e") pappyDvs11 (ParseError (lojbanPos pappyDvs11) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs9) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs7) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs5) [])
Parsed 'z' pappyDvs5 _ ->
case lojbanChar pappyDvs5 of
Parsed 'a' pappyDvs7 _ ->
case lojbanChar pappyDvs7 of
Parsed '\'' pappyDvs9 _ ->
case lojbanChar pappyDvs9 of
Parsed 'e' pappyDvs11 _ ->
Parsed (
"za'e") pappyDvs11 (ParseError (lojbanPos pappyDvs11) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs9) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs7) [])
_ -> NoParse (ParseError (lojbanPos pappyDvs5) [])
_ -> NoParse (ParseError (lojbanPos d) [])
pappyAlt1_12 pappyErr1 =
case pappyResult3 of
Parsed s pappyDvs3 pappyErr3 ->
case lojbanpostClause pappyDvs3 of
Parsed _ pappyDvs5 pappyErr5 ->
case lojbanBU pappyDvs5 of
NoParse pappyErr7 ->
Parsed (
NullFree) pappyDvs5 (maximum [pappyErr7,pappyErr5,pappyErr3,pappyErr1])
Parsed _ _ pappyErr7 -> pappyAlt1_13 (maximum [pappyErr7,pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr5 -> pappyAlt1_13 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr3 -> pappyAlt1_13 (max pappyErr3 pappyErr1)
where
pappyResult3 =
case lojbanChar d of
Parsed 'y' pappyDvs5 _ ->
Parsed (
"y") pappyDvs5 (ParseError (lojbanPos pappyDvs5) [])
_ -> NoParse (ParseError (lojbanPos d) [])
pappyAlt1_13 pappyErr1 = NoParse pappyErr1
lojbanParseStarRule1 :: LojbanDerivs -> Result LojbanDerivs ([COI])
lojbanParseStarRule1 d =
pappyAlt1_1 (ParseError (lojbanPos d) []) where
pappyAlt1_1 pappyErr1 =
case lojbancoi d of
Parsed v pappyDvs3 pappyErr3 ->
case lojbanStarRule1 pappyDvs3 of
Parsed vs pappyDvs5 pappyErr5 ->
Parsed (
v : vs) pappyDvs5 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr5 -> pappyAlt1_2 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr3 -> pappyAlt1_2 (max pappyErr3 pappyErr1)
pappyAlt1_2 pappyErr1 =
Parsed (
[]) d pappyErr1
pappyAlt1_3 pappyErr1 = NoParse pappyErr1
lojbanParsePlusRule1 :: LojbanDerivs -> Result LojbanDerivs ([COI])
lojbanParsePlusRule1 d =
pappyAlt1_1 (ParseError (lojbanPos d) []) where
pappyAlt1_1 pappyErr1 =
case lojbancoi d of
Parsed v pappyDvs3 pappyErr3 ->
case lojbanPlusRule1 pappyDvs3 of
Parsed vs pappyDvs5 pappyErr5 ->
Parsed (
v : vs) pappyDvs5 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr5 -> pappyAlt1_2 (maximum [pappyErr5,pappyErr3,pappyErr1])
NoParse pappyErr3 -> pappyAlt1_2 (max pappyErr3 pappyErr1)
pappyAlt1_2 pappyErr1 =
case lojbancoi d of
Parsed v pappyDvs3 pappyErr3 ->
Parsed (
[v]) pappyDvs3 (max pappyErr3 pappyErr1)
NoParse pappyErr3 -> pappyAlt1_3 (max pappyErr3 pappyErr1)
pappyAlt1_3 pappyErr1 = NoParse pappyErr1
lojbanvocative :: LojbanDerivs -> Result LojbanDerivs ([COI])
lojbanvocative d =
pappyAlt1_1 (ParseError (lojbanPos d) []) where
pappyAlt1_1 pappyErr1 =
case lojbanStarRule1 d of