1
2
3
4
5 package testpanel;
6
7 import jsyntaxpane.lexers.*;
8 import jsyntaxpane.Token;
9 import jsyntaxpane.TokenType;
10
11
12 @SuppressWarnings("fallthrough")
13 public final class Er7Lexer extends DefaultJFlexLexer {
14
15
16 public static final int YYEOF = -1;
17
18
19 private static final int ZZ_BUFFERSIZE = 16384;
20
21
22 public static final int YYINITIAL = 0;
23 public static final int AT_START_OF_VALUE = 2;
24 public static final int WITHIN_VALUE = 4;
25 public static final int AT_DELIM = 6;
26
27
28
29
30
31
32
33 private static final int ZZ_LEXSTATE[] = {
34 0, 0, 1, 1, 2, 2, 3, 3
35 };
36
37
38
39
40 private static final int [] ZZ_CMAP_TOP = zzUnpackcmap_top();
41
42 private static final String ZZ_CMAP_TOP_PACKED_0 =
43 "\1\0\1\u0100\36\u0200\1\u0300\267\u0200\10\u0400\u1020\u0200";
44
45 private static int [] zzUnpackcmap_top() {
46 int [] result = new int[4352];
47 int offset = 0;
48 offset = zzUnpackcmap_top(ZZ_CMAP_TOP_PACKED_0, offset, result);
49 return result;
50 }
51
52 private static int zzUnpackcmap_top(String packed, int offset, int [] result) {
53 int i = 0;
54 int j = offset;
55 int l = packed.length();
56 while (i < l) {
57 int count = packed.charAt(i++);
58 int value = packed.charAt(i++);
59 do result[j++] = value; while (--count > 0);
60 }
61 return j;
62 }
63
64
65
66
67
68 private static final int [] ZZ_CMAP_BLOCKS = zzUnpackcmap_blocks();
69
70 private static final String ZZ_CMAP_BLOCKS_PACKED_0 =
71 "\12\0\1\1\2\2\1\3\22\0\1\4\2\0\1\5"+
72 "\2\0\1\6\6\0\1\7\1\10\1\0\12\11\7\0"+
73 "\7\12\1\13\4\12\1\14\5\12\1\15\7\12\1\0"+
74 "\1\16\1\0\1\6\2\0\7\4\1\17\4\4\1\20"+
75 "\5\4\1\21\7\4\1\0\1\6\1\0\1\6\6\0"+
76 "\1\2\371\0\1\22\u01a8\0\2\2\326\0\u0100\2";
77
78 private static int [] zzUnpackcmap_blocks() {
79 int [] result = new int[1280];
80 int offset = 0;
81 offset = zzUnpackcmap_blocks(ZZ_CMAP_BLOCKS_PACKED_0, offset, result);
82 return result;
83 }
84
85 private static int zzUnpackcmap_blocks(String packed, int offset, int [] result) {
86 int i = 0;
87 int j = offset;
88 int l = packed.length();
89 while (i < l) {
90 int count = packed.charAt(i++);
91 int value = packed.charAt(i++);
92 do result[j++] = value; while (--count > 0);
93 }
94 return j;
95 }
96
97
98
99
100 private static final int [] ZZ_ACTION = zzUnpackAction();
101
102 private static final String ZZ_ACTION_PACKED_0 =
103 "\4\0\1\1\1\2\1\3\3\1\1\4\2\5\1\4"+
104 "\1\3\2\2\3\0\2\6\1\7\2\0\1\10\1\11";
105
106 private static int [] zzUnpackAction() {
107 int [] result = new int[27];
108 int offset = 0;
109 offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
110 return result;
111 }
112
113 private static int zzUnpackAction(String packed, int offset, int [] result) {
114 int i = 0;
115 int j = offset;
116 int l = packed.length();
117 while (i < l) {
118 int count = packed.charAt(i++);
119 int value = packed.charAt(i++);
120 do result[j++] = value; while (--count > 0);
121 }
122 return j;
123 }
124
125
126
127
128
129 private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
130
131 private static final String ZZ_ROWMAP_PACKED_0 =
132 "\0\0\0\23\0\46\0\71\0\114\0\137\0\114\0\162"+
133 "\0\205\0\230\0\114\0\114\0\253\0\276\0\321\0\114"+
134 "\0\344\0\367\0\u010a\0\u011d\0\114\0\u0130\0\114\0\276"+
135 "\0\u0143\0\114\0\114";
136
137 private static int [] zzUnpackRowMap() {
138 int [] result = new int[27];
139 int offset = 0;
140 offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
141 return result;
142 }
143
144 private static int zzUnpackRowMap(String packed, int offset, int [] result) {
145 int i = 0;
146 int j = offset;
147 int l = packed.length() - 1;
148 while (i < l) {
149 int high = packed.charAt(i++) << 16;
150 result[j++] = high | packed.charAt(i++);
151 }
152 return j;
153 }
154
155
156
157
158 private static final int [] ZZ_TRANS = zzUnpacktrans();
159
160 private static final String ZZ_TRANS_PACKED_0 =
161 "\2\5\2\0\1\5\1\6\1\7\3\5\2\10\1\11"+
162 "\1\10\1\7\1\5\1\12\2\5\1\13\1\14\1\0"+
163 "\1\15\2\13\1\7\3\16\4\13\1\17\5\13\1\14"+
164 "\1\0\1\15\2\13\1\7\7\13\1\17\4\13\1\7"+
165 "\1\5\2\0\17\7\23\0\1\6\1\20\1\6\1\21"+
166 "\17\6\11\0\5\22\16\0\4\22\1\23\3\0\2\24"+
167 "\15\0\1\24\3\0\2\24\1\0\1\14\22\0\1\25"+
168 "\1\0\1\26\2\0\1\27\3\30\4\0\1\27\10\0"+
169 "\1\31\3\0\6\31\1\0\3\31\2\0\1\20\32\0"+
170 "\5\32\16\0\5\32\1\0\1\32\16\0\1\32\3\0"+
171 "\1\32\4\0\1\25\25\0\1\31\3\0\6\31\1\33"+
172 "\3\31\1\0";
173
174 private static int [] zzUnpacktrans() {
175 int [] result = new int[342];
176 int offset = 0;
177 offset = zzUnpacktrans(ZZ_TRANS_PACKED_0, offset, result);
178 return result;
179 }
180
181 private static int zzUnpacktrans(String packed, int offset, int [] result) {
182 int i = 0;
183 int j = offset;
184 int l = packed.length();
185 while (i < l) {
186 int count = packed.charAt(i++);
187 int value = packed.charAt(i++);
188 value--;
189 do result[j++] = value; while (--count > 0);
190 }
191 return j;
192 }
193
194
195
196 private static final int ZZ_UNKNOWN_ERROR = 0;
197
198 private static final int ZZ_NO_MATCH = 1;
199
200 private static final int ZZ_PUSHBACK_2BIG = 2;
201
202
203
204
205
206 private static final String ZZ_ERROR_MSG[] = {
207 "Unknown internal scanner error",
208 "Error: could not match input",
209 "Error: pushback value was too large"
210 };
211
212
213
214
215 private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
216
217 private static final String ZZ_ATTRIBUTE_PACKED_0 =
218 "\4\0\1\11\1\1\1\11\3\1\2\11\3\1\1\11"+
219 "\1\1\3\0\1\11\1\1\1\11\2\0\2\11";
220
221 private static int [] zzUnpackAttribute() {
222 int [] result = new int[27];
223 int offset = 0;
224 offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
225 return result;
226 }
227
228 private static int zzUnpackAttribute(String packed, int offset, int [] result) {
229 int i = 0;
230 int j = offset;
231 int l = packed.length();
232 while (i < l) {
233 int count = packed.charAt(i++);
234 int value = packed.charAt(i++);
235 do result[j++] = value; while (--count > 0);
236 }
237 return j;
238 }
239
240
241 private java.io.Reader zzReader;
242
243
244 private int zzState;
245
246
247 private int zzLexicalState = YYINITIAL;
248
249
250
251
252
253 private char zzBuffer[] = new char[Math.min(ZZ_BUFFERSIZE, zzMaxBufferLen())];
254
255
256 private int zzMarkedPos;
257
258
259 private int zzCurrentPos;
260
261
262 private int zzStartRead;
263
264
265 private int zzEndRead;
266
267
268
269
270
271 private boolean zzAtEOF;
272
273
274
275
276
277
278
279 private int zzFinalHighSurrogate = 0;
280
281
282 @SuppressWarnings("unused")
283 private int yyline;
284
285
286 @SuppressWarnings("unused")
287 private int yycolumn;
288
289
290 private long yychar;
291
292
293 @SuppressWarnings("unused")
294 private boolean zzAtBOL = true;
295
296
297 @SuppressWarnings("unused")
298 private boolean zzEOFDone;
299
300
301
302 private boolean myReturnNewlines;
303
304
305
306
307 public Er7Lexer() {
308 super();
309 }
310
311
312
313
314 public Er7Lexer(boolean theReturnNewlines) {
315 super();
316 myReturnNewlines = theReturnNewlines;
317 }
318
319 @Override
320 public int yychar() {
321 return (int)yychar;
322 }
323
324
325
326
327
328
329
330
331
332 public Er7Lexer(java.io.Reader in) {
333 this.zzReader = in;
334 }
335
336
337
338 private int zzMaxBufferLen() {
339 return Integer.MAX_VALUE;
340 }
341
342
343 private boolean zzCanGrow() {
344 return true;
345 }
346
347
348
349
350 private static int zzCMap(int input) {
351 int offset = input & 255;
352 return offset == input ? ZZ_CMAP_BLOCKS[offset] : ZZ_CMAP_BLOCKS[ZZ_CMAP_TOP[input >> 8] | offset];
353 }
354
355
356
357
358
359
360
361 private boolean zzRefill() throws java.io.IOException {
362
363
364 if (zzStartRead > 0) {
365 zzEndRead += zzFinalHighSurrogate;
366 zzFinalHighSurrogate = 0;
367 System.arraycopy(zzBuffer, zzStartRead,
368 zzBuffer, 0,
369 zzEndRead - zzStartRead);
370
371
372 zzEndRead -= zzStartRead;
373 zzCurrentPos -= zzStartRead;
374 zzMarkedPos -= zzStartRead;
375 zzStartRead = 0;
376 }
377
378
379 if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate && zzCanGrow()) {
380
381 char newBuffer[] = new char[Math.min(zzBuffer.length * 2, zzMaxBufferLen())];
382 System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
383 zzBuffer = newBuffer;
384 zzEndRead += zzFinalHighSurrogate;
385 zzFinalHighSurrogate = 0;
386 }
387
388
389 int requested = zzBuffer.length - zzEndRead;
390 int numRead = zzReader.read(zzBuffer, zzEndRead, requested);
391
392
393 if (numRead == 0) {
394 if (requested == 0) {
395 throw new java.io.EOFException("Scan buffer limit reached ["+zzBuffer.length+"]");
396 }
397 else {
398 throw new java.io.IOException(
399 "Reader returned 0 characters. See JFlex examples/zero-reader for a workaround.");
400 }
401 }
402 if (numRead > 0) {
403 zzEndRead += numRead;
404 if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) {
405 if (numRead == requested) {
406 --zzEndRead;
407 zzFinalHighSurrogate = 1;
408 } else {
409 int c = zzReader.read();
410 if (c == -1) {
411 return true;
412 } else {
413 zzBuffer[zzEndRead++] = (char)c;
414 }
415 }
416 }
417
418 return false;
419 }
420
421
422 return true;
423 }
424
425
426
427
428
429
430
431 public final void yyclose() throws java.io.IOException {
432 zzAtEOF = true;
433 zzEndRead = zzStartRead;
434
435 if (zzReader != null) {
436 zzReader.close();
437 }
438 }
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453 public final void yyreset(java.io.Reader reader) {
454 zzReader = reader;
455 zzEOFDone = false;
456 yyResetPosition();
457 zzLexicalState = YYINITIAL;
458 int initBufferSize = Math.min(ZZ_BUFFERSIZE, zzMaxBufferLen());
459 if (zzBuffer.length > initBufferSize) {
460 zzBuffer = new char[initBufferSize];
461 }
462 }
463
464
465
466
467 private final void yyResetPosition() {
468 zzAtBOL = true;
469 zzAtEOF = false;
470 zzCurrentPos = 0;
471 zzMarkedPos = 0;
472 zzStartRead = 0;
473 zzEndRead = 0;
474 zzFinalHighSurrogate = 0;
475 yyline = 0;
476 yycolumn = 0;
477 yychar = 0L;
478 }
479
480
481
482
483
484
485
486 public final boolean yyatEOF() {
487 return zzAtEOF;
488 }
489
490
491
492
493
494
495
496 public final int yystate() {
497 return zzLexicalState;
498 }
499
500
501
502
503
504
505
506 public final void yybegin(int newState) {
507 zzLexicalState = newState;
508 }
509
510
511
512
513
514
515
516 public final String yytext() {
517 return new String(zzBuffer, zzStartRead, zzMarkedPos-zzStartRead);
518 }
519
520
521
522
523
524
525
526
527
528
529
530 public final char yycharat(int position) {
531 return zzBuffer[zzStartRead + position];
532 }
533
534
535
536
537
538
539
540 public final int yylength() {
541 return zzMarkedPos-zzStartRead;
542 }
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559 private static void zzScanError(int errorCode) {
560 String message;
561 try {
562 message = ZZ_ERROR_MSG[errorCode];
563 } catch (ArrayIndexOutOfBoundsException e) {
564 message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
565 }
566
567 throw new Error(message);
568 }
569
570
571
572
573
574
575
576
577
578
579 public void yypushback(int number) {
580 if ( number > yylength() )
581 zzScanError(ZZ_PUSHBACK_2BIG);
582
583 zzMarkedPos -= number;
584 }
585
586
587
588
589
590
591
592
593
594
595
596 public Token yylex() throws java.io.IOException
597 {
598 int zzInput;
599 int zzAction;
600
601
602 int zzCurrentPosL;
603 int zzMarkedPosL;
604 int zzEndReadL = zzEndRead;
605 char[] zzBufferL = zzBuffer;
606
607 int [] zzTransL = ZZ_TRANS;
608 int [] zzRowMapL = ZZ_ROWMAP;
609 int [] zzAttrL = ZZ_ATTRIBUTE;
610
611 while (true) {
612 zzMarkedPosL = zzMarkedPos;
613
614 yychar+= zzMarkedPosL-zzStartRead;
615
616 zzAction = -1;
617
618 zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
619
620 zzState = ZZ_LEXSTATE[zzLexicalState];
621
622
623 int zzAttributes = zzAttrL[zzState];
624 if ( (zzAttributes & 1) == 1 ) {
625 zzAction = zzState;
626 }
627
628
629 zzForAction: {
630 while (true) {
631
632 if (zzCurrentPosL < zzEndReadL) {
633 zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
634 zzCurrentPosL += Character.charCount(zzInput);
635 }
636 else if (zzAtEOF) {
637 zzInput = YYEOF;
638 break zzForAction;
639 }
640 else {
641
642 zzCurrentPos = zzCurrentPosL;
643 zzMarkedPos = zzMarkedPosL;
644 boolean eof = zzRefill();
645
646 zzCurrentPosL = zzCurrentPos;
647 zzMarkedPosL = zzMarkedPos;
648 zzBufferL = zzBuffer;
649 zzEndReadL = zzEndRead;
650 if (eof) {
651 zzInput = YYEOF;
652 break zzForAction;
653 }
654 else {
655 zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
656 zzCurrentPosL += Character.charCount(zzInput);
657 }
658 }
659 int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMap(zzInput) ];
660 if (zzNext == -1) break zzForAction;
661 zzState = zzNext;
662
663 zzAttributes = zzAttrL[zzState];
664 if ( (zzAttributes & 1) == 1 ) {
665 zzAction = zzState;
666 zzMarkedPosL = zzCurrentPosL;
667 if ( (zzAttributes & 8) == 8 ) break zzForAction;
668 }
669
670 }
671 }
672
673
674 zzMarkedPos = zzMarkedPosL;
675
676 if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
677 zzAtEOF = true;
678 {
679 return null;
680 }
681 }
682 else {
683 switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
684 case 1:
685 { return token(TokenType.OPERATOR);
686 }
687
688 case 10: break;
689 case 2:
690 { return token(TokenType.COMMENT);
691 }
692
693 case 11: break;
694 case 3:
695 { yybegin(AT_START_OF_VALUE); return token(TokenType.TYPE);
696 }
697
698 case 12: break;
699 case 4:
700 { yybegin(WITHIN_VALUE); return token(TokenType.DEFAULT);
701 }
702
703 case 13: break;
704 case 5:
705 { yybegin(YYINITIAL); return token(TokenType.DEFAULT);
706 }
707
708 case 14: break;
709 case 6:
710 { yybegin(YYINITIAL); return token(TokenType.TYPE2);
711 }
712
713 case 15: break;
714 case 7:
715 { yypushback(1); yybegin(AT_DELIM); return token(TokenType.TYPE2);
716 }
717
718 case 16: break;
719 case 8:
720 { return token(TokenType.KEYWORD);
721 }
722
723 case 17: break;
724 case 9:
725 { return token(TokenType.TYPE3);
726 }
727
728 case 18: break;
729 default:
730 zzScanError(ZZ_NO_MATCH);
731 }
732 }
733 }
734 }
735
736
737 }