-
Notifications
You must be signed in to change notification settings - Fork 3
/
zantufa-0.7-cekitaujoizai.js.peg
1695 lines (1190 loc) · 86.3 KB
/
zantufa-0.7-cekitaujoizai.js.peg
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
// camxes.js.peg
// Copyright (c) 2013, 2014 Masato Hagiwara
// https://github.com/mhagiwara/camxes.js
//
// camxes.js can be used, modified, and re-distributed under MIT license.
// See LICENSE for the details.
// //////// _la guskant cu co'a galfi_20150604
// This is a Parsing Expression Grammar for Lojban.
// See http://bford.info/packrat/
//
// All rules have the form:
//
// name = peg_expression
//
// which means that the grammatical construct "name" is parsed using
// "peg_expression".
//
// 1) Names in lower case are grammatical constructs.
// 2) Names in UPPER CASE are selma'o (lexeme) names, and are terminals.
// 3) Concatenation is expressed by juxtaposition with no operator symbol.
// 4) / represents *ORDERED* alternation (choice). If the first
// option succeeds, the others will never be checked.
// 5) ? indicates that the element to the left is optional.
// 6) * represents optional repetition of the construct to the left.
// 7) + represents one_or_more repetition of the construct to the left.
// 8) () serves to indicate the grouping of the other operators.
//
// Longest match wins.
// How to compile using Node.js: (Added by Masato Hagiwara)
// // load peg.js and the file system module
// > var PEG = require("pegjs")
// > var fs = require("fs")
// // read peg and build a parser
// > var camxes_peg = fs.readFileSync("/path/to/camxes.js.peg").toString();
// > var camxes = PEG.buildParser(camxes_peg, {cache: true});
// // test it
// > camxes.parse("ko'a broda");
// [ 'text',
// [ 'text_1',
// [ 'paragraphs', [Object] ] ] ]
// // write to a file
// > fs.writeFileSync("/path/to/camxes.js", camxes.toSource());
// ___ GRAMMAR ___
{
var _g_zoi_delim;
function _join(arg)
{
if (typeof(arg) == "string")
return arg;
else
{
var ret = "";
for (var v in arg) { ret += _join(arg[v]); }
return ret;
}
}
function _node(label, arg)
{
var ret = [];
if (label != undefined) ret.push( label );
if (typeof( arg ) == "object" && typeof( arg[0] ) == "string" && arg[0] != "")
{
ret.push( arg );
return ret;
}
return _node_int(label, arg);
}
function _node_int(label, arg)
{
if (typeof( arg ) == "string")
return arg;
var ret = [];
if (label != undefined) ret.push( label );
for (var v in arg)
{
if (arg[v].length != 0)
ret.push( _node_int( undefined, arg[v] ) );
}
return ret;
}
function _node2(label, arg1, arg2)
{
return [label].concat(_node(arg1)).concat(_node(arg2));
}
function _node_nonempty(label, arg)
{
var _n = _node(label, arg);
return (_n.length == 1 && _n[0] == label) ? [] : _n;
}
// === ZOI functions === //
function _zoi_assign_delim(word) {
var a = word.toString().split(",");
if (a.length > 0) _g_zoi_delim = a[a.length - 1];
else _g_zoi_delim = "";
return word;
}
function _zoi_check_quote(word) {
if (typeof(word) == "object") word = word.toString();
if (!is_string(word)) {
alert("ZOI word is not a string");
return false;
} else {
return (word.toLowerCase().replace(/,/gm,"").replace(/h/g, "'") === _g_zoi_delim);
}
}
function _zoi_check_delim(word) {
if (typeof(word) == "object") word = word.toString();
if (!is_string(word)) {
alert("ZOI word is not a string");
return false;
} else {
word = word.split(",");
if (word.length > 0) word = word[word.length - 1];
else word = "";
return (word === _g_zoi_delim);
}
}
function is_string(v) {
return typeof v.valueOf() === 'string';
}
}
// //////// _vimcu so'a zoizoi free* zoi ki'u lo nu vo'e cmina la'o zoi post_clause zoi_20150728UTC
// //////// _galfi ro zo IhAU zo IAU ma'i lo si'o sampu_20150728UTC
// text //////// _vimcu zoizoi indicators? zoi noi la'e ke'a co'a cmima la'o zoi free zoi_20150728UTC
// text //////// _vimcu zoizoi NAI_clause* zoi_20150728UTC
text = expr:(intro_null free* paragraphs? si_clause? faho_clause EOF?) {return _node_nonempty("text", expr);}
intro_null = expr:(spaces? su_clause* intro_si_clause) {return _node_nonempty("intro_null", expr); }
intro_si_clause = expr:(si_clause? SI*) {return _node_nonempty("intro_si_clause", expr); }
faho_clause = expr:((FAhO_clause dot_star)?) {return _node("faho_clause", expr);}
// Please note that the "text_1" item in the text_1 production does
// *not* match the BNF. This is due to a bug in the BNF. The change
// here was made to match grammar.300
// // // curmi lu niho je li'u pei
paragraphs = expr:((NIhO_clause+ paragraph?)+ / paragraph (NIhO_clause+ paragraph?)*) {return _node("paragraphs", expr);}
paragraph = expr:((I_clause (statement_terms / fragment)?)+ / (statement_terms / fragment) (I_clause (statement_terms / fragment)?)*) {return _node("paragraph", expr);}
// // // la'a zo VAU na'e se nitcu isemu'i bo na'e la'o zoi tail_terms zoi cu se lidne
statement_terms = expr:(statement IAU_elidible terms?) {return _node("statement_terms", expr);}
statement = expr:(statement_1 / prenex statement) {return _node("statement", expr);}
statement_1 = expr:(statement_2 (I_clause joik statement_2)*) {return _node("statement_1", expr);}
statement_2 = expr:(statement_3 (I_clause joik? tag? BO_clause statement_3)*) {return _node("statement_2", expr);}
// statement_3 //////// _cipra galfi zoizoi gek_statement zoi zoizoi terms? gek_statement zoi tezu'e tu'a lu da ge de broda gi di brode li'u i ku'i xruti tezu'e lo nu tolcru tu'a lu ta ge ti zo'u broda gi tu brode li'u_20150803UTC_
statement_3 = expr:(sentence / tag? TUhE_clause paragraphs TUhU_elidible / gek_statement) {return _node("statement_3", expr);}
// // // ganai da'i curmi lo nu la gek lidne no gik gi lu ga ra broda gi ri brode li'u na se genturfa'i iki'ubo lo nu zo ga kuspe zo ra po'o i ka'e stika sepi'o zoi zoi !term zoi mu'a i ku'i lo gerna cu co'a no'e sampu
gek_statement = expr:(gek statement (gik statement)+ GIhI_elidible) {return _node("gek_statement", expr);}
// ([by BOI] VAU)
// ([by BOI] [joi {pa BOI}])
// ([{by BOI} {joi <pa BOI> <by BOI>}] VAU)
// ([{vei <(¹by BOI¹) (¹joi [pa BOI]¹)> VEhO} {by BOI}] VAU)
// (vei [{by BOI} {joi <pa BOI>} {joi <by BOI>}] VEhO)
// ([{<by BOI> <joi (¹pa BOI¹) (¹by BOI¹)>} da] VAU)
// fragment //////// _va'o lo nu la'o zoi NA_clause KU_elidible zoi cu sumsmi kei za'a na gendra fa mu'a lu naja li'u isemu'ibo zoizoi NA_clause !terms !KU / zoi lidne la terms (to zoizoi !JOI_clause zoi cu se vimcu toi) ije zoizoi / joik / ek / gihek zoi lidne zoizoi NA_clause !terms !KU zoi_20150731UTC
fragment = expr:(prenex / joik / ek / gihek / NA_clause !terms !KU / terms VAU_elidible !mex / mex / relative_clauses / links / linkargs) {return _node("fragment", expr);}
prenex = expr:(terms ZOhU_clause) {return _node("prenex", expr);}
// sentence //////// _galfi fi zoizoi terms? (CU_elidible bridi_tail / gek sentence (gik sentence)+ GIhI_elidible) zoi tezuhe tu'a lu ([ta {ge <tu (¹CU [brode VAU]¹)> <gi (¹CU [brodo VAU]¹)> GIhI}] IAU) li'u_20150803UTC_
sentence = expr:(terms? (CU_elidible bridi_tail / gek sentence (gik sentence)+ GIhI_elidible)) {return _node("sentence", expr);}
bridi_tail = expr:(bridi_tail_1 (joik_gihek tag? CU_elidible bridi_tail_1)*) {return _node("bridi_tail", expr);}
bridi_tail_1 = expr:(bridi_tail_2 (joik_gihek !(tag? BO_clause) !(tag? KE_clause) CU_elidible bridi_tail_2 tail_terms)*) {return _node("bridi_tail_1", expr);}
bridi_tail_2 = expr:(bridi_tail_3 (joik_gihek tag? BO_clause CU_elidible bridi_tail_3 tail_terms)*) {return _node("bridi_tail_2", expr);}
bridi_tail_3 = expr:(KE_clause !(selbri_2 KEhE) bridi_tail KEhE_elidible tail_terms / selbri tail_terms / gek_bridi_tail) {return _node("bridi_tail_3", expr);}
// // // za'a nitcu fa zoizoi / tag* KE_clause free* gek_bridi_tail KEhE_elidible free* / NA_clause free* gek_bridi_tail zoi
// gek_bridi_tail //////// _cipra tu'a zoizoi terms? zoi i ku'i xruti iki'ubo lo nu zo CU lidne la gek.term.bridi_tail cu na xamgu_20150803UTC_
gek_bridi_tail = expr:(gek bridi_tail (gik bridi_tail)+ GIhI_elidible tail_terms / tag* KE_clause gek_bridi_tail KEhE_elidible / NA_clause gek_bridi_tail) {return _node("gek_bridi_tail", expr);}
//// EXP-FIX: tag? KE --> tag* KE
//// EXP: Bridi-tail nonabsorbable terms implementation
tail_terms = expr:(term* VAU_elidible) {return _node_nonempty("tail_terms", expr); }
// // // aunai curmi lo'u terms joi terms le'u ki'u lo nu na'e sarcu fa lo nu jimpe fi lo'u ke gauku naku ke'e je ke faku caku ke'e le'u i ei la joik cu pagbu la term jenai la terms iji'a ganai da'i tezu'e lo nu sampu kei la term cu curmi tu'a zoizoi joik_ek? zoi gi lo drata ke gerna pagbu cu co'u plixau mu'u ra'ai goi
terms = expr:(term+) {return _node("terms", expr);}
/*** EXP-SELBRITCITA-FIX ***/
term = expr:(term_1 (joik_ek term_1)*) {return _node("term", expr);}
term_1 = expr:(term_2 (joik_ek? BO_clause term_2)*) {return _node("term_1", expr);}
// term_2 //////// _galfi zoizoi KU_clause zoi zoizoi KU_elidible zoi_20150731UTC
// term_2 //////// _galfi zoizoi NA_clause KU_elidible zoi zoizoi NA_clause !bridi_tail KU_elidible zoi_20150731UTC
term_2 = expr:(XOI_clause statement SEhU_elidible / KE_clause term+ KEhE_elidible / tag_term / !tag sumti / NA_clause !bridi_tail KU_elidible / gek_term) {return _node("term_2", expr);}
tag_term = expr:(!gek (tag !(!tag selbri) !gek_bridi_tail / FA_clause (joik FA_clause)* !tanru_unit_2) (sumti / KU_elidible)) {return _node("tag_term", expr);}
/*** END EXP-SELBRITCITA-FIX ***/
gek_term = expr:(gek term+ (gik term+)+ GIhI_elidible) {return _node("gek_term", expr);}
/*** EXP-SELBRITCITA-FIX ***/
/*** END EXP-SELBRITCITA-FIX ***/
sumti = expr:(sumti_1 (VUhO_clause relative_clauses)?) {return _node("sumti", expr);}
sumti_1 = expr:(sumti_2 (joik_ek sumti_2)*) {return _node("sumti_1", expr);}
sumti_2 = expr:(sumti_3 (joik_ek? tag? BO_clause sumti_3)*) {return _node("sumti_2", expr);}
sumti_3 = expr:(KE_clause sumti KEhE_elidible / sumti_4 / gek sumti (gik sumti)+ GIhI_elidible) {return _node("sumti_3", expr);}
sumti_4 = expr:(quantifier? sumti_5 relative_clauses? / quantifier selbri KU_elidible relative_clauses?) {return _node("sumti_4", expr);}
// // // !(!joik_ek operator) : tu'a zoizoi !joik_ek zoi cu sarcu lo nu lu by joi (vei) pa (ve'o) by li'u cu sumti
// sumti_5 //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
// sumti_5 //////// _cipra : NAhE_clause !(!sumti_5 operand) sumti_3 > NAhE_clause sumti_3_20150728UTC
// sumti_5 //////// _jalge sei za'a xamgu : ([{<na'e (¹[ny BOI] [su'i {pa BOI}]¹) (¹ny BOI¹)> <je (¹my BOI¹)>} VAU] [i {<na'e bo> <(¹[{ny BOI} {su'i <pa BOI>}] [ny BOI]¹) (¹je [my BOI]¹)> LUhU} VAU] [i {<(¹vei [{na'e <ny BOI>} {su'i <pa BOI>}] VEhO¹) (¹ny BOI¹)> <je (¹my BOI¹)>} VAU] [i {<vei (¹[na'e bo] [{ny BOI} {su'i <pa BOI>}] LUhU¹) VEhO> <ny BOI>} {je <my BOI>}] VAU)_20150728UTC
sumti_5 = expr:(RAhOI_clause / ZO_clause / ZOI_clause / LOhU_clause / lerfu_string BOI_elidible !(BO_clause* operand* !(joik_ek sumti) operator) !(operand KEhE) / LU_clause text LIhU_elidible / (LAhE_clause / NAhE_clause BO_clause) relative_clauses? sumti LUhU_elidible / KOhA_clause / LOhOI_clause (joik LOhOI_clause)* statement KUhAU_elidible / LE_clause sumti_tail KU_elidible / li_clause / NAhE_clause sumti_3) {return _node("sumti_5", expr);}
li_clause = expr:(LI_clause mex LOhO_elidible) {return _node("li_clause", expr); }
sumti_tail = expr:((sumti_5 relative_clauses?)? sumti_tail_1 / relative_clauses sumti_tail_1) {return _node("sumti_tail", expr); }
sumti_tail_1 = expr:(selbri relative_clauses? / quantifier selbri relative_clauses? / quantifier sumti) {return _node("sumti_tail_1", expr);}
relative_clauses = expr:(relative_clause (joik? relative_clause)*) {return _node("relative_clauses", expr); }
relative_clause = expr:(GOI_clause term GEhU_elidible / NOI_clause statement KUhO_elidible) {return _node("relative_clause", expr); }
// selbri //////// _galfi zoizoi tag? zoi zoizoi (!gek tag)? zoi tezu'e lonu stika tu'a lu ([{CU <(¹gi pu¹) broda (¹gi brode¹) GIhI> VAU} IAU] [i {CU <pu gi> <broda VAU> <gi (¹brode VAU¹)> GIhI VAU} IAU]) li'u i jalge fa tu'a lu ([CU {<pu gi> broda <gi brode> GIhI} VAU] IAU) li'u_20150730UTC
selbri = expr:((!gek tag)? selbri_1) {return _node("selbri", expr); }
selbri_1 = expr:(selbri_2 / NA_clause selbri) {return _node("selbri_1", expr); }
selbri_2 = expr:(selbri_3 (CO_clause selbri_3)*) {return _node("selbri_2", expr); }
selbri_3 = expr:(selbri_4+) {return _node("selbri_3", expr); }
selbri_4 = expr:(selbri_5 (joik selbri_5)*) {return _node("selbri_4", expr); }
// // // xu lo sumti ja lo term zo'u gauku zo BO tsamau lo'u joi bo le'u sei la selbri_5 joi la selbri_6 cu se simsa
selbri_5 = expr:(selbri_6 (joik tag? BO_clause selbri_6)*) {return _node("selbri_5", expr); }
selbri_6 = expr:(tanru_unit (BO_clause tanru_unit)*) {return _node("selbri_6", expr); }
tanru_unit = expr:(tanru_unit_1 (CEI_clause tanru_unit_1)*) {return _node("tanru_unit", expr); }
tanru_unit_1 = expr:(tanru_unit_2 linkargs?) {return _node("tanru_unit_1", expr); }
// tanru_unit_2 //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
// tanru_unit_2 //////// _vimcu zoizoi RAhO_clause? zoi_20150728UTC
tanru_unit_2 = expr:(CMEVLA_clause / BRIVLA_clause / GOhA_clause / KE_clause selbri_2 KEhE_elidible / NAhE_clause? gek selbri_2 (gik selbri_2)+ !term GIhI_elidible / GOhOI_clause / ME_clause (sumti / operator+ / mex / tag) MEhU_elidible MOI_clause? / mex MOI_clause / (FA_clause (joik FA_clause)* / SE_clause) tanru_unit_2 / JAI_clause tag? tanru_unit_2 / NAhE_clause tanru_unit_2 / NU_clause (joik NU_clause)* statement KEI_elidible) {return _node("tanru_unit_2", expr); }
linkargs = expr:(BE_clause term links? BEhO_elidible) {return _node("linkargs", expr);}
links = expr:(BEI_clause term links?) {return _node("links", expr);}
quantifier = expr:(!sumti_5 !selbri mex relative_clauses?) {return _node("quantifier", expr); }
// // // ganai da'i curmi tu'a zoizoi mex_1* zoi gi me zoizoi ([by BOI] [su'i {re BOI} {by BOI}] VEhO) zoi i xauzma fa zoizoi ([{<by BOI> <su'i (¹re BOI¹)> VEhO} {by BOI}] VAU) zoi i ku'i va'o tu'a zoizoi VEI_clause? zoi tu'a zo ve'o cu se curmi i ku'i na'e melbi
mex = expr:(mex_1 (operator+ mex_1?)*) {return _node("mex", expr); }
// // // operator+ :
// // // ([pa BOI] [pi'i pi'i] [pa BOI])
// // // ([pa BOI] [pi'i {pe'o pi'i <pa BOI> KUhE}])
mex_1 = expr:((KE_clause mex_2+ KEhE_elidible / mex_2 (BO_clause mex_2)*) (BIhE_clause operator+ (KE_clause mex_2+ KEhE_elidible / mex_2 (BO_clause mex_2)*)?)*) {return _node("mex_1", expr); }
mex_2 = expr:(operand / mex_rp / mex_forethought) {return _node("mex_2", expr); }
mex_rp = FUhA_clause mex_2+ operator (mex_2* operator)* KUhE_elidible
// This is just to make for clearer parse trees
mex_forethought = !(lerfu_string BOI_elidible) operator mex_2+ mex_forethought? KUhE_elidible / PEhO_clause operator mex_2+ mex_forethought? KUhE_elidible
// Right recursive version.
// operator //////// _galfi zoizoi MAhO_clause mex TEhU_elidible / NAhU_clause selbri TEhU_elidible / zoi zoizoi MAhO_clause (mex / selbri / sumti) TEhU_elidible / zoi i ro lo cmavo be ma'oi NAhU cu muvdu ma'oi MAhO ije ma'oi MAhO ka'e lidne lo sumti ji'a_20150728UTC
operator = expr:(SE_clause operator / NAhE_clause operator / MAhO_clause (mex / selbri / sumti) TEhU_elidible / VUhU_clause / joik_ek) {return _node("operator", expr); }
// // // (na'e (pa da)) , (vei (na'e pa)) da
// operand //////// galfi zoizoi NIhE_clause selbri TEhU_elidible / MOhE_clause sumti TEhU_elidible / zoi zoizoi MOhE_clause (selbri / sumti) TEhU_elidible / zoi i ro lo cmavo be ma'oi NIhE cu muvdu ma'oi MOhE_20150728UTC
// // // la'a na nitcu lo'u mo'e operand te'u le'u iki'ubo lu vu'u tu'o li'u mekso
operand = expr:(number BOI_elidible / lerfu_string BOI_elidible / VEI_clause mex VEhO_elidible / MOhE_clause (selbri / sumti) TEhU_elidible / (LAhE_clause / NAhE_clause BO_clause) mex LUhU_elidible / NAhE_clause operand) {return _node("operand", expr); }
number = expr:(PA_clause+) {return _node("number", expr); }
lerfu_string = expr:(lerfu_word+) {return _node("lerfu_string", expr); }
// ** BU clauses are part of BY_clause
lerfu_word = expr:(BY_clause / LAU_clause lerfu_word / TEI_clause lerfu_string FOI_clause) {return _node("lerfu_word", expr); }
// ek //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
ek = expr:(NA_clause? SE_clause? A_clause) {return _node("ek", expr); }
// gihek //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
gihek = expr:(NA_clause? SE_clause? GIhA_clause) {return _node("gihek", expr); }
// joik //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
// joik //////// _vimcu zoizoi / interval / GAhO_clause interval GAhO_clause zoi iseja'ebo tu'e lo cmavo be ma'oi BIhI cu muvdu ma'oi JOI ije lo cmavo be ma'oi GAhO cu muvdu ma'oi UI tu'u_20150728UTC
// joik //////// _xruti zoizoi GAhO_clause zoi i ku'i se jbini zoizoi NA_clause? SE_clause? JOI_clause zoi_20150728UTC
joik = expr:(GAhO_clause? NA_clause? SE_clause? JOI_clause GAhO_clause?) {return _node("joik", expr); }
// interval //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
// interval = expr:(SE_clause? BIhI_clause) {return _node("interval", expr); } //////// _vimcu iseja'ebo lo cmavo be ma'oi BIhI cu muvdu ma'oi JOI_20150728UTC
joik_ek = expr:(joik / ek) {return _node("joik_ek", expr); }
joik_gihek = expr:(joik / gihek) {return _node("joik_gihek", expr); }
// gek //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
gek = expr:(SE_clause? GA_clause / GI_clause (joik / tag) (BO_clause)? / (joik / tag) GI_clause (BO_clause)?) {return _node("gek", expr); }
// gik //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
gik = expr:(GI_clause) {return _node("gik", expr); }
// tag //////// _galfi fi zoizoi tcita_selci+ (joik tcita_selci+)* zoi_20150728UTC
tag = expr:(tcita_selci+ (joik tcita_selci+)*) {return _node("tag", expr); }
// stag //////// _galfi fi zoizoi tcita_selci+ (joik tcita_selci+)* zoi_20150728UTC
// stag = expr:(tcita_selci+ (joik tcita_selci+)*) {return _node("stag", expr); } _vimcu i ro zo stag cu binxo zo tag_20150728UTC
// tense_modal //////// _galfi lo cmene zoizoi tcita_selci zoi_20150728UTC
// tcita_selci //////// _galfi fi zoizoi BAI_clause / mex ROI_clause / FIhO_clause selbri FEhU_elidible / (NAhE_clause / SE_clause) tcita_selci zoi_20150728UTC
// tcita_selci //////// _zoizoi (NAhE_clause / SE_clause) tcita_selci zoi cu lidne ro lo drata tezu'e tu'a lu ([i {<na'e (¹[ny BOI] [su'i {pa BOI}]¹) roi> KU} VAU] [i {<vei (¹[na'e {ny BOI}] [su'i {pa BOI}]¹) VEhO> roi} KU] VAU) li'u_20150729UTC
tcita_selci = expr:((NAhE_clause / SE_clause) tcita_selci / BAI_clause / mex ROI_clause / FIhO_clause selbri FEhU_elidible) {return _node("tcita_selci", expr); }
// simple_tense_modal //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
// simple_tense_modal //////// _vimcu zoizoi KI_clause? zoi_20150728UTC
// simple_tense_modal //////// _zoizoi BAI_clause zoi cu se lidne ro drata_20150728UTC
// simple_tense_modal //////// _zasni: CAhA,CUhE>BAI_20150728UTC
// simple_tense_modal //////// _galfi fi zoizoi (NAhE_clause? (SE_clause* BAI_clause / mex ROI_clause))+ zoi_20150728UTC
// simple_tense_modal = expr:((NAhE_clause? (SE_clause* BAI_clause / mex ROI_clause))+) {return _node("simple_tense_modal", expr); } //////// _vimcu_20150728UTC
// time //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
// time //////// _zasni: PU,ZI>BAI_20150728UTC
// time //////// _galfi zoizoi time_offset zoi zoizoi BAI_clause+ zoi_20150728UTC
// time //////// _zasni: ZEhA>BAI_20150728UTC
// time //////// _galfi zoizoi interval_property zoi zoizoi mex ROI_clause zoi_20150728UTC
// time = expr:(BAI_clause+ (mex ROI_clause)* / BAI_clause* (mex ROI_clause)+) {return _node("time", expr); } //////// _vimcu_20150728UTC
// time_offset //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
// time_offset //////// _zasni: PU,ZI>BAI_20150728UTC
// time_offset = expr:(BAI_clause BAI_clause?) {return _node("time_offset", expr); } //////// _vimcu_20150728UTC
// space //////// _zasni: VA>BAI_20150728UTC
// space //////// _galfi zoizoi space_offset zoi BAI_clause+ zoi_20150728UTC
// space //////// _zasni: MOhI>BAI_20150728UTC
// space //////// _galfi fi zoizoi (BAI_clause / NAhE_clause mex ROI_clause)+ zoi_20150728UTC
// space = expr:((BAI_clause / NAhE_clause mex ROI_clause)+) {return _node("space", expr); } //////// _vimcu_20150728UTC
// space_offset //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
// space_offset //////// _zasni: FAhA,VA>BAI_20150728UTC
// space_offset = expr:(BAI_clause BAI_clause?) {return _node("space_offset", expr); } //////// _vimcu_20150728UTC
// space_interval //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
// space_interval //////// _zasni: FAhA,VEhA,VIhA>BAI_20150728UTC
// space_interval //////// _galfi zoizoi space_int_props zoi zoizoi (NAhE_clause mex ROI_clause)+ zoi_20150728UTC
// space_interval //////// _galfi zoizoi BAI_clause+ (NAhE_clause mex ROI_clause)* / (NAhE_clause mex ROI_clause)+ zoi zoizoi (BAI_clause / NAhE_clause mex ROI_clause)+ zoi_20150728UTC
// space_interval = expr:((BAI_clause / NAhE_clause mex ROI_clause)+) {return _node("space_interval", expr); } //////// _vimcu_20150728UTC
// space_int_props //////// _zasni: FEhE>NAhE_20150728UTC
// space_int_props //////// _galfi zoizoi interval_property zoi zoizoi mex ROI_clause zoi_20150728UTC
// space_int_props = expr:((NAhE_clause mex ROI_clause)+) {return _node("space_int_props", expr); } //////// _vimcu_20150728UTC
// interval_property //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
// interval_property //////// _zasni: TAhE>BAI_20150728UTC
// interval_property //////// _zasni: ZAhO>BAI_20150728UTC
// interval_property = expr:(mex ROI_clause / BAI_clause) {return _node("interval_property", expr); } //////// _vimcu_20150728UTC
// free //////// _la'o zoi indicators zoi muvdu ti_20150728UTC
// free //////// _vimcu zoizoi CAI_clause zoi_20150728UTC
// free //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
// free //////// _vimcu zoizoi DAhO_clause zoi_20150728UTC
// free //////// _vimcu zoizoi FUhE_clause, FUhO_clause zoi_20150728UTC
free = expr:(SEI_clause statement SEhU_elidible / vocative relative_clauses? selbri relative_clauses? DOhU_elidible / vocative sumti? DOhU_elidible / mex_2 MAI_clause / TO_clause text TOI_elidible / xi_clause / LOhAI_clause / (UI_clause !BU_clause)+) {return _node("free", expr); }
xi_clause = expr:(XI_clause mex_2) {return _node("xi_clause", expr); }
// vocative //////// _galfi zoizoi (COI_clause NAI_clause?)+ DOI_clause / (COI_clause NAI_clause?) (COI_clause NAI_clause?)* / DOI_clause zoi zoizoi (COI_clause NAI_clause?)+ zoi_20150728UTC
// vocative //////// _vimcu zoizoi NAI_clause? zoi_20150728UTC
vocative = expr:(COI_clause+) {return _node("vocative", expr); }
// indicators = expr:(FUhE_clause? indicator+) {return _node("indicators", expr); } //////// _vimcu i cmima la'o zoi free zoi_20150728UTC
// indicator = expr:(((UI_clause / CAI_clause) NAI_clause? / DAhO_clause / FUhO_clause) !BU_clause) {return _node("indicator", expr); } //////// _vimcu i cmima la'o zoi free zoi_20150728UTC
// ****************
// Magic Words
// ****************
bu_clause = expr:(pre_clause post:bu_clause_no_pre) {return _node("bu_clause", expr); }
// bu_clause_no_pre //////// _galfi zoizoi post_clause zoi zoizoi lerfu_post_clause zoi_20150728UTC
bu_clause_no_pre = expr:((si_word / SU spaces?) bu_tail+ lerfu_post_clause) {return _node("bu_clause_no_pre", expr); }
bu_tail = expr:BU_clause+ {return _node("bu_tail", expr); }
dot_star = expr:(.*) { ret = ""; for (i in expr) ret += (expr[i] === " ") ? "_" : expr[i]; return ret; }
// __ General Morphology Issues
//
// 1. Spaces (including '.y') and UI are eaten *after* a word.
//
// 3. BAhE is eaten *before* a word.
// Handling of what can go after a cmavo
// post_clause //////// _galfi zoizoi indicators* zoi zoizoi free* zoi_20150728UTC
post_clause = expr:(spaces? !BU_clause free*) {return _node_nonempty("post_clause", expr); }
// //////// _jmina la'o zoi number_post_clause, lerfu_post_clause, vocative_post_clause zoi_20150728UTC
number_post_clause = expr:(spaces? !BU_clause (!number free)*) {return _node_nonempty("number_post_clause", expr); }
lerfu_post_clause = expr:(spaces? !BU_clause (!lerfu_string free)*) {return _node_nonempty("lerfu_post_clause", expr); }
vocative_post_clause = expr:(spaces? !BU_clause (!vocative free)*) {return _node_nonempty("vocative_post_clause", expr); }
pre_clause = BAhE_clause? si_clause?
// Handling of spaces and things like spaces.
// ___ SPACE ___
// Do *NOT* delete the line above!
// SU clauses
su_clause = expr:((erasable_clause / su_valsi)* SU_clause) {return _node("su_clause", expr); }
// Handling of SI and interactions with zo and lo'u...le'u
si_clause = ((erasable_clause / si_word) si_clause? SI_clause)+
erasable_clause = expr:(bu_clause_no_pre !BU_clause) {return _node("erasable_clause", expr); }
su_valsi = expr:(si_word / !SU_clause !FAhO_clause any_word spaces?) {return _node("su_valsi", expr); }
si_word = (CMEVLA / BRIVLA / RAhOI spaces? (initial_rafsi / gismu / CVV_final_rafsi / stressed_initial_rafsi short_final_rafsi) / GOhOI spaces? any_word / ZO spaces? any_word / (LOhAI spaces? (!LOhAI !LEhAI any_word)*)? (LOhAI spaces? (!LOhAI !LEhAI any_word)*)? LEhAI / LOhU spaces? (!LEhU any_word)* LEhU / ZOI spaces? zoi_open spaces? zoi_word* zoi_close / !BU !SI !SU !FAhO CMAVO) spaces?
// ___ ELIDIBLE TERMINATORS ___
BEhO_elidible = expr:(BEhO_clause?) {return (expr == "") ? ["BEhO"] : _node("BEhO", expr);}
BOI_elidible = expr:(BOI_clause?) {return (expr == "") ? ["BOI"] : _node("BOI", expr);}
CU_elidible = expr:(CU_clause?) {return (expr == "") ? ["CU"] : _node("CU", expr);}
DOhU_elidible = expr:(DOhU_clause?) {return (expr == "") ? ["DOhU"] : _node("DOhU", expr);}
FEhU_elidible = expr:(FEhU_clause?) {return (expr == "") ? ["FEhU"] : _node("FEhU", expr);}
// FOI and FUhO are never elidible
GEhU_elidible = expr:(GEhU_clause?) {return (expr == "") ? ["GEhU"] : _node("GEhU", expr);}
GIhI_elidible = expr:(GIhI_clause?) {return (expr == "") ? ["GIhI"] : _node("GIhI", expr);}
IAU_elidible = expr:(IAU_clause?) {return (expr == "") ? ["IAU"] : _node("IAU", expr);}
KEI_elidible = expr:(KEI_clause?) {return (expr == "") ? ["KEI"] : _node("KEI", expr);}
KEhE_elidible = expr:(KEhE_clause?) {return (expr == "") ? ["KEhE"] : _node("KEhE", expr);}
KU_elidible = expr:(KU_clause?) {return (expr == "") ? ["KU"] : _node("KU", expr);}
KUhAU_elidible = expr:(KUhAU_clause?) {return (expr == "") ? ["KUhAU"] : _node("KUhAU", expr);}
KUhE_elidible = expr:(KUhE_clause?) {return (expr == "") ? ["KUhE"] : _node("KUhE", expr);}
KUhO_elidible = expr:(KUhO_clause?) {return (expr == "") ? ["KUhO"] : _node("KUhO", expr);}
// LEhU is never elidible
LIhU_elidible = expr:(LIhU_clause?) {return (expr == "") ? ["LIhU"] : _node("LIhU", expr);}
LOhO_elidible = expr:(LOhO_clause?) {return (expr == "") ? ["LOhO"] : _node("LOhO", expr);}
LUhU_elidible = expr:(LUhU_clause?) {return (expr == "") ? ["LUhU"] : _node("LUhU", expr);}
MEhU_elidible = expr:(MEhU_clause?) {return (expr == "") ? ["MEhU"] : _node("MEhU", expr);}
SEhU_elidible = expr:(SEhU_clause?) {return (expr == "") ? ["SEhU"] : _node("SEhU", expr);}
TEhU_elidible = expr:(TEhU_clause?) {return (expr == "") ? ["TEhU"] : _node("TEhU", expr);}
TOI_elidible = expr:(TOI_clause?) {return (expr == "") ? ["TOI"] : _node("TOI", expr);}
TUhU_elidible = expr:(TUhU_clause?) {return (expr == "") ? ["TUhU"] : _node("TUhU", expr);}
VAU_elidible = expr:(VAU_clause?) {return (expr == "") ? ["VAU"] : _node("VAU", expr);}
VEhO_elidible = expr:(VEhO_clause?) {return (expr == "") ? ["VEhO"] : _node("VEhO", expr);}
// ___ SELMAHO ___
// Do *NOT* delete the line above!
BRIVLA_clause = expr:(BRIVLA_pre BRIVLA_post) {return (expr.length == 2) ? _node2("BRIVLA_clause", expr[0], expr[1]) : _node("BRIVLA_clause", expr[0]); }
BRIVLA_pre = pre_clause BRIVLA spaces?
BRIVLA_post = post_clause
CMEVLA_clause = pre:CMEVLA_pre post:CMEVLA_post {return _node2("CMEVLA_clause", pre, post); }
CMEVLA_pre = pre_clause CMEVLA spaces?
CMEVLA_post = post_clause
CMAVO_clause = pre:CMAVO_pre post:CMAVO_post {return _node2("CMAVO_clause", pre, post); }
CMAVO_pre = pre_clause CMAVO spaces?
CMAVO_post = post_clause
// eks; basic afterthought logical connectives
A_clause = pre:A_pre post:A_post {return _node2("A_clause", pre, post); }
A_pre = pre_clause A spaces?
A_post = post_clause
// modal operators
BAI_clause = pre:BAI_pre post:BAI_post {return _node2("BAI_clause", pre, post); }
BAI_pre = pre_clause BAI spaces?
BAI_post = post_clause
// next word intensifier
BAhE_clause = expr:(BAhE_pre BAhE_post)+ {return _node("BAhE_clause", expr); }
BAhE_pre = BAhE spaces?
BAhE_post = si_clause? !BU_clause
// sumti link to attach sumti to a selbri
BE_clause = pre:BE_pre post:BE_post {return _node2("BE_clause", pre, post); }
BE_pre = pre_clause BE spaces?
BE_post = post_clause
// multiple sumti separator between BE, BEI
BEI_clause = pre:BEI_pre post:BEI_post {return _node2("BEI_clause", pre, post); }
BEI_pre = pre_clause BEI spaces?
BEI_post = post_clause
// terminates BEBEI specified descriptors
BEhO_clause = pre:BEhO_pre post:BEhO_post {return _node2("BEhO_clause", pre, post); }
BEhO_pre = pre_clause BEhO spaces?
BEhO_post = post_clause
// prefix for high_priority MEX operator
BIhE_clause = pre:BIhE_pre post:BIhE_post {return _node2("BIhE_clause", pre, post); }
BIhE_pre = pre_clause BIhE spaces?
BIhE_post = post_clause
// interval component of JOI
// BIhI_clause = pre:BIhI_pre post:BIhI_post {return _node2("BIhI_clause", pre, post); } //////// _vimcu_20150728UTC
// BIhI_pre = pre_clause BIhI spaces? //////// _vimcu_20150728UTC
// BIhI_post = post_clause //////// _vimcu_20150728UTC
// joins two units with shortest scope
BO_clause = pre:BO_pre post:BO_post {return _node2("BO_clause", pre, post); }
BO_pre = pre_clause BO spaces?
BO_post = post_clause
// number or lerfu_string terminator
BOI_clause = pre:BOI_pre post:BOI_post {return _node2("BOI_clause", pre, post); }
BOI_pre = pre_clause BOI spaces?
BOI_post = post_clause
// turns any word into a BY lerfu word
BU_clause = pre:BU_pre post:BU_post {return _node2("BU_clause", pre, post); }
BU_pre = pre_clause BU spaces?
BU_post = spaces?
// individual lerfu words
BY_clause = expr:(BY_pre BY_post / bu_clause) {return (expr[0] == "bu_clause") ? ["BY_clause", expr] : _node2("BY_clause", expr[0], expr[1]); }
BY_pre = pre_clause BY spaces?
// BY_post //////// _galfi zoizoi post_clause zoi zoizoi lerfu_post_clause zoi_20150728UTC
BY_post = lerfu_post_clause
// specifies actualitypotentiality of tense
// CAhA_clause = pre:CAhA_pre post:CAhA_post {return _node2("CAhA_clause", pre, post); } //////// _vimcu_20150728UTC
// CAhA_pre = pre_clause CAhA spaces? //////// _vimcu_20150728UTC
// CAhA_post = post_clause //////// _vimcu_20150728UTC
// afterthought intensity marker
// CAI_clause = pre:CAI_pre post:CAI_post {return _node2("CAI_clause", pre, post); } //////// _vimcu ma'oi CAI_20150728UTC
// CAI_pre = pre_clause CAI spaces? //////// _vimcu ma'oi CAI_20150728UTC
// CAI_post = post_clause //////// _vimcu ma'oi CAI_20150728UTC
// pro_bridi assignment operator
CEI_clause = pre:CEI_pre post:CEI_post {return _node2("CEI_clause", pre, post); }
CEI_pre = pre_clause CEI spaces?
CEI_post = post_clause
// afterthought term list connective
// names; require consonant end, then pause no
// LA or DOI selma'o embedded, pause before if
// vowel initial and preceded by a vowel
// tanru inversion
CO_clause = pre:CO_pre post:CO_post {return _node2("CO_clause", pre, post); }
CO_pre = pre_clause CO spaces?
CO_post = post_clause
COI_clause = pre:COI_pre post:COI_post {return _node2("COI_clause", pre, post); }
COI_pre = pre_clause COI spaces?
// COI_post //////// _galfi zoizoi post_clause zoi zoizoi vocative_post_clause zoi_20150728UTC
COI_post = vocative_post_clause
// vocative marker permitted inside names; must
// always be followed by pause or DOI
// separator between head sumti and selbri
CU_clause = pre:CU_pre post:CU_post {return _node2("CU_clause", pre, post); }
CU_pre = pre_clause CU spaces?
CU_post = post_clause
// tensemodal question
// CUhE_clause = pre:CUhE_pre post:CUhE_post {return _node2("CUhE_clause", pre, post); } //////// _vimcu_20150728UTC
// CUhE_pre = pre_clause CUhE spaces? //////// _vimcu_20150728UTC
// CUhE_post = post_clause //////// _vimcu_20150728UTC
// cancel anaphoracataphora assignments
// DAhO_clause = pre:DAhO_pre post:DAhO_post {return _node2("DAhO_clause", pre, post); } //////// _vimcu_20150728UTC
// DAhO_pre = pre_clause DAhO spaces? //////// _vimcu_20150728UTC
// DAhO_post = post_clause //////// _vimcu_20150728UTC
// vocative marker
// DOI_clause, DOI_pre, DOI_post //////// _vimcu i zo doi cmavo ma'oi COI_20150728UTC
// DOI_clause = pre:DOI_pre post:DOI_post {return _node2("DOI_clause", pre, post); }
// DOI_pre = pre_clause DOI spaces?
// DOI_post = post_clause
// terminator for DOI_marked vocatives
DOhU_clause = pre:DOhU_pre post:DOhU_post {return _node2("DOhU_clause", pre, post); }
DOhU_pre = pre_clause DOhU spaces?
DOhU_post = post_clause
// modifier head generic case tag
FA_clause = pre:FA_pre post:FA_post {return _node2("FA_clause", pre, post); }
FA_pre = pre_clause FA spaces?
FA_post = post_clause
// superdirections in space
// FAhA_clause = pre:FAhA_pre post:FAhA_post {return _node2("FAhA_clause", pre, post); } //////// _vimcu_20150728UTC
// FAhA_pre = pre_clause FAhA spaces? //////// _vimcu_20150728UTC
// FAhA_post = post_clause //////// _vimcu_20150728UTC
// normally elided 'done pause' to indicate end
// of utterance string
FAhO_clause = expr:(pre_clause FAhO spaces?) {return _node("FAhO_clause", expr);}
// space interval mod flag
// FEhE_clause = pre:FEhE_pre post:FEhE_post {return _node2("FEhE_clause", pre, post); } //////// _vimcu_20150728UTC
// FEhE_pre = pre_clause FEhE spaces? //////// _vimcu_20150728UTC
// FEhE_post = post_clause //////// _vimcu_20150728UTC
// ends bridi to modal conversion
FEhU_clause = pre:FEhU_pre post:FEhU_post {return _node2("FEhU_clause", pre, post); }
FEhU_pre = pre_clause FEhU spaces?
FEhU_post = post_clause
// marks bridi to modal conversion
FIhO_clause = pre:FIhO_pre post:FIhO_post {return _node2("FIhO_clause", pre, post); }
FIhO_pre = pre_clause FIhO spaces?
FIhO_post = post_clause
// end compound lerfu
FOI_clause = pre:FOI_pre post:FOI_post {return _node2("FOI_clause", pre, post); }
FOI_pre = pre_clause FOI spaces?
FOI_post = post_clause
// reverse Polish flag
FUhA_clause = pre:FUhA_pre post:FUhA_post {return _node2("FUhA_clause", pre, post); }
FUhA_pre = pre_clause FUhA spaces?
FUhA_post = post_clause
// open long scope for indicator
// FUhE_clause = pre:FUhE_pre post:FUhE_post {return _node2("FUhE_clause", pre, post); } //////// _vimcu_20150728UTC
// FUhE_pre = pre_clause FUhE spaces? //////// _vimcu_20150728UTC
// FUhE_post = !BU_clause spaces? !BU_clause //////// _vimcu_20150728UTC
// close long scope for indicator
// FUhO_clause = pre:FUhO_pre post:FUhO_post {return _node2("FUhO_clause", pre, post); } //////// _vimcu_20150728UTC
// FUhO_pre = pre_clause FUhO spaces? //////// _vimcu_20150728UTC
// FUhO_post = post_clause //////// _vimcu_20150728UTC
// geks; forethought logical connectives
GA_clause = pre:GA_pre post:GA_post {return _node2("GA_clause", pre, post); }
GA_pre = pre_clause GA spaces?
GA_post = post_clause
// openclosed interval markers for BIhI
GAhO_clause = pre:GAhO_pre post:GAhO_post {return _node2("GAhO_clause", pre, post); }
GAhO_pre = pre_clause GAhO spaces?
GAhO_post = post_clause
// marker ending GOI relative clauses
GEhU_clause = pre:GEhU_pre post:GEhU_post {return _node2("GEhU_clause", pre, post); }
GEhU_pre = pre_clause GEhU spaces?
GEhU_post = post_clause
// forethought medial marker
GI_clause = pre:GI_pre post:GI_post {return _node2("GI_clause", pre, post); }
GI_pre = pre_clause GI spaces?
GI_post = post_clause
// logical connectives for bridi_tails
GIhA_clause = pre:GIhA_pre post:GIhA_post {return _node2("GIhA_clause", pre, post); }
GIhA_pre = pre_clause GIhA spaces?
GIhA_post = post_clause
// famyma'o zoizoi gek ... (gik ...)+ zoi
GIhI_clause = pre:GIhI_pre post:GIhI_post {return _node2("GIhI_clause", pre, post); }
GIhI_pre = pre_clause GIhI spaces?
GIhI_post = post_clause
// attaches a sumti modifier to a sumti
GOI_clause = pre:GOI_pre post:GOI_post {return _node2("GOI_clause", pre, post); }
GOI_pre = pre_clause GOI spaces?
GOI_post = post_clause
// pro_bridi
GOhA_clause = pre:GOhA_pre post:GOhA_post {return _node2("GOhA_clause", pre, post); }
GOhA_pre = pre_clause GOhA spaces?
GOhA_post = post_clause
GOhOI_clause = pre:GOhOI_pre post:GOhOI_post {return _node2("GOhOI_clause", pre, post); }
GOhOI_pre = pre_clause GOhOI spaces? any_word spaces?
GOhOI_post = post_clause
// GEK for tanru units, corresponds to JEKs
// sentence link
I_clause = expr:(I_pre I_post) {return _node("I_clause", expr); }
I_pre = pre_clause I spaces?
I_post = post_clause
IAU_clause = pre:IAU_pre post:IAU_post {return _node2("IAU_clause", pre, post); }
IAU_pre = pre_clause IAU spaces?
IAU_post = post_clause
// jeks; logical connectives within tanru
// modal conversion flag
JAI_clause = pre:JAI_pre post:JAI_post {return _node2("JAI_clause", pre, post); }
JAI_pre = pre_clause JAI spaces?
JAI_post = post_clause
// flags an array operand
// non_logical connectives
JOI_clause = pre:JOI_pre post:JOI_post {return _node2("JOI_clause", pre, post); }
JOI_pre = pre_clause JOI spaces?
JOI_post = post_clause
// left long scope marker
KE_clause = pre:KE_pre post:KE_post {return _node2("KE_clause", pre, post); }
KE_pre = pre_clause KE spaces?
KE_post = post_clause
// right terminator for KE groups
KEhE_clause = pre:KEhE_pre post:KEhE_post {return _node2("KEhE_clause", pre, post); }
KEhE_pre = pre_clause KEhE spaces?
KEhE_post = post_clause
// right terminator, NU abstractions
KEI_clause = pre:KEI_pre post:KEI_post {return _node2("KEI_clause", pre, post); }
KEI_pre = pre_clause KEI spaces?
KEI_post = post_clause
// multiple utterance scope for tenses
// KI_clause = pre:KI_pre post:KI_post {return _node2("KI_clause", pre, post); } //////// _vimcu_20150728UTC
// KI_pre = pre_clause KI spaces? //////// _vimcu_20150728UTC
// KI_post = post_clause //////// _vimcu_20150728UTC
// sumti anaphora
KOhA_clause = pre:KOhA_pre post:KOhA_post {return _node2("KOhA_clause", pre, post); }
KOhA_pre = pre_clause KOhA spaces?
KOhA_post = post_clause
// right terminator for descriptions, etc.
KU_clause = pre:KU_pre post:KU_post {return _node2("KU_clause", pre, post); }
KU_pre = pre_clause KU spaces?
KU_post = post_clause
KUhAU_clause = pre:KUhAU_pre post:KUhAU_post {return _node2("KUhAU_clause", pre, post); }
KUhAU_pre = pre_clause KUhAU spaces?
KUhAU_post = post_clause
// MEX forethought delimiter
KUhE_clause = pre:KUhE_pre post:KUhE_post {return _node2("KUhE_clause", pre, post); }
KUhE_pre = pre_clause KUhE spaces?
KUhE_post = post_clause
// right terminator, NOI relative clauses
KUhO_clause = pre:KUhO_pre post:KUhO_post {return _node2("KUhO_clause", pre, post); }
KUhO_pre = pre_clause KUhO spaces?
KUhO_post = post_clause
// name descriptors
// lerfu prefixes
LAU_clause = pre:LAU_pre post:LAU_post {return _node2("LAU_clause", pre, post); }
LAU_pre = pre_clause LAU spaces?
LAU_post = post_clause
// sumti qualifiers
LAhE_clause = pre:LAhE_pre post:LAhE_post {return _node2("LAhE_clause", pre, post); }
LAhE_pre = pre_clause LAhE spaces?
LAhE_post = post_clause
// sumti descriptors
LE_clause = pre:LE_pre post:LE_post {return _node2("LE_clause", pre, post); }
LE_pre = pre_clause LE spaces?
LE_post = post_clause
// possibly ungrammatical text right quote
LEhU_clause = pre:LEhU_pre post:LEhU_post {return _node2("LEhU_clause", pre, post); }
LEhU_pre = pre_clause LEhU spaces?
LEhU_post = spaces?
// convert number to sumti
LI_clause = pre:LI_pre post:LI_post {return _node2("LI_clause", pre, post); }
LI_pre = pre_clause LI spaces?
LI_post = post_clause
// grammatical text right quote
LIhU_clause = pre:LIhU_pre post:LIhU_post {return _node2("LIhU_clause", pre, post); }
LIhU_pre = pre_clause LIhU spaces?
LIhU_post = post_clause
LOhAI_clause = pre:LOhAI_pre post:LOhAI_post {return _node2("LOhAI_clause", pre, post); }
LOhAI_pre = pre_clause (LOhAI spaces? (!LOhAI !LEhAI any_word)*)? (LOhAI spaces? (!LOhAI !LEhAI any_word)*)? LEhAI spaces?
LOhAI_post = post_clause
// elidable terminator for LI
LOhO_clause = pre:LOhO_pre post:LOhO_post {return _node2("LOhO_clause", pre, post); }
LOhO_pre = pre_clause LOhO spaces?
LOhO_post = post_clause
// lo nu galfi lo bridi lo sumti cu cfari
LOhOI_clause = pre:LOhOI_pre post:LOhOI_post {return _node2("LOhOI_clause", pre, post); }
LOhOI_pre = pre_clause LOhOI spaces?
LOhOI_post = post_clause
// possibly ungrammatical text left quote
LOhU_clause = pre:LOhU_pre post:LOhU_post {return _node2("LOhU_clause", pre, post); }
LOhU_pre = pre_clause LOhU spaces? (!LEhU any_word)* LEhU_clause spaces?
LOhU_post = post_clause
// grammatical text left quote
LU_clause = pre:LU_pre post:LU_post {return _node2("LU_clause", pre, post); }
LU_pre = pre_clause LU spaces?
LU_post = post_clause
// LAhE close delimiter
LUhU_clause = pre:LUhU_pre post:LUhU_post {return _node2("LUhU_clause", pre, post); }
LUhU_pre = pre_clause LUhU spaces?
LUhU_post = post_clause
// change MEX expressions to MEX operators
MAhO_clause = pre:MAhO_pre post:MAhO_post {return _node2("MAhO_clause", pre, post); }
MAhO_pre = pre_clause MAhO spaces?
MAhO_post = post_clause
// change numbers to utterance ordinals
MAI_clause = pre:MAI_pre post:MAI_post {return _node2("MAI_clause", pre, post); }
MAI_pre = pre_clause MAI spaces?
MAI_post = post_clause
// converts a sumti into a tanru_unit
ME_clause = pre:ME_pre post:ME_post {return _node2("ME_clause", pre, post); }
ME_pre = pre_clause ME spaces?
ME_post = post_clause
// terminator for ME
MEhU_clause = pre:MEhU_pre post:MEhU_post {return _node2("MEhU_clause", pre, post); }
MEhU_pre = pre_clause MEhU spaces?
MEhU_post = post_clause
// change sumti to operand, inverse of LI
MOhE_clause = pre:MOhE_pre post:MOhE_post {return _node2("MOhE_clause", pre, post); }
MOhE_pre = pre_clause MOhE spaces?
MOhE_post = post_clause
// motion tense marker
// MOhI_clause = pre:MOhI_pre post:MOhI_post {return _node2("MOhI_clause", pre, post); } //////// _vimcu_20150728UTC
// MOhI_pre = pre_clause MOhI spaces? //////// _vimcu_20150728UTC
// MOhI_post = post_clause //////// _vimcu_20150728UTC
// change number to selbri
MOI_clause = pre:MOI_pre post:MOI_post {return _node2("MOI_clause", pre, post); }
MOI_pre = pre_clause MOI spaces?
MOI_post = post_clause
// bridi negation
NA_clause = pre:NA_pre post:NA_post {return _node2("NA_clause", pre, post); }
NA_pre = pre_clause NA spaces?
NA_post = post_clause
// attached to words to negate them
// NAI_clause = pre:NAI_pre post:NAI_post {return _node2("NAI_clause", pre, post); } //////// _vimcu ma'oi NAI_20150728UTC
// NAI_pre = pre_clause NAI spaces? //////// _vimcu ma'oi NAI_20150728UTC
// NAI_post = post_clause //////// _vimcu ma'oi NAI_20150728UTC
// scalar negation
NAhE_clause = pre:NAhE_pre post:NAhE_post {return _node2("NAhE_clause", pre, post); }
NAhE_pre = pre_clause NAhE spaces?
NAhE_post = post_clause
// change a selbri into an operator
// NAhU_clause = pre:NAhU_pre post:NAhU_post {return _node2("NAhU_clause", pre, post); } //////// _vimcu ma'oi NAhU_20150728UTC
// NAhU_pre = pre_clause NAhU spaces? //////// _vimcu ma'oi NAhU_20150728UTC
// NAhU_post = post_clause //////// _vimcu ma'oi NAhU_20150728UTC
// change selbri to operand; inverse of MOI
// NIhE_clause = pre:NIhE_pre post:NIhE_post {return _node2("NIhE_clause", pre, post); } //////// _vimcu_20150728UTC
// NIhE_pre = pre_clause NIhE spaces? //////// _vimcu_20150728UTC
// NIhE_post = post_clause //////// _vimcu_20150728UTC
// new paragraph; change of subject
NIhO_clause = expr:(NIhO_pre NIhO_post) {return _node("NIhO_clause", expr); }
NIhO_pre = pre_clause NIhO spaces?
NIhO_post = post_clause
// attaches a subordinate clause to a sumti
NOI_clause = pre:NOI_pre post:NOI_post {return _node2("NOI_clause", pre, post); }
NOI_pre = pre_clause NOI spaces?
NOI_post = post_clause
// abstraction
NU_clause = pre:NU_pre post:NU_post {return _node2("NU_clause", pre, post); }
NU_pre = pre_clause NU spaces?
NU_post = post_clause
// change operator to selbri; inverse of MOhE
// marks the start of a termset
// marks the middle and end of a termset
// numbers and numeric punctuation
PA_clause = pre:PA_pre post:PA_post {return _node2("PA_clause", pre, post); }
PA_pre = pre_clause PA spaces?
// PA_post //////// _galfi zoizoi post_clause zoi zoizoi number_post_clause zoi_20150728UTC
PA_post = number_post_clause
// afterthought termset connective prefix
// forethought (Polish) flag
PEhO_clause = pre:PEhO_pre post:PEhO_post {return _node2("PEhO_clause", pre, post); }
PEhO_pre = pre_clause PEhO spaces?
PEhO_post = post_clause
// directions in time
// PU_clause = pre:PU_pre post:PU_post {return _node2("PU_clause", pre, post); } //////// _vimcu_20150728UTC
// PU_pre = pre_clause PU spaces? //////// _vimcu_20150728UTC
// PU_post = post_clause //////// _vimcu_20150728UTC
RAhOI_clause = pre:RAhOI_pre post:RAhOI_post {return _node2("RAhOI_clause", pre, post); }
RAhOI_pre = pre_clause RAhOI spaces? (initial_rafsi / gismu / CVV_final_rafsi / stressed_initial_rafsi short_final_rafsi) spaces?
RAhOI_post = post_clause
// flag for modified interpretation of GOhI
// RAhO_clause = pre:RAhO_pre post:RAhO_post {return _node2("RAhO_clause", pre, post); } //////// _vimcu_20150728UTC
// RAhO_pre = pre_clause RAhO spaces? //////// _vimcu_20150728UTC
// RAhO_post = post_clause //////// _vimcu_20150728UTC
// converts number to extensional tense
ROI_clause = pre:ROI_pre post:ROI_post {return _node2("ROI_clause", pre, post); }
ROI_pre = pre_clause ROI spaces?
ROI_post = post_clause
// metalinguistic eraser to the beginning of
// the current utterance
// conversions
SE_clause = pre:SE_pre post:SE_post {return _node2("SE_clause", pre, post); }
SE_pre = pre_clause SE spaces?
SE_post = post_clause
// metalinguistic bridi insert marker
SEI_clause = pre:SEI_pre post:SEI_post {return _node2("SEI_clause", pre, post); }
SEI_pre = pre_clause SEI spaces?
SEI_post = post_clause
// metalinguistic bridi end marker
SEhU_clause = pre:SEhU_pre post:SEhU_post {return _node2("SEhU_clause", pre, post); }
SEhU_pre = pre_clause SEhU spaces?
SEhU_post = post_clause
// metalinguistic single word eraser
SI_clause = expr:(spaces? SI spaces?) {return _node("SI_clause", expr); }
// reciprocal sumti marker
// metalinguistic eraser of the entire text
SU_clause = pre:SU_pre post:SU_post {return _node2("SU_clause", pre, post); }
SU_pre = pre_clause SU spaces?
SU_post = post_clause
// tense interval properties
// TAhE_clause = pre:TAhE_pre post:TAhE_post {return _node2("TAhE_clause", pre, post); } //////// _vimcu_20150728UTC
// TAhE_pre = pre_clause TAhE spaces? //////// _vimcu_20150728UTC
// TAhE_post = post_clause //////// _vimcu_20150728UTC
// closing gap for MEX constructs
TEhU_clause = pre:TEhU_pre post:TEhU_post {return _node2("TEhU_clause", pre, post); }
TEhU_pre = pre_clause TEhU spaces?
TEhU_post = post_clause
// start compound lerfu
TEI_clause = pre:TEI_pre post:TEI_post {return _node2("TEI_clause", pre, post); }
TEI_pre = pre_clause TEI spaces?
TEI_post = post_clause