1
2 package org.openswift.interpreter;
3
4 import org.antlr.runtime.*;
5 import java.util.Stack;
6 import java.util.List;
7 import java.util.ArrayList;
8
9 public class SwiftLexer extends Lexer {
10 public static final int TAG_50A=29;
11 public static final int TAG_50F=31;
12 public static final int END_ALL_BLOCK=15;
13 public static final int START_MAC_TRAILER=11;
14 public static final int CRLF=35;
15 public static final int TAG_50K=30;
16 public static final int START_DLM_TRAILER=14;
17 public static final int START_BASIC_HEADER_BLOCK=4;
18 public static final int START_BANKING_PRIORITY_CODE=9;
19 public static final int NUMBER=34;
20 public static final int TAG_26T=25;
21 public static final int START_MESSAGE_USER_REFERENCE=10;
22 public static final int TAG_32A=26;
23 public static final int MINUS=19;
24 public static final int EOF=-1;
25 public static final int START_USER_HEADER_BLOCK=6;
26 public static final int TAG_20=21;
27 public static final int TAG_13C=22;
28 public static final int LOWERCASE_LETTER=33;
29 public static final int AMOUNT_SEPARATOR=20;
30 public static final int START_TEXT_BLOCK=7;
31 public static final int UPPERCASE_LETTER=32;
32 public static final int TAG_23B=23;
33 public static final int TAG_23E=24;
34 public static final int CODE_SEPARATOR=17;
35 public static final int START_PDE_TRAILER=13;
36 public static final int START_CHK_TRAILER=12;
37 public static final int END_TEXT_BLOCK=16;
38 public static final int TAG_36=28;
39 public static final int START_TRAILER_BLOCK=8;
40 public static final int PLUS=18;
41 public static final int TAG_33B=27;
42 public static final int START_APPLICATION_HEADER_BLOCK=5;
43
44
45
46
47 public SwiftLexer() {;}
48 public SwiftLexer(CharStream input) {
49 this(input, new RecognizerSharedState());
50 }
51 public SwiftLexer(CharStream input, RecognizerSharedState state) {
52 super(input,state);
53
54 }
55 public String getGrammarFileName() { return "org/openswift/interpreter/SwiftLexer.g"; }
56
57
58 public final void mSTART_BASIC_HEADER_BLOCK() throws RecognitionException {
59 try {
60 int _type = START_BASIC_HEADER_BLOCK;
61 int _channel = DEFAULT_TOKEN_CHANNEL;
62
63
64 {
65 match("{1:");
66
67
68 }
69
70 state.type = _type;
71 state.channel = _channel;
72 }
73 finally {
74 }
75 }
76
77
78
79 public final void mSTART_APPLICATION_HEADER_BLOCK() throws RecognitionException {
80 try {
81 int _type = START_APPLICATION_HEADER_BLOCK;
82 int _channel = DEFAULT_TOKEN_CHANNEL;
83
84
85 {
86 match("{2:");
87
88
89 }
90
91 state.type = _type;
92 state.channel = _channel;
93 }
94 finally {
95 }
96 }
97
98
99
100 public final void mSTART_USER_HEADER_BLOCK() throws RecognitionException {
101 try {
102 int _type = START_USER_HEADER_BLOCK;
103 int _channel = DEFAULT_TOKEN_CHANNEL;
104
105
106 {
107 match("{3:");
108
109
110 }
111
112 state.type = _type;
113 state.channel = _channel;
114 }
115 finally {
116 }
117 }
118
119
120
121 public final void mSTART_TEXT_BLOCK() throws RecognitionException {
122 try {
123 int _type = START_TEXT_BLOCK;
124 int _channel = DEFAULT_TOKEN_CHANNEL;
125
126
127 {
128 match("{4:");
129
130
131 }
132
133 state.type = _type;
134 state.channel = _channel;
135 }
136 finally {
137 }
138 }
139
140
141
142 public final void mSTART_TRAILER_BLOCK() throws RecognitionException {
143 try {
144 int _type = START_TRAILER_BLOCK;
145 int _channel = DEFAULT_TOKEN_CHANNEL;
146
147
148 {
149 match("{5:");
150
151
152 }
153
154 state.type = _type;
155 state.channel = _channel;
156 }
157 finally {
158 }
159 }
160
161
162
163 public final void mSTART_BANKING_PRIORITY_CODE() throws RecognitionException {
164 try {
165 int _type = START_BANKING_PRIORITY_CODE;
166 int _channel = DEFAULT_TOKEN_CHANNEL;
167
168
169 {
170 match("{113:");
171
172
173 }
174
175 state.type = _type;
176 state.channel = _channel;
177 }
178 finally {
179 }
180 }
181
182
183
184 public final void mSTART_MESSAGE_USER_REFERENCE() throws RecognitionException {
185 try {
186 int _type = START_MESSAGE_USER_REFERENCE;
187 int _channel = DEFAULT_TOKEN_CHANNEL;
188
189
190 {
191 match("{108:");
192
193
194 }
195
196 state.type = _type;
197 state.channel = _channel;
198 }
199 finally {
200 }
201 }
202
203
204
205 public final void mSTART_MAC_TRAILER() throws RecognitionException {
206 try {
207 int _type = START_MAC_TRAILER;
208 int _channel = DEFAULT_TOKEN_CHANNEL;
209
210
211 {
212 match("{MAC:");
213
214
215 }
216
217 state.type = _type;
218 state.channel = _channel;
219 }
220 finally {
221 }
222 }
223
224
225
226 public final void mSTART_CHK_TRAILER() throws RecognitionException {
227 try {
228 int _type = START_CHK_TRAILER;
229 int _channel = DEFAULT_TOKEN_CHANNEL;
230
231
232 {
233 match("{CHK:");
234
235
236 }
237
238 state.type = _type;
239 state.channel = _channel;
240 }
241 finally {
242 }
243 }
244
245
246
247 public final void mSTART_PDE_TRAILER() throws RecognitionException {
248 try {
249 int _type = START_PDE_TRAILER;
250 int _channel = DEFAULT_TOKEN_CHANNEL;
251
252
253 {
254 match("{PDE:");
255
256
257 }
258
259 state.type = _type;
260 state.channel = _channel;
261 }
262 finally {
263 }
264 }
265
266
267
268 public final void mSTART_DLM_TRAILER() throws RecognitionException {
269 try {
270 int _type = START_DLM_TRAILER;
271 int _channel = DEFAULT_TOKEN_CHANNEL;
272
273
274 {
275 match("{DLM:");
276
277
278 }
279
280 state.type = _type;
281 state.channel = _channel;
282 }
283 finally {
284 }
285 }
286
287
288
289 public final void mEND_ALL_BLOCK() throws RecognitionException {
290 try {
291 int _type = END_ALL_BLOCK;
292 int _channel = DEFAULT_TOKEN_CHANNEL;
293
294
295 {
296 match('}');
297
298 }
299
300 state.type = _type;
301 state.channel = _channel;
302 }
303 finally {
304 }
305 }
306
307
308
309 public final void mEND_TEXT_BLOCK() throws RecognitionException {
310 try {
311 int _type = END_TEXT_BLOCK;
312 int _channel = DEFAULT_TOKEN_CHANNEL;
313
314
315 {
316 match("-}");
317
318
319 }
320
321 state.type = _type;
322 state.channel = _channel;
323 }
324 finally {
325 }
326 }
327
328
329
330 public final void mCODE_SEPARATOR() throws RecognitionException {
331 try {
332 int _type = CODE_SEPARATOR;
333 int _channel = DEFAULT_TOKEN_CHANNEL;
334
335
336 {
337 match('/');
338
339 }
340
341 state.type = _type;
342 state.channel = _channel;
343 }
344 finally {
345 }
346 }
347
348
349
350 public final void mPLUS() throws RecognitionException {
351 try {
352 int _type = PLUS;
353 int _channel = DEFAULT_TOKEN_CHANNEL;
354
355
356 {
357 match('+');
358
359 }
360
361 state.type = _type;
362 state.channel = _channel;
363 }
364 finally {
365 }
366 }
367
368
369
370 public final void mMINUS() throws RecognitionException {
371 try {
372 int _type = MINUS;
373 int _channel = DEFAULT_TOKEN_CHANNEL;
374
375
376 {
377 match('-');
378
379 }
380
381 state.type = _type;
382 state.channel = _channel;
383 }
384 finally {
385 }
386 }
387
388
389
390 public final void mAMOUNT_SEPARATOR() throws RecognitionException {
391 try {
392 int _type = AMOUNT_SEPARATOR;
393 int _channel = DEFAULT_TOKEN_CHANNEL;
394
395
396 {
397 match(',');
398
399 }
400
401 state.type = _type;
402 state.channel = _channel;
403 }
404 finally {
405 }
406 }
407
408
409
410 public final void mTAG_20() throws RecognitionException {
411 try {
412 int _type = TAG_20;
413 int _channel = DEFAULT_TOKEN_CHANNEL;
414
415
416 {
417 match(":20:");
418
419
420 }
421
422 state.type = _type;
423 state.channel = _channel;
424 }
425 finally {
426 }
427 }
428
429
430
431 public final void mTAG_13C() throws RecognitionException {
432 try {
433 int _type = TAG_13C;
434 int _channel = DEFAULT_TOKEN_CHANNEL;
435
436
437 {
438 match(":13C:");
439
440
441 }
442
443 state.type = _type;
444 state.channel = _channel;
445 }
446 finally {
447 }
448 }
449
450
451
452 public final void mTAG_23B() throws RecognitionException {
453 try {
454 int _type = TAG_23B;
455 int _channel = DEFAULT_TOKEN_CHANNEL;
456
457
458 {
459 match(":23B:");
460
461
462 }
463
464 state.type = _type;
465 state.channel = _channel;
466 }
467 finally {
468 }
469 }
470
471
472
473 public final void mTAG_23E() throws RecognitionException {
474 try {
475 int _type = TAG_23E;
476 int _channel = DEFAULT_TOKEN_CHANNEL;
477
478
479 {
480 match(":23E:");
481
482
483 }
484
485 state.type = _type;
486 state.channel = _channel;
487 }
488 finally {
489 }
490 }
491
492
493
494 public final void mTAG_26T() throws RecognitionException {
495 try {
496 int _type = TAG_26T;
497 int _channel = DEFAULT_TOKEN_CHANNEL;
498
499
500 {
501 match(":26T:");
502
503
504 }
505
506 state.type = _type;
507 state.channel = _channel;
508 }
509 finally {
510 }
511 }
512
513
514
515 public final void mTAG_32A() throws RecognitionException {
516 try {
517 int _type = TAG_32A;
518 int _channel = DEFAULT_TOKEN_CHANNEL;
519
520
521 {
522 match(":32A:");
523
524
525 }
526
527 state.type = _type;
528 state.channel = _channel;
529 }
530 finally {
531 }
532 }
533
534
535
536 public final void mTAG_33B() throws RecognitionException {
537 try {
538 int _type = TAG_33B;
539 int _channel = DEFAULT_TOKEN_CHANNEL;
540
541
542 {
543 match(":33B:");
544
545
546 }
547
548 state.type = _type;
549 state.channel = _channel;
550 }
551 finally {
552 }
553 }
554
555
556
557 public final void mTAG_36() throws RecognitionException {
558 try {
559 int _type = TAG_36;
560 int _channel = DEFAULT_TOKEN_CHANNEL;
561
562
563 {
564 match(":36:");
565
566
567 }
568
569 state.type = _type;
570 state.channel = _channel;
571 }
572 finally {
573 }
574 }
575
576
577
578 public final void mTAG_50A() throws RecognitionException {
579 try {
580 int _type = TAG_50A;
581 int _channel = DEFAULT_TOKEN_CHANNEL;
582
583
584 {
585 match(":50A:");
586
587
588 }
589
590 state.type = _type;
591 state.channel = _channel;
592 }
593 finally {
594 }
595 }
596
597
598
599 public final void mTAG_50K() throws RecognitionException {
600 try {
601 int _type = TAG_50K;
602 int _channel = DEFAULT_TOKEN_CHANNEL;
603
604
605 {
606 match(":50K:");
607
608
609 }
610
611 state.type = _type;
612 state.channel = _channel;
613 }
614 finally {
615 }
616 }
617
618
619
620 public final void mTAG_50F() throws RecognitionException {
621 try {
622 int _type = TAG_50F;
623 int _channel = DEFAULT_TOKEN_CHANNEL;
624
625
626 {
627 match(":50F:");
628
629
630 }
631
632 state.type = _type;
633 state.channel = _channel;
634 }
635 finally {
636 }
637 }
638
639
640
641 public final void mUPPERCASE_LETTER() throws RecognitionException {
642 try {
643 int _type = UPPERCASE_LETTER;
644 int _channel = DEFAULT_TOKEN_CHANNEL;
645
646
647 {
648 matchRange('A','Z');
649
650 }
651
652 state.type = _type;
653 state.channel = _channel;
654 }
655 finally {
656 }
657 }
658
659
660
661 public final void mLOWERCASE_LETTER() throws RecognitionException {
662 try {
663 int _type = LOWERCASE_LETTER;
664 int _channel = DEFAULT_TOKEN_CHANNEL;
665
666
667 {
668 matchRange('a','z');
669
670 }
671
672 state.type = _type;
673 state.channel = _channel;
674 }
675 finally {
676 }
677 }
678
679
680
681 public final void mNUMBER() throws RecognitionException {
682 try {
683 int _type = NUMBER;
684 int _channel = DEFAULT_TOKEN_CHANNEL;
685
686
687 {
688 matchRange('0','9');
689
690 }
691
692 state.type = _type;
693 state.channel = _channel;
694 }
695 finally {
696 }
697 }
698
699
700
701 public final void mCRLF() throws RecognitionException {
702 try {
703 int _type = CRLF;
704 int _channel = DEFAULT_TOKEN_CHANNEL;
705
706
707 {
708 match("\r\n");
709
710
711 }
712
713 state.type = _type;
714 state.channel = _channel;
715 }
716 finally {
717 }
718 }
719
720
721 public void mTokens() throws RecognitionException {
722
723 int alt1=32;
724 alt1 = dfa1.predict(input);
725 switch (alt1) {
726 case 1 :
727
728 {
729 mSTART_BASIC_HEADER_BLOCK();
730
731 }
732 break;
733 case 2 :
734
735 {
736 mSTART_APPLICATION_HEADER_BLOCK();
737
738 }
739 break;
740 case 3 :
741
742 {
743 mSTART_USER_HEADER_BLOCK();
744
745 }
746 break;
747 case 4 :
748
749 {
750 mSTART_TEXT_BLOCK();
751
752 }
753 break;
754 case 5 :
755
756 {
757 mSTART_TRAILER_BLOCK();
758
759 }
760 break;
761 case 6 :
762
763 {
764 mSTART_BANKING_PRIORITY_CODE();
765
766 }
767 break;
768 case 7 :
769
770 {
771 mSTART_MESSAGE_USER_REFERENCE();
772
773 }
774 break;
775 case 8 :
776
777 {
778 mSTART_MAC_TRAILER();
779
780 }
781 break;
782 case 9 :
783
784 {
785 mSTART_CHK_TRAILER();
786
787 }
788 break;
789 case 10 :
790
791 {
792 mSTART_PDE_TRAILER();
793
794 }
795 break;
796 case 11 :
797
798 {
799 mSTART_DLM_TRAILER();
800
801 }
802 break;
803 case 12 :
804
805 {
806 mEND_ALL_BLOCK();
807
808 }
809 break;
810 case 13 :
811
812 {
813 mEND_TEXT_BLOCK();
814
815 }
816 break;
817 case 14 :
818
819 {
820 mCODE_SEPARATOR();
821
822 }
823 break;
824 case 15 :
825
826 {
827 mPLUS();
828
829 }
830 break;
831 case 16 :
832
833 {
834 mMINUS();
835
836 }
837 break;
838 case 17 :
839
840 {
841 mAMOUNT_SEPARATOR();
842
843 }
844 break;
845 case 18 :
846
847 {
848 mTAG_20();
849
850 }
851 break;
852 case 19 :
853
854 {
855 mTAG_13C();
856
857 }
858 break;
859 case 20 :
860
861 {
862 mTAG_23B();
863
864 }
865 break;
866 case 21 :
867
868 {
869 mTAG_23E();
870
871 }
872 break;
873 case 22 :
874
875 {
876 mTAG_26T();
877
878 }
879 break;
880 case 23 :
881
882 {
883 mTAG_32A();
884
885 }
886 break;
887 case 24 :
888
889 {
890 mTAG_33B();
891
892 }
893 break;
894 case 25 :
895
896 {
897 mTAG_36();
898
899 }
900 break;
901 case 26 :
902
903 {
904 mTAG_50A();
905
906 }
907 break;
908 case 27 :
909
910 {
911 mTAG_50K();
912
913 }
914 break;
915 case 28 :
916
917 {
918 mTAG_50F();
919
920 }
921 break;
922 case 29 :
923
924 {
925 mUPPERCASE_LETTER();
926
927 }
928 break;
929 case 30 :
930
931 {
932 mLOWERCASE_LETTER();
933
934 }
935 break;
936 case 31 :
937
938 {
939 mNUMBER();
940
941 }
942 break;
943 case 32 :
944
945 {
946 mCRLF();
947
948 }
949 break;
950
951 }
952
953 }
954
955
956 protected DFA1 dfa1 = new DFA1(this);
957 static final String DFA1_eotS =
958 "\3\uffff\1\26\46\uffff";
959 static final String DFA1_eofS =
960 "\52\uffff";
961 static final String DFA1_minS =
962 "\1\15\1\61\1\uffff\1\175\3\uffff\1\61\4\uffff\1\60\12\uffff\1\60"+
963 "\1\uffff\1\62\1\60\4\uffff\1\102\4\uffff\1\101\5\uffff";
964 static final String DFA1_maxS =
965 "\1\175\1\120\1\uffff\1\175\3\uffff\1\65\4\uffff\1\72\12\uffff\1"+
966 "\66\1\uffff\1\66\1\60\4\uffff\1\105\4\uffff\1\113\5\uffff";
967 static final String DFA1_acceptS =
968 "\2\uffff\1\14\1\uffff\1\16\1\17\1\21\1\uffff\1\35\1\36\1\37\1\40"+
969 "\1\uffff\1\2\1\3\1\4\1\5\1\10\1\11\1\12\1\13\1\15\1\20\1\uffff\1"+
970 "\23\2\uffff\1\1\1\6\1\7\1\22\1\uffff\1\26\1\27\1\30\1\31\1\uffff"+
971 "\1\24\1\25\1\32\1\33\1\34";
972 static final String DFA1_specialS =
973 "\52\uffff}>";
974 static final String[] DFA1_transitionS = {
975 "\1\13\35\uffff\1\5\1\6\1\3\1\uffff\1\4\12\12\1\7\6\uffff\32"+
976 "\10\6\uffff\32\11\1\1\1\uffff\1\2",
977 "\1\14\1\15\1\16\1\17\1\20\15\uffff\1\22\1\24\10\uffff\1\21"+
978 "\2\uffff\1\23",
979 "",
980 "\1\25",
981 "",
982 "",
983 "",
984 "\1\30\1\27\1\31\1\uffff\1\32",
985 "",
986 "",
987 "",
988 "",
989 "\1\35\1\34\10\uffff\1\33",
990 "",
991 "",
992 "",
993 "",
994 "",
995 "",
996 "",
997 "",
998 "",
999 "",
1000 "\1\36\2\uffff\1\37\2\uffff\1\40",
1001 "",
1002 "\1\41\1\42\2\uffff\1\43",
1003 "\1\44",
1004 "",
1005 "",
1006 "",
1007 "",
1008 "\1\45\2\uffff\1\46",
1009 "",
1010 "",
1011 "",
1012 "",
1013 "\1\47\4\uffff\1\51\4\uffff\1\50",
1014 "",
1015 "",
1016 "",
1017 "",
1018 ""
1019 };
1020
1021 static final short[] DFA1_eot = DFA.unpackEncodedString(DFA1_eotS);
1022 static final short[] DFA1_eof = DFA.unpackEncodedString(DFA1_eofS);
1023 static final char[] DFA1_min = DFA.unpackEncodedStringToUnsignedChars(DFA1_minS);
1024 static final char[] DFA1_max = DFA.unpackEncodedStringToUnsignedChars(DFA1_maxS);
1025 static final short[] DFA1_accept = DFA.unpackEncodedString(DFA1_acceptS);
1026 static final short[] DFA1_special = DFA.unpackEncodedString(DFA1_specialS);
1027 static final short[][] DFA1_transition;
1028
1029 static {
1030 int numStates = DFA1_transitionS.length;
1031 DFA1_transition = new short[numStates][];
1032 for (int i=0; i<numStates; i++) {
1033 DFA1_transition[i] = DFA.unpackEncodedString(DFA1_transitionS[i]);
1034 }
1035 }
1036
1037 class DFA1 extends DFA {
1038
1039 public DFA1(BaseRecognizer recognizer) {
1040 this.recognizer = recognizer;
1041 this.decisionNumber = 1;
1042 this.eot = DFA1_eot;
1043 this.eof = DFA1_eof;
1044 this.min = DFA1_min;
1045 this.max = DFA1_max;
1046 this.accept = DFA1_accept;
1047 this.special = DFA1_special;
1048 this.transition = DFA1_transition;
1049 }
1050 public String getDescription() {
1051 return "1:1: Tokens : ( START_BASIC_HEADER_BLOCK | START_APPLICATION_HEADER_BLOCK | START_USER_HEADER_BLOCK | START_TEXT_BLOCK | START_TRAILER_BLOCK | START_BANKING_PRIORITY_CODE | START_MESSAGE_USER_REFERENCE | START_MAC_TRAILER | START_CHK_TRAILER | START_PDE_TRAILER | START_DLM_TRAILER | END_ALL_BLOCK | END_TEXT_BLOCK | CODE_SEPARATOR | PLUS | MINUS | AMOUNT_SEPARATOR | TAG_20 | TAG_13C | TAG_23B | TAG_23E | TAG_26T | TAG_32A | TAG_33B | TAG_36 | TAG_50A | TAG_50K | TAG_50F | UPPERCASE_LETTER | LOWERCASE_LETTER | NUMBER | CRLF );";
1052 }
1053 }
1054
1055
1056 }