-
Notifications
You must be signed in to change notification settings - Fork 0
/
minilang_lexer.nit
887 lines (887 loc) · 21.3 KB
/
minilang_lexer.nit
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
# Lexer generated by nitcc for the grammar minilangimport nitcc_runtime
import minilang_parser
class Lexer_minilang
super Lexer
redef fun start_state do return dfastate_0
end
redef class Object
private fun dfastate_0: DFAState0 do return once new DFAState0
private fun dfastate_1: DFAState1 do return once new DFAState1
private fun dfastate_2: DFAState2 do return once new DFAState2
private fun dfastate_3: DFAState3 do return once new DFAState3
private fun dfastate_4: DFAState4 do return once new DFAState4
private fun dfastate_5: DFAState5 do return once new DFAState5
private fun dfastate_6: DFAState6 do return once new DFAState6
private fun dfastate_7: DFAState7 do return once new DFAState7
private fun dfastate_8: DFAState8 do return once new DFAState8
private fun dfastate_9: DFAState9 do return once new DFAState9
private fun dfastate_10: DFAState10 do return once new DFAState10
private fun dfastate_11: DFAState11 do return once new DFAState11
private fun dfastate_12: DFAState12 do return once new DFAState12
private fun dfastate_13: DFAState13 do return once new DFAState13
private fun dfastate_14: DFAState14 do return once new DFAState14
private fun dfastate_15: DFAState15 do return once new DFAState15
private fun dfastate_16: DFAState16 do return once new DFAState16
private fun dfastate_17: DFAState17 do return once new DFAState17
private fun dfastate_18: DFAState18 do return once new DFAState18
private fun dfastate_19: DFAState19 do return once new DFAState19
private fun dfastate_20: DFAState20 do return once new DFAState20
private fun dfastate_21: DFAState21 do return once new DFAState21
private fun dfastate_22: DFAState22 do return once new DFAState22
private fun dfastate_23: DFAState23 do return once new DFAState23
private fun dfastate_24: DFAState24 do return once new DFAState24
private fun dfastate_25: DFAState25 do return once new DFAState25
private fun dfastate_26: DFAState26 do return once new DFAState26
private fun dfastate_27: DFAState27 do return once new DFAState27
private fun dfastate_28: DFAState28 do return once new DFAState28
private fun dfastate_29: DFAState29 do return once new DFAState29
private fun dfastate_30: DFAState30 do return once new DFAState30
private fun dfastate_31: DFAState31 do return once new DFAState31
private fun dfastate_32: DFAState32 do return once new DFAState32
private fun dfastate_33: DFAState33 do return once new DFAState33
private fun dfastate_34: DFAState34 do return once new DFAState34
private fun dfastate_35: DFAState35 do return once new DFAState35
private fun dfastate_36: DFAState36 do return once new DFAState36
private fun dfastate_37: DFAState37 do return once new DFAState37
private fun dfastate_38: DFAState38 do return once new DFAState38
private fun dfastate_39: DFAState39 do return once new DFAState39
private fun dfastate_40: DFAState40 do return once new DFAState40
private fun dfastate_41: DFAState41 do return once new DFAState41
private fun dfastate_42: DFAState42 do return once new DFAState42
private fun dfastate_43: DFAState43 do return once new DFAState43
private fun dfastate_44: DFAState44 do return once new DFAState44
private fun dfastate_45: DFAState45 do return once new DFAState45
private fun dfastate_46: DFAState46 do return once new DFAState46
private fun dfastate_47: DFAState47 do return once new DFAState47
private fun dfastate_48: DFAState48 do return once new DFAState48
private fun dfastate_49: DFAState49 do return once new DFAState49
private fun dfastate_50: DFAState50 do return once new DFAState50
private fun dfastate_51: DFAState51 do return once new DFAState51
private fun dfastate_52: DFAState52 do return once new DFAState52
private fun dfastate_53: DFAState53 do return once new DFAState53
end
class MyNToken
super NToken
end
class DFAState0
super DFAState
redef fun trans(char) do
var c = char.ascii
if c <= 8 then return null
if c <= 10 then return dfastate_1
if c <= 12 then return null
if c <= 13 then return dfastate_1
if c <= 31 then return null
if c <= 32 then return dfastate_1
if c <= 33 then return dfastate_2
if c <= 34 then return dfastate_3
if c <= 36 then return null
if c <= 37 then return dfastate_4
if c <= 39 then return null
if c <= 40 then return dfastate_5
if c <= 41 then return dfastate_6
if c <= 42 then return dfastate_7
if c <= 43 then return dfastate_8
if c <= 44 then return dfastate_9
if c <= 45 then return dfastate_10
if c <= 46 then return null
if c <= 47 then return dfastate_11
if c <= 57 then return dfastate_12
if c <= 58 then return null
if c <= 59 then return dfastate_13
if c <= 60 then return dfastate_14
if c <= 61 then return dfastate_15
if c <= 62 then return dfastate_16
if c <= 96 then return null
if c <= 99 then return dfastate_17
if c <= 100 then return dfastate_18
if c <= 101 then return dfastate_19
if c <= 104 then return dfastate_17
if c <= 105 then return dfastate_20
if c <= 111 then return dfastate_17
if c <= 112 then return dfastate_21
if c <= 113 then return dfastate_17
if c <= 114 then return dfastate_22
if c <= 118 then return dfastate_17
if c <= 119 then return dfastate_23
if c <= 122 then return dfastate_17
if c <= 123 then return dfastate_24
if c <= 124 then return null
if c <= 125 then return dfastate_25
return null
end
end
class DFAState1
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
return null
end
end
class DFAState2
super DFAState
redef fun trans(char) do
var c = char.ascii
if c <= 60 then return null
if c <= 61 then return dfastate_53
return null
end
end
class DFAState3
super DFAState
redef fun trans(char) do
var c = char.ascii
if c <= 33 then return dfastate_3
if c <= 34 then return dfastate_52
return dfastate_3
end
end
class DFAState4
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_37d_39d
t.position = position
t.text = text
return t
end
end
class DFAState5
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_40d_39d
t.position = position
t.text = text
return t
end
end
class DFAState6
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_41d_39d
t.position = position
t.text = text
return t
end
end
class DFAState7
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_42d_39d
t.position = position
t.text = text
return t
end
end
class DFAState8
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_43d_39d
t.position = position
t.text = text
return t
end
end
class DFAState9
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_44d_39d
t.position = position
t.text = text
return t
end
end
class DFAState10
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_45d_39d
t.position = position
t.text = text
return t
end
end
class DFAState11
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_47d_39d
t.position = position
t.text = text
return t
end
end
class DFAState12
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nint
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 47 then return null
if c <= 57 then return dfastate_12
return null
end
end
class DFAState13
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_59d_39d
t.position = position
t.text = text
return t
end
end
class DFAState14
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_60d_39d
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 60 then return null
if c <= 61 then return dfastate_51
return null
end
end
class DFAState15
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_61d_39d
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 60 then return null
if c <= 61 then return dfastate_50
return null
end
end
class DFAState16
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_62d_39d
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 60 then return null
if c <= 61 then return dfastate_49
return null
end
end
class DFAState17
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 122 then return dfastate_17
return null
end
end
class DFAState18
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 100 then return dfastate_17
if c <= 101 then return dfastate_47
if c <= 122 then return dfastate_17
return null
end
end
class DFAState19
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 107 then return dfastate_17
if c <= 108 then return dfastate_44
if c <= 122 then return dfastate_17
return null
end
end
class DFAState20
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 101 then return dfastate_17
if c <= 102 then return dfastate_41
if c <= 109 then return dfastate_17
if c <= 110 then return dfastate_42
if c <= 122 then return dfastate_17
return null
end
end
class DFAState21
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 113 then return dfastate_17
if c <= 114 then return dfastate_37
if c <= 122 then return dfastate_17
return null
end
end
class DFAState22
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 100 then return dfastate_17
if c <= 101 then return dfastate_30
if c <= 122 then return dfastate_17
return null
end
end
class DFAState23
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 103 then return dfastate_17
if c <= 104 then return dfastate_26
if c <= 122 then return dfastate_17
return null
end
end
class DFAState24
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_123d_39d
t.position = position
t.text = text
return t
end
end
class DFAState25
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_125d_39d
t.position = position
t.text = text
return t
end
end
class DFAState26
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 104 then return dfastate_17
if c <= 105 then return dfastate_27
if c <= 122 then return dfastate_17
return null
end
end
class DFAState27
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 107 then return dfastate_17
if c <= 108 then return dfastate_28
if c <= 122 then return dfastate_17
return null
end
end
class DFAState28
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 100 then return dfastate_17
if c <= 101 then return dfastate_29
if c <= 122 then return dfastate_17
return null
end
end
class DFAState29
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39dwhile_39d
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 122 then return dfastate_17
return null
end
end
class DFAState30
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 97 then return dfastate_31
if c <= 115 then return dfastate_17
if c <= 116 then return dfastate_32
if c <= 122 then return dfastate_17
return null
end
end
class DFAState31
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 99 then return dfastate_17
if c <= 100 then return dfastate_36
if c <= 122 then return dfastate_17
return null
end
end
class DFAState32
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 116 then return dfastate_17
if c <= 117 then return dfastate_33
if c <= 122 then return dfastate_17
return null
end
end
class DFAState33
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 113 then return dfastate_17
if c <= 114 then return dfastate_34
if c <= 122 then return dfastate_17
return null
end
end
class DFAState34
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 109 then return dfastate_17
if c <= 110 then return dfastate_35
if c <= 122 then return dfastate_17
return null
end
end
class DFAState35
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39dreturn_39d
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 122 then return dfastate_17
return null
end
end
class DFAState36
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39dread_39d
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 122 then return dfastate_17
return null
end
end
class DFAState37
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 104 then return dfastate_17
if c <= 105 then return dfastate_38
if c <= 122 then return dfastate_17
return null
end
end
class DFAState38
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 109 then return dfastate_17
if c <= 110 then return dfastate_39
if c <= 122 then return dfastate_17
return null
end
end
class DFAState39
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 115 then return dfastate_17
if c <= 116 then return dfastate_40
if c <= 122 then return dfastate_17
return null
end
end
class DFAState40
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39dprint_39d
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 122 then return dfastate_17
return null
end
end
class DFAState41
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39dif_39d
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 122 then return dfastate_17
return null
end
end
class DFAState42
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 115 then return dfastate_17
if c <= 116 then return dfastate_43
if c <= 122 then return dfastate_17
return null
end
end
class DFAState43
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39dint_39d
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 122 then return dfastate_17
return null
end
end
class DFAState44
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 114 then return dfastate_17
if c <= 115 then return dfastate_45
if c <= 122 then return dfastate_17
return null
end
end
class DFAState45
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 100 then return dfastate_17
if c <= 101 then return dfastate_46
if c <= 122 then return dfastate_17
return null
end
end
class DFAState46
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39delse_39d
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 122 then return dfastate_17
return null
end
end
class DFAState47
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nid
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 101 then return dfastate_17
if c <= 102 then return dfastate_48
if c <= 122 then return dfastate_17
return null
end
end
class DFAState48
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39ddef_39d
t.position = position
t.text = text
return t
end
redef fun trans(char) do
var c = char.ascii
if c <= 96 then return null
if c <= 122 then return dfastate_17
return null
end
end
class DFAState49
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_62d_61d_39d
t.position = position
t.text = text
return t
end
end
class DFAState50
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_61d_61d_39d
t.position = position
t.text = text
return t
end
end
class DFAState51
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_60d_61d_39d
t.position = position
t.text = text
return t
end
end
class DFAState52
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new Nstr
t.position = position
t.text = text
return t
end
end
class DFAState53
super DFAState
redef fun is_accept do return true
redef fun make_token(position, text) do
var t = new N_39d_33d_61d_39d
t.position = position
t.text = text
return t
end
end