@scinorandex/sparse 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +2 -2
  2. package/dist/cli.js +2 -2
  3. package/dist/cli.js.map +1 -1
  4. package/dist/generator.d.ts +4 -1
  5. package/dist/generator.js +47 -32
  6. package/dist/generator.js.map +1 -1
  7. package/dist/index.d.ts +3 -2
  8. package/dist/index.js +5 -5
  9. package/dist/index.js.map +1 -1
  10. package/dist/meta/common.d.ts +57 -0
  11. package/dist/meta/common.js +62 -0
  12. package/dist/meta/common.js.map +1 -0
  13. package/dist/meta/handwritten.d.ts +12 -0
  14. package/dist/{grammarParser.js → meta/handwritten.js} +24 -24
  15. package/dist/meta/handwritten.js.map +1 -0
  16. package/dist/meta/selfhosted.d.ts +23 -0
  17. package/dist/meta/selfhosted.js +206 -0
  18. package/dist/meta/selfhosted.js.map +1 -0
  19. package/dist/meta/states.d.ts +1580 -0
  20. package/dist/meta/states.js +1493 -0
  21. package/dist/meta/states.js.map +1 -0
  22. package/dist/parser.d.ts +16 -5
  23. package/dist/parser.js +25 -7
  24. package/dist/parser.js.map +1 -1
  25. package/dist/{tableParser.d.ts → table/handwritten.d.ts} +1 -1
  26. package/dist/{tableParser.js → table/handwritten.js} +2 -2
  27. package/dist/table/handwritten.js.map +1 -0
  28. package/dist/table/selfhosted.d.ts +2 -0
  29. package/dist/table/selfhosted.js +65 -0
  30. package/dist/table/selfhosted.js.map +1 -0
  31. package/dist/table/states.d.ts +592 -0
  32. package/dist/table/states.js +593 -0
  33. package/dist/table/states.js.map +1 -0
  34. package/dist/utils/Result.d.ts +1 -1
  35. package/dist/utils/errorWindowBuilder.d.ts +1 -1
  36. package/example/LoLang/example.ts +14 -7
  37. package/example/complicated/grammar.txt +37 -0
  38. package/example/math/example.ts +1 -4
  39. package/example/selfhosted/01-meta-grammar.txt +10 -0
  40. package/example/selfhosted/02-table-grammar.txt +6 -0
  41. package/example/selfhosted/codegen-meta.ts +1489 -0
  42. package/example/selfhosted/codegen-table.ts +589 -0
  43. package/example/selfhosted/example.ts +39 -0
  44. package/package.json +4 -4
  45. package/src/cli.ts +1 -1
  46. package/src/generator.ts +52 -34
  47. package/src/index.ts +3 -2
  48. package/src/meta/common.ts +74 -0
  49. package/src/{grammarParser.ts → meta/handwritten.ts} +17 -21
  50. package/src/meta/selfhosted.ts +272 -0
  51. package/src/meta/states.ts +1489 -0
  52. package/src/parser.ts +53 -19
  53. package/src/{tableParser.ts → table/handwritten.ts} +5 -5
  54. package/src/table/selfhosted.ts +67 -0
  55. package/src/table/states.ts +589 -0
  56. package/src/utils/Result.ts +1 -1
  57. package/src/utils/errorWindowBuilder.ts +1 -1
  58. package/tsconfig.build.json +30 -0
  59. package/tsconfig.json +6 -6
  60. package/dist/grammarParser.d.ts +0 -27
  61. package/dist/grammarParser.js.map +0 -1
  62. package/dist/tableParser.js.map +0 -1
@@ -0,0 +1,1489 @@
1
+ export const states = [
2
+ {
3
+ "[EOF]": {
4
+ "type": "shift",
5
+ "value": 4
6
+ },
7
+ "[L_ANGLE]": {
8
+ "type": "shift",
9
+ "value": 5
10
+ },
11
+ "<PROGRAM>": {
12
+ "type": "goto",
13
+ "value": 1
14
+ },
15
+ "<PRODUCTIONS>": {
16
+ "type": "goto",
17
+ "value": 2
18
+ },
19
+ "<PRODUCTION>": {
20
+ "type": "goto",
21
+ "value": 3
22
+ }
23
+ },
24
+ {
25
+ "[EOF]": {
26
+ "type": "reduce",
27
+ "value": 0
28
+ }
29
+ },
30
+ {
31
+ "[EOF]": {
32
+ "type": "shift",
33
+ "value": 6
34
+ }
35
+ },
36
+ {
37
+ "[EOF]": {
38
+ "type": "reduce",
39
+ "value": 3
40
+ },
41
+ "[L_ANGLE]": {
42
+ "type": "shift",
43
+ "value": 5
44
+ },
45
+ "<PRODUCTIONS>": {
46
+ "type": "goto",
47
+ "value": 7
48
+ },
49
+ "<PRODUCTION>": {
50
+ "type": "goto",
51
+ "value": 3
52
+ }
53
+ },
54
+ {
55
+ "[EOF]": {
56
+ "type": "reduce",
57
+ "value": 1
58
+ }
59
+ },
60
+ {
61
+ "[IDENTIFIER]": {
62
+ "type": "shift",
63
+ "value": 8
64
+ }
65
+ },
66
+ {
67
+ "[EOF]": {
68
+ "type": "reduce",
69
+ "value": 2
70
+ }
71
+ },
72
+ {
73
+ "[EOF]": {
74
+ "type": "reduce",
75
+ "value": 4
76
+ }
77
+ },
78
+ {
79
+ "[R_ANGLE]": {
80
+ "type": "shift",
81
+ "value": 9
82
+ },
83
+ "[COLON]": {
84
+ "type": "shift",
85
+ "value": 10
86
+ }
87
+ },
88
+ {
89
+ "[COLON]": {
90
+ "type": "shift",
91
+ "value": 11
92
+ }
93
+ },
94
+ {
95
+ "[IDENTIFIER]": {
96
+ "type": "shift",
97
+ "value": 12
98
+ }
99
+ },
100
+ {
101
+ "[L_PAREN]": {
102
+ "type": "shift",
103
+ "value": 17
104
+ },
105
+ "[L_ANGLE]": {
106
+ "type": "shift",
107
+ "value": 18
108
+ },
109
+ "[L_BRACKET]": {
110
+ "type": "shift",
111
+ "value": 19
112
+ },
113
+ "<TOKENS>": {
114
+ "type": "goto",
115
+ "value": 13
116
+ },
117
+ "<TOKEN>": {
118
+ "type": "goto",
119
+ "value": 14
120
+ },
121
+ "<VARIABLE>": {
122
+ "type": "goto",
123
+ "value": 15
124
+ },
125
+ "<TERMINAL>": {
126
+ "type": "goto",
127
+ "value": 16
128
+ }
129
+ },
130
+ {
131
+ "[R_ANGLE]": {
132
+ "type": "shift",
133
+ "value": 20
134
+ }
135
+ },
136
+ {
137
+ "[SEMICOLON]": {
138
+ "type": "shift",
139
+ "value": 21
140
+ }
141
+ },
142
+ {
143
+ "[SEMICOLON]": {
144
+ "type": "reduce",
145
+ "value": 7
146
+ },
147
+ "[L_PAREN]": {
148
+ "type": "shift",
149
+ "value": 17
150
+ },
151
+ "[L_ANGLE]": {
152
+ "type": "shift",
153
+ "value": 18
154
+ },
155
+ "[L_BRACKET]": {
156
+ "type": "shift",
157
+ "value": 19
158
+ },
159
+ "<TOKENS>": {
160
+ "type": "goto",
161
+ "value": 22
162
+ },
163
+ "<TOKEN>": {
164
+ "type": "goto",
165
+ "value": 23
166
+ },
167
+ "<VARIABLE>": {
168
+ "type": "goto",
169
+ "value": 15
170
+ },
171
+ "<TERMINAL>": {
172
+ "type": "goto",
173
+ "value": 16
174
+ }
175
+ },
176
+ {
177
+ "[SEMICOLON]": {
178
+ "type": "reduce",
179
+ "value": 9
180
+ },
181
+ "[R_PAREN]": {
182
+ "type": "reduce",
183
+ "value": 9
184
+ },
185
+ "[L_PAREN]": {
186
+ "type": "reduce",
187
+ "value": 9
188
+ },
189
+ "[L_ANGLE]": {
190
+ "type": "reduce",
191
+ "value": 9
192
+ },
193
+ "[L_BRACKET]": {
194
+ "type": "reduce",
195
+ "value": 9
196
+ }
197
+ },
198
+ {
199
+ "[SEMICOLON]": {
200
+ "type": "reduce",
201
+ "value": 10
202
+ },
203
+ "[R_PAREN]": {
204
+ "type": "reduce",
205
+ "value": 10
206
+ },
207
+ "[L_PAREN]": {
208
+ "type": "reduce",
209
+ "value": 10
210
+ },
211
+ "[L_ANGLE]": {
212
+ "type": "reduce",
213
+ "value": 10
214
+ },
215
+ "[L_BRACKET]": {
216
+ "type": "reduce",
217
+ "value": 10
218
+ }
219
+ },
220
+ {
221
+ "[L_PAREN]": {
222
+ "type": "shift",
223
+ "value": 17
224
+ },
225
+ "[L_ANGLE]": {
226
+ "type": "shift",
227
+ "value": 18
228
+ },
229
+ "[L_BRACKET]": {
230
+ "type": "shift",
231
+ "value": 19
232
+ },
233
+ "<TOKENS>": {
234
+ "type": "goto",
235
+ "value": 24
236
+ },
237
+ "<TOKEN>": {
238
+ "type": "goto",
239
+ "value": 25
240
+ },
241
+ "<VARIABLE>": {
242
+ "type": "goto",
243
+ "value": 15
244
+ },
245
+ "<TERMINAL>": {
246
+ "type": "goto",
247
+ "value": 16
248
+ }
249
+ },
250
+ {
251
+ "[IDENTIFIER]": {
252
+ "type": "shift",
253
+ "value": 27
254
+ },
255
+ "<INSIDE>": {
256
+ "type": "goto",
257
+ "value": 26
258
+ }
259
+ },
260
+ {
261
+ "[IDENTIFIER]": {
262
+ "type": "shift",
263
+ "value": 29
264
+ },
265
+ "<INSIDE>": {
266
+ "type": "goto",
267
+ "value": 28
268
+ }
269
+ },
270
+ {
271
+ "[COLON]": {
272
+ "type": "shift",
273
+ "value": 30
274
+ }
275
+ },
276
+ {
277
+ "[EOF]": {
278
+ "type": "reduce",
279
+ "value": 5
280
+ },
281
+ "[L_ANGLE]": {
282
+ "type": "reduce",
283
+ "value": 5
284
+ }
285
+ },
286
+ {
287
+ "[SEMICOLON]": {
288
+ "type": "reduce",
289
+ "value": 8
290
+ }
291
+ },
292
+ {
293
+ "[SEMICOLON]": {
294
+ "type": "reduce",
295
+ "value": 7
296
+ },
297
+ "[R_PAREN]": {
298
+ "type": "reduce",
299
+ "value": 7
300
+ },
301
+ "[L_PAREN]": {
302
+ "type": "shift",
303
+ "value": 17
304
+ },
305
+ "[L_ANGLE]": {
306
+ "type": "shift",
307
+ "value": 18
308
+ },
309
+ "[L_BRACKET]": {
310
+ "type": "shift",
311
+ "value": 19
312
+ },
313
+ "<TOKENS>": {
314
+ "type": "goto",
315
+ "value": 31
316
+ },
317
+ "<TOKEN>": {
318
+ "type": "goto",
319
+ "value": 23
320
+ },
321
+ "<VARIABLE>": {
322
+ "type": "goto",
323
+ "value": 15
324
+ },
325
+ "<TERMINAL>": {
326
+ "type": "goto",
327
+ "value": 16
328
+ }
329
+ },
330
+ {
331
+ "[R_PAREN]": {
332
+ "type": "shift",
333
+ "value": 32
334
+ }
335
+ },
336
+ {
337
+ "[R_PAREN]": {
338
+ "type": "reduce",
339
+ "value": 7
340
+ },
341
+ "[L_PAREN]": {
342
+ "type": "shift",
343
+ "value": 17
344
+ },
345
+ "[L_ANGLE]": {
346
+ "type": "shift",
347
+ "value": 18
348
+ },
349
+ "[L_BRACKET]": {
350
+ "type": "shift",
351
+ "value": 19
352
+ },
353
+ "<TOKENS>": {
354
+ "type": "goto",
355
+ "value": 33
356
+ },
357
+ "<TOKEN>": {
358
+ "type": "goto",
359
+ "value": 23
360
+ },
361
+ "<VARIABLE>": {
362
+ "type": "goto",
363
+ "value": 15
364
+ },
365
+ "<TERMINAL>": {
366
+ "type": "goto",
367
+ "value": 16
368
+ }
369
+ },
370
+ {
371
+ "[R_ANGLE]": {
372
+ "type": "shift",
373
+ "value": 34
374
+ },
375
+ "[COLON]": {
376
+ "type": "shift",
377
+ "value": 35
378
+ }
379
+ },
380
+ {
381
+ "[R_ANGLE]": {
382
+ "type": "reduce",
383
+ "value": 16
384
+ },
385
+ "[COLON]": {
386
+ "type": "reduce",
387
+ "value": 16
388
+ },
389
+ "[PIPE]": {
390
+ "type": "shift",
391
+ "value": 36
392
+ }
393
+ },
394
+ {
395
+ "[R_BRACKET]": {
396
+ "type": "shift",
397
+ "value": 37
398
+ },
399
+ "[COLON]": {
400
+ "type": "shift",
401
+ "value": 38
402
+ }
403
+ },
404
+ {
405
+ "[R_BRACKET]": {
406
+ "type": "reduce",
407
+ "value": 16
408
+ },
409
+ "[COLON]": {
410
+ "type": "reduce",
411
+ "value": 16
412
+ },
413
+ "[PIPE]": {
414
+ "type": "shift",
415
+ "value": 39
416
+ }
417
+ },
418
+ {
419
+ "[L_PAREN]": {
420
+ "type": "shift",
421
+ "value": 17
422
+ },
423
+ "[L_ANGLE]": {
424
+ "type": "shift",
425
+ "value": 18
426
+ },
427
+ "[L_BRACKET]": {
428
+ "type": "shift",
429
+ "value": 19
430
+ },
431
+ "<TOKENS>": {
432
+ "type": "goto",
433
+ "value": 40
434
+ },
435
+ "<TOKEN>": {
436
+ "type": "goto",
437
+ "value": 14
438
+ },
439
+ "<VARIABLE>": {
440
+ "type": "goto",
441
+ "value": 15
442
+ },
443
+ "<TERMINAL>": {
444
+ "type": "goto",
445
+ "value": 16
446
+ }
447
+ },
448
+ {
449
+ "[SEMICOLON]": {
450
+ "type": "reduce",
451
+ "value": 8
452
+ },
453
+ "[R_PAREN]": {
454
+ "type": "reduce",
455
+ "value": 8
456
+ }
457
+ },
458
+ {
459
+ "[QUESTION_MARK]": {
460
+ "type": "shift",
461
+ "value": 41
462
+ }
463
+ },
464
+ {
465
+ "[R_PAREN]": {
466
+ "type": "reduce",
467
+ "value": 8
468
+ }
469
+ },
470
+ {
471
+ "[SEMICOLON]": {
472
+ "type": "reduce",
473
+ "value": 12
474
+ },
475
+ "[R_PAREN]": {
476
+ "type": "reduce",
477
+ "value": 12
478
+ },
479
+ "[L_PAREN]": {
480
+ "type": "reduce",
481
+ "value": 12
482
+ },
483
+ "[L_ANGLE]": {
484
+ "type": "reduce",
485
+ "value": 12
486
+ },
487
+ "[L_BRACKET]": {
488
+ "type": "reduce",
489
+ "value": 12
490
+ }
491
+ },
492
+ {
493
+ "[IDENTIFIER]": {
494
+ "type": "shift",
495
+ "value": 42
496
+ }
497
+ },
498
+ {
499
+ "[IDENTIFIER]": {
500
+ "type": "shift",
501
+ "value": 44
502
+ },
503
+ "<INSIDE>": {
504
+ "type": "goto",
505
+ "value": 43
506
+ }
507
+ },
508
+ {
509
+ "[SEMICOLON]": {
510
+ "type": "reduce",
511
+ "value": 14
512
+ },
513
+ "[R_PAREN]": {
514
+ "type": "reduce",
515
+ "value": 14
516
+ },
517
+ "[L_PAREN]": {
518
+ "type": "reduce",
519
+ "value": 14
520
+ },
521
+ "[L_ANGLE]": {
522
+ "type": "reduce",
523
+ "value": 14
524
+ },
525
+ "[L_BRACKET]": {
526
+ "type": "reduce",
527
+ "value": 14
528
+ }
529
+ },
530
+ {
531
+ "[IDENTIFIER]": {
532
+ "type": "shift",
533
+ "value": 45
534
+ }
535
+ },
536
+ {
537
+ "[IDENTIFIER]": {
538
+ "type": "shift",
539
+ "value": 44
540
+ },
541
+ "<INSIDE>": {
542
+ "type": "goto",
543
+ "value": 46
544
+ }
545
+ },
546
+ {
547
+ "[SEMICOLON]": {
548
+ "type": "shift",
549
+ "value": 47
550
+ }
551
+ },
552
+ {
553
+ "[SEMICOLON]": {
554
+ "type": "reduce",
555
+ "value": 11
556
+ },
557
+ "[R_PAREN]": {
558
+ "type": "reduce",
559
+ "value": 11
560
+ },
561
+ "[L_PAREN]": {
562
+ "type": "reduce",
563
+ "value": 11
564
+ },
565
+ "[L_ANGLE]": {
566
+ "type": "reduce",
567
+ "value": 11
568
+ },
569
+ "[L_BRACKET]": {
570
+ "type": "reduce",
571
+ "value": 11
572
+ }
573
+ },
574
+ {
575
+ "[R_ANGLE]": {
576
+ "type": "shift",
577
+ "value": 48
578
+ }
579
+ },
580
+ {
581
+ "[R_ANGLE]": {
582
+ "type": "reduce",
583
+ "value": 17
584
+ },
585
+ "[COLON]": {
586
+ "type": "reduce",
587
+ "value": 17
588
+ }
589
+ },
590
+ {
591
+ "[R_ANGLE]": {
592
+ "type": "reduce",
593
+ "value": 16
594
+ },
595
+ "[COLON]": {
596
+ "type": "reduce",
597
+ "value": 16
598
+ },
599
+ "[R_BRACKET]": {
600
+ "type": "reduce",
601
+ "value": 16
602
+ },
603
+ "[PIPE]": {
604
+ "type": "shift",
605
+ "value": 49
606
+ }
607
+ },
608
+ {
609
+ "[R_BRACKET]": {
610
+ "type": "shift",
611
+ "value": 50
612
+ }
613
+ },
614
+ {
615
+ "[R_BRACKET]": {
616
+ "type": "reduce",
617
+ "value": 17
618
+ },
619
+ "[COLON]": {
620
+ "type": "reduce",
621
+ "value": 17
622
+ }
623
+ },
624
+ {
625
+ "[EOF]": {
626
+ "type": "reduce",
627
+ "value": 6
628
+ },
629
+ "[L_ANGLE]": {
630
+ "type": "reduce",
631
+ "value": 6
632
+ }
633
+ },
634
+ {
635
+ "[SEMICOLON]": {
636
+ "type": "reduce",
637
+ "value": 13
638
+ },
639
+ "[R_PAREN]": {
640
+ "type": "reduce",
641
+ "value": 13
642
+ },
643
+ "[L_PAREN]": {
644
+ "type": "reduce",
645
+ "value": 13
646
+ },
647
+ "[L_ANGLE]": {
648
+ "type": "reduce",
649
+ "value": 13
650
+ },
651
+ "[L_BRACKET]": {
652
+ "type": "reduce",
653
+ "value": 13
654
+ }
655
+ },
656
+ {
657
+ "[IDENTIFIER]": {
658
+ "type": "shift",
659
+ "value": 44
660
+ },
661
+ "<INSIDE>": {
662
+ "type": "goto",
663
+ "value": 51
664
+ }
665
+ },
666
+ {
667
+ "[SEMICOLON]": {
668
+ "type": "reduce",
669
+ "value": 15
670
+ },
671
+ "[R_PAREN]": {
672
+ "type": "reduce",
673
+ "value": 15
674
+ },
675
+ "[L_PAREN]": {
676
+ "type": "reduce",
677
+ "value": 15
678
+ },
679
+ "[L_ANGLE]": {
680
+ "type": "reduce",
681
+ "value": 15
682
+ },
683
+ "[L_BRACKET]": {
684
+ "type": "reduce",
685
+ "value": 15
686
+ }
687
+ },
688
+ {
689
+ "[R_ANGLE]": {
690
+ "type": "reduce",
691
+ "value": 17
692
+ },
693
+ "[COLON]": {
694
+ "type": "reduce",
695
+ "value": 17
696
+ },
697
+ "[R_BRACKET]": {
698
+ "type": "reduce",
699
+ "value": 17
700
+ }
701
+ }
702
+ ];
703
+ export const productions = [
704
+ {
705
+ "lhs": {
706
+ "column": 1,
707
+ "lexeme": "S",
708
+ "line": 1,
709
+ "type": 0
710
+ },
711
+ "identifier": "<S>",
712
+ "name": null,
713
+ "originalProductionIndex": 0,
714
+ "rhs": [
715
+ {
716
+ "type": "variable",
717
+ "token": {
718
+ "column": 6,
719
+ "lexeme": "PROGRAM",
720
+ "line": 1,
721
+ "type": 0
722
+ },
723
+ "identifier": "<PROGRAM>",
724
+ "name": null
725
+ }
726
+ ]
727
+ },
728
+ {
729
+ "lhs": {
730
+ "column": 1,
731
+ "lexeme": "PROGRAM",
732
+ "line": 2,
733
+ "type": 0
734
+ },
735
+ "identifier": "<PROGRAM>",
736
+ "name": "program",
737
+ "originalProductionIndex": 1,
738
+ "rhs": [
739
+ {
740
+ "type": "terminal",
741
+ "token": {
742
+ "column": 51,
743
+ "lexeme": "EOF",
744
+ "line": 2,
745
+ "type": 0
746
+ },
747
+ "identifier": "[EOF]",
748
+ "name": null
749
+ }
750
+ ]
751
+ },
752
+ {
753
+ "lhs": {
754
+ "column": 1,
755
+ "lexeme": "PROGRAM",
756
+ "line": 2,
757
+ "type": 0
758
+ },
759
+ "identifier": "<PROGRAM>",
760
+ "name": "program",
761
+ "originalProductionIndex": 1,
762
+ "rhs": [
763
+ {
764
+ "type": "variable",
765
+ "token": {
766
+ "column": 22,
767
+ "lexeme": "PRODUCTIONS",
768
+ "line": 2,
769
+ "type": 0
770
+ },
771
+ "identifier": "<PRODUCTIONS>",
772
+ "name": "productions"
773
+ },
774
+ {
775
+ "type": "terminal",
776
+ "token": {
777
+ "column": 51,
778
+ "lexeme": "EOF",
779
+ "line": 2,
780
+ "type": 0
781
+ },
782
+ "identifier": "[EOF]",
783
+ "name": null
784
+ }
785
+ ]
786
+ },
787
+ {
788
+ "lhs": {
789
+ "column": 1,
790
+ "lexeme": "PRODUCTIONS",
791
+ "line": 3,
792
+ "type": 0
793
+ },
794
+ "identifier": "<PRODUCTIONS>",
795
+ "name": "productions",
796
+ "originalProductionIndex": 2,
797
+ "rhs": [
798
+ {
799
+ "type": "variable",
800
+ "token": {
801
+ "column": 29,
802
+ "lexeme": "PRODUCTION",
803
+ "line": 3,
804
+ "type": 0
805
+ },
806
+ "identifier": "<PRODUCTION>",
807
+ "name": "production"
808
+ }
809
+ ]
810
+ },
811
+ {
812
+ "lhs": {
813
+ "column": 1,
814
+ "lexeme": "PRODUCTIONS",
815
+ "line": 3,
816
+ "type": 0
817
+ },
818
+ "identifier": "<PRODUCTIONS>",
819
+ "name": "productions",
820
+ "originalProductionIndex": 2,
821
+ "rhs": [
822
+ {
823
+ "type": "variable",
824
+ "token": {
825
+ "column": 29,
826
+ "lexeme": "PRODUCTION",
827
+ "line": 3,
828
+ "type": 0
829
+ },
830
+ "identifier": "<PRODUCTION>",
831
+ "name": "production"
832
+ },
833
+ {
834
+ "type": "variable",
835
+ "token": {
836
+ "column": 55,
837
+ "lexeme": "PRODUCTIONS",
838
+ "line": 3,
839
+ "type": 0
840
+ },
841
+ "identifier": "<PRODUCTIONS>",
842
+ "name": "rest"
843
+ }
844
+ ]
845
+ },
846
+ {
847
+ "lhs": {
848
+ "column": 1,
849
+ "lexeme": "PRODUCTION",
850
+ "line": 4,
851
+ "type": 0
852
+ },
853
+ "identifier": "<PRODUCTION>",
854
+ "name": "production",
855
+ "originalProductionIndex": 3,
856
+ "rhs": [
857
+ {
858
+ "type": "terminal",
859
+ "token": {
860
+ "column": 27,
861
+ "lexeme": "L_ANGLE",
862
+ "line": 4,
863
+ "type": 0
864
+ },
865
+ "identifier": "[L_ANGLE]",
866
+ "name": null
867
+ },
868
+ {
869
+ "type": "terminal",
870
+ "token": {
871
+ "column": 37,
872
+ "lexeme": "IDENTIFIER",
873
+ "line": 4,
874
+ "type": 0
875
+ },
876
+ "identifier": "[IDENTIFIER]",
877
+ "name": "production_name"
878
+ },
879
+ {
880
+ "type": "terminal",
881
+ "token": {
882
+ "column": 97,
883
+ "lexeme": "R_ANGLE",
884
+ "line": 4,
885
+ "type": 0
886
+ },
887
+ "identifier": "[R_ANGLE]",
888
+ "name": null
889
+ },
890
+ {
891
+ "type": "terminal",
892
+ "token": {
893
+ "column": 107,
894
+ "lexeme": "COLON",
895
+ "line": 4,
896
+ "type": 0
897
+ },
898
+ "identifier": "[COLON]",
899
+ "name": null
900
+ },
901
+ {
902
+ "type": "variable",
903
+ "token": {
904
+ "column": 115,
905
+ "lexeme": "TOKENS",
906
+ "line": 4,
907
+ "type": 0
908
+ },
909
+ "identifier": "<TOKENS>",
910
+ "name": "tokens"
911
+ },
912
+ {
913
+ "type": "terminal",
914
+ "token": {
915
+ "column": 132,
916
+ "lexeme": "SEMICOLON",
917
+ "line": 4,
918
+ "type": 0
919
+ },
920
+ "identifier": "[SEMICOLON]",
921
+ "name": null
922
+ }
923
+ ]
924
+ },
925
+ {
926
+ "lhs": {
927
+ "column": 1,
928
+ "lexeme": "PRODUCTION",
929
+ "line": 4,
930
+ "type": 0
931
+ },
932
+ "identifier": "<PRODUCTION>",
933
+ "name": "production",
934
+ "originalProductionIndex": 3,
935
+ "rhs": [
936
+ {
937
+ "type": "terminal",
938
+ "token": {
939
+ "column": 27,
940
+ "lexeme": "L_ANGLE",
941
+ "line": 4,
942
+ "type": 0
943
+ },
944
+ "identifier": "[L_ANGLE]",
945
+ "name": null
946
+ },
947
+ {
948
+ "type": "terminal",
949
+ "token": {
950
+ "column": 37,
951
+ "lexeme": "IDENTIFIER",
952
+ "line": 4,
953
+ "type": 0
954
+ },
955
+ "identifier": "[IDENTIFIER]",
956
+ "name": "production_name"
957
+ },
958
+ {
959
+ "type": "terminal",
960
+ "token": {
961
+ "column": 68,
962
+ "lexeme": "COLON",
963
+ "line": 4,
964
+ "type": 0
965
+ },
966
+ "identifier": "[COLON]",
967
+ "name": null
968
+ },
969
+ {
970
+ "type": "terminal",
971
+ "token": {
972
+ "column": 76,
973
+ "lexeme": "IDENTIFIER",
974
+ "line": 4,
975
+ "type": 0
976
+ },
977
+ "identifier": "[IDENTIFIER]",
978
+ "name": "uuid"
979
+ },
980
+ {
981
+ "type": "terminal",
982
+ "token": {
983
+ "column": 97,
984
+ "lexeme": "R_ANGLE",
985
+ "line": 4,
986
+ "type": 0
987
+ },
988
+ "identifier": "[R_ANGLE]",
989
+ "name": null
990
+ },
991
+ {
992
+ "type": "terminal",
993
+ "token": {
994
+ "column": 107,
995
+ "lexeme": "COLON",
996
+ "line": 4,
997
+ "type": 0
998
+ },
999
+ "identifier": "[COLON]",
1000
+ "name": null
1001
+ },
1002
+ {
1003
+ "type": "variable",
1004
+ "token": {
1005
+ "column": 115,
1006
+ "lexeme": "TOKENS",
1007
+ "line": 4,
1008
+ "type": 0
1009
+ },
1010
+ "identifier": "<TOKENS>",
1011
+ "name": "tokens"
1012
+ },
1013
+ {
1014
+ "type": "terminal",
1015
+ "token": {
1016
+ "column": 132,
1017
+ "lexeme": "SEMICOLON",
1018
+ "line": 4,
1019
+ "type": 0
1020
+ },
1021
+ "identifier": "[SEMICOLON]",
1022
+ "name": null
1023
+ }
1024
+ ]
1025
+ },
1026
+ {
1027
+ "lhs": {
1028
+ "column": 1,
1029
+ "lexeme": "TOKENS",
1030
+ "line": 5,
1031
+ "type": 0
1032
+ },
1033
+ "identifier": "<TOKENS>",
1034
+ "name": "tokens",
1035
+ "originalProductionIndex": 4,
1036
+ "rhs": [
1037
+ {
1038
+ "type": "variable",
1039
+ "token": {
1040
+ "column": 19,
1041
+ "lexeme": "TOKEN",
1042
+ "line": 5,
1043
+ "type": 0
1044
+ },
1045
+ "identifier": "<TOKEN>",
1046
+ "name": "token"
1047
+ }
1048
+ ]
1049
+ },
1050
+ {
1051
+ "lhs": {
1052
+ "column": 1,
1053
+ "lexeme": "TOKENS",
1054
+ "line": 5,
1055
+ "type": 0
1056
+ },
1057
+ "identifier": "<TOKENS>",
1058
+ "name": "tokens",
1059
+ "originalProductionIndex": 4,
1060
+ "rhs": [
1061
+ {
1062
+ "type": "variable",
1063
+ "token": {
1064
+ "column": 19,
1065
+ "lexeme": "TOKEN",
1066
+ "line": 5,
1067
+ "type": 0
1068
+ },
1069
+ "identifier": "<TOKEN>",
1070
+ "name": "token"
1071
+ },
1072
+ {
1073
+ "type": "variable",
1074
+ "token": {
1075
+ "column": 35,
1076
+ "lexeme": "TOKENS",
1077
+ "line": 5,
1078
+ "type": 0
1079
+ },
1080
+ "identifier": "<TOKENS>",
1081
+ "name": "rest"
1082
+ }
1083
+ ]
1084
+ },
1085
+ {
1086
+ "lhs": {
1087
+ "column": 1,
1088
+ "lexeme": "TOKEN",
1089
+ "line": 6,
1090
+ "type": 0
1091
+ },
1092
+ "identifier": "<TOKEN>",
1093
+ "name": "token",
1094
+ "originalProductionIndex": 5,
1095
+ "rhs": [
1096
+ {
1097
+ "type": "variable",
1098
+ "token": {
1099
+ "column": 17,
1100
+ "lexeme": "VARIABLE",
1101
+ "line": 6,
1102
+ "type": 0
1103
+ },
1104
+ "identifier": "<VARIABLE>",
1105
+ "name": "token"
1106
+ }
1107
+ ]
1108
+ },
1109
+ {
1110
+ "lhs": {
1111
+ "column": 1,
1112
+ "lexeme": "TOKEN",
1113
+ "line": 6,
1114
+ "type": 0
1115
+ },
1116
+ "identifier": "<TOKEN>",
1117
+ "name": "token",
1118
+ "originalProductionIndex": 5,
1119
+ "rhs": [
1120
+ {
1121
+ "type": "variable",
1122
+ "token": {
1123
+ "column": 28,
1124
+ "lexeme": "TERMINAL",
1125
+ "line": 6,
1126
+ "type": 0
1127
+ },
1128
+ "identifier": "<TERMINAL>",
1129
+ "name": "token"
1130
+ }
1131
+ ]
1132
+ },
1133
+ {
1134
+ "lhs": {
1135
+ "column": 1,
1136
+ "lexeme": "TOKEN",
1137
+ "line": 7,
1138
+ "type": 0
1139
+ },
1140
+ "identifier": "<TOKEN>",
1141
+ "name": "grouped_token",
1142
+ "originalProductionIndex": 6,
1143
+ "rhs": [
1144
+ {
1145
+ "type": "terminal",
1146
+ "token": {
1147
+ "column": 25,
1148
+ "lexeme": "L_PAREN",
1149
+ "line": 7,
1150
+ "type": 0
1151
+ },
1152
+ "identifier": "[L_PAREN]",
1153
+ "name": null
1154
+ },
1155
+ {
1156
+ "type": "variable",
1157
+ "token": {
1158
+ "column": 35,
1159
+ "lexeme": "TOKENS",
1160
+ "line": 7,
1161
+ "type": 0
1162
+ },
1163
+ "identifier": "<TOKENS>",
1164
+ "name": "tokens"
1165
+ },
1166
+ {
1167
+ "type": "terminal",
1168
+ "token": {
1169
+ "column": 52,
1170
+ "lexeme": "R_PAREN",
1171
+ "line": 7,
1172
+ "type": 0
1173
+ },
1174
+ "identifier": "[R_PAREN]",
1175
+ "name": null
1176
+ },
1177
+ {
1178
+ "type": "terminal",
1179
+ "token": {
1180
+ "column": 62,
1181
+ "lexeme": "QUESTION_MARK",
1182
+ "line": 7,
1183
+ "type": 0
1184
+ },
1185
+ "identifier": "[QUESTION_MARK]",
1186
+ "name": "question_mark"
1187
+ }
1188
+ ]
1189
+ },
1190
+ {
1191
+ "lhs": {
1192
+ "column": 1,
1193
+ "lexeme": "VARIABLE",
1194
+ "line": 8,
1195
+ "type": 0
1196
+ },
1197
+ "identifier": "<VARIABLE>",
1198
+ "name": "variable",
1199
+ "originalProductionIndex": 7,
1200
+ "rhs": [
1201
+ {
1202
+ "type": "terminal",
1203
+ "token": {
1204
+ "column": 23,
1205
+ "lexeme": "L_ANGLE",
1206
+ "line": 8,
1207
+ "type": 0
1208
+ },
1209
+ "identifier": "[L_ANGLE]",
1210
+ "name": null
1211
+ },
1212
+ {
1213
+ "type": "variable",
1214
+ "token": {
1215
+ "column": 33,
1216
+ "lexeme": "INSIDE",
1217
+ "line": 8,
1218
+ "type": 0
1219
+ },
1220
+ "identifier": "<INSIDE>",
1221
+ "name": "inside"
1222
+ },
1223
+ {
1224
+ "type": "terminal",
1225
+ "token": {
1226
+ "column": 86,
1227
+ "lexeme": "R_ANGLE",
1228
+ "line": 8,
1229
+ "type": 0
1230
+ },
1231
+ "identifier": "[R_ANGLE]",
1232
+ "name": null
1233
+ }
1234
+ ]
1235
+ },
1236
+ {
1237
+ "lhs": {
1238
+ "column": 1,
1239
+ "lexeme": "VARIABLE",
1240
+ "line": 8,
1241
+ "type": 0
1242
+ },
1243
+ "identifier": "<VARIABLE>",
1244
+ "name": "variable",
1245
+ "originalProductionIndex": 7,
1246
+ "rhs": [
1247
+ {
1248
+ "type": "terminal",
1249
+ "token": {
1250
+ "column": 23,
1251
+ "lexeme": "L_ANGLE",
1252
+ "line": 8,
1253
+ "type": 0
1254
+ },
1255
+ "identifier": "[L_ANGLE]",
1256
+ "name": null
1257
+ },
1258
+ {
1259
+ "type": "variable",
1260
+ "token": {
1261
+ "column": 33,
1262
+ "lexeme": "INSIDE",
1263
+ "line": 8,
1264
+ "type": 0
1265
+ },
1266
+ "identifier": "<INSIDE>",
1267
+ "name": "inside"
1268
+ },
1269
+ {
1270
+ "type": "terminal",
1271
+ "token": {
1272
+ "column": 51,
1273
+ "lexeme": "COLON",
1274
+ "line": 8,
1275
+ "type": 0
1276
+ },
1277
+ "identifier": "[COLON]",
1278
+ "name": null
1279
+ },
1280
+ {
1281
+ "type": "terminal",
1282
+ "token": {
1283
+ "column": 59,
1284
+ "lexeme": "IDENTIFIER",
1285
+ "line": 8,
1286
+ "type": 0
1287
+ },
1288
+ "identifier": "[IDENTIFIER]",
1289
+ "name": "token_name"
1290
+ },
1291
+ {
1292
+ "type": "terminal",
1293
+ "token": {
1294
+ "column": 86,
1295
+ "lexeme": "R_ANGLE",
1296
+ "line": 8,
1297
+ "type": 0
1298
+ },
1299
+ "identifier": "[R_ANGLE]",
1300
+ "name": null
1301
+ }
1302
+ ]
1303
+ },
1304
+ {
1305
+ "lhs": {
1306
+ "column": 1,
1307
+ "lexeme": "TERMINAL",
1308
+ "line": 9,
1309
+ "type": 0
1310
+ },
1311
+ "identifier": "<TERMINAL>",
1312
+ "name": "terminal",
1313
+ "originalProductionIndex": 8,
1314
+ "rhs": [
1315
+ {
1316
+ "type": "terminal",
1317
+ "token": {
1318
+ "column": 23,
1319
+ "lexeme": "L_BRACKET",
1320
+ "line": 9,
1321
+ "type": 0
1322
+ },
1323
+ "identifier": "[L_BRACKET]",
1324
+ "name": null
1325
+ },
1326
+ {
1327
+ "type": "variable",
1328
+ "token": {
1329
+ "column": 35,
1330
+ "lexeme": "INSIDE",
1331
+ "line": 9,
1332
+ "type": 0
1333
+ },
1334
+ "identifier": "<INSIDE>",
1335
+ "name": "inside"
1336
+ },
1337
+ {
1338
+ "type": "terminal",
1339
+ "token": {
1340
+ "column": 88,
1341
+ "lexeme": "R_BRACKET",
1342
+ "line": 9,
1343
+ "type": 0
1344
+ },
1345
+ "identifier": "[R_BRACKET]",
1346
+ "name": null
1347
+ }
1348
+ ]
1349
+ },
1350
+ {
1351
+ "lhs": {
1352
+ "column": 1,
1353
+ "lexeme": "TERMINAL",
1354
+ "line": 9,
1355
+ "type": 0
1356
+ },
1357
+ "identifier": "<TERMINAL>",
1358
+ "name": "terminal",
1359
+ "originalProductionIndex": 8,
1360
+ "rhs": [
1361
+ {
1362
+ "type": "terminal",
1363
+ "token": {
1364
+ "column": 23,
1365
+ "lexeme": "L_BRACKET",
1366
+ "line": 9,
1367
+ "type": 0
1368
+ },
1369
+ "identifier": "[L_BRACKET]",
1370
+ "name": null
1371
+ },
1372
+ {
1373
+ "type": "variable",
1374
+ "token": {
1375
+ "column": 35,
1376
+ "lexeme": "INSIDE",
1377
+ "line": 9,
1378
+ "type": 0
1379
+ },
1380
+ "identifier": "<INSIDE>",
1381
+ "name": "inside"
1382
+ },
1383
+ {
1384
+ "type": "terminal",
1385
+ "token": {
1386
+ "column": 53,
1387
+ "lexeme": "COLON",
1388
+ "line": 9,
1389
+ "type": 0
1390
+ },
1391
+ "identifier": "[COLON]",
1392
+ "name": null
1393
+ },
1394
+ {
1395
+ "type": "terminal",
1396
+ "token": {
1397
+ "column": 61,
1398
+ "lexeme": "IDENTIFIER",
1399
+ "line": 9,
1400
+ "type": 0
1401
+ },
1402
+ "identifier": "[IDENTIFIER]",
1403
+ "name": "token_name"
1404
+ },
1405
+ {
1406
+ "type": "terminal",
1407
+ "token": {
1408
+ "column": 88,
1409
+ "lexeme": "R_BRACKET",
1410
+ "line": 9,
1411
+ "type": 0
1412
+ },
1413
+ "identifier": "[R_BRACKET]",
1414
+ "name": null
1415
+ }
1416
+ ]
1417
+ },
1418
+ {
1419
+ "lhs": {
1420
+ "column": 1,
1421
+ "lexeme": "INSIDE",
1422
+ "line": 10,
1423
+ "type": 0
1424
+ },
1425
+ "identifier": "<INSIDE>",
1426
+ "name": "inside",
1427
+ "originalProductionIndex": 9,
1428
+ "rhs": [
1429
+ {
1430
+ "type": "terminal",
1431
+ "token": {
1432
+ "column": 19,
1433
+ "lexeme": "IDENTIFIER",
1434
+ "line": 10,
1435
+ "type": 0
1436
+ },
1437
+ "identifier": "[IDENTIFIER]",
1438
+ "name": "identifier"
1439
+ }
1440
+ ]
1441
+ },
1442
+ {
1443
+ "lhs": {
1444
+ "column": 1,
1445
+ "lexeme": "INSIDE",
1446
+ "line": 10,
1447
+ "type": 0
1448
+ },
1449
+ "identifier": "<INSIDE>",
1450
+ "name": "inside",
1451
+ "originalProductionIndex": 9,
1452
+ "rhs": [
1453
+ {
1454
+ "type": "terminal",
1455
+ "token": {
1456
+ "column": 19,
1457
+ "lexeme": "IDENTIFIER",
1458
+ "line": 10,
1459
+ "type": 0
1460
+ },
1461
+ "identifier": "[IDENTIFIER]",
1462
+ "name": "identifier"
1463
+ },
1464
+ {
1465
+ "type": "terminal",
1466
+ "token": {
1467
+ "column": 45,
1468
+ "lexeme": "PIPE",
1469
+ "line": 10,
1470
+ "type": 0
1471
+ },
1472
+ "identifier": "[PIPE]",
1473
+ "name": null
1474
+ },
1475
+ {
1476
+ "type": "variable",
1477
+ "token": {
1478
+ "column": 52,
1479
+ "lexeme": "INSIDE",
1480
+ "line": 10,
1481
+ "type": 0
1482
+ },
1483
+ "identifier": "<INSIDE>",
1484
+ "name": "rest"
1485
+ }
1486
+ ]
1487
+ }
1488
+ ];
1489
+ export const selfhosted = { states, productions };