00001 package edu.ksu.cis.bandera.birp.lexer;
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 import java.io.*;
00037 import ca.mcgill.sable.util.*;
00038 import edu.ksu.cis.bandera.birp.node.*;
00039
00040 public class Lexer
00041 {
00042 protected Token token;
00043 protected State state = State.INITIAL;
00044
00045 private PushbackReader in;
00046 private int line;
00047 private int pos;
00048 private boolean cr;
00049 private boolean eof;
00050 private final StringBuffer text = new StringBuffer();
00051
00052 private static int[][][] gotoTable;
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309 private static int[][] accept;
00310
00311
00312
00313
00314
00315 public static class State
00316 {
00317 public final static State INITIAL = new State(0);
00318
00319 private int id;
00320
00321 private State(int id)
00322 {
00323 this.id = id;
00324 }
00325
00326 public int id()
00327 {
00328 return id;
00329 }
00330 }
00331 public Lexer(PushbackReader in)
00332 {
00333 this.in = in;
00334
00335 if(gotoTable == null)
00336 {
00337 try
00338 {
00339 DataInputStream s = new DataInputStream(
00340 new BufferedInputStream(
00341 Lexer.class.getResourceAsStream("lexer.dat")));
00342
00343
00344 int length = s.readInt();
00345 gotoTable = new int[length][][];
00346 for(int i = 0; i < gotoTable.length; i++)
00347 {
00348 length = s.readInt();
00349 gotoTable[i] = new int[length][3];
00350 for(int j = 0; j < gotoTable[i].length; j++)
00351 {
00352 for(int k = 0; k < 3; k++)
00353 {
00354 gotoTable[i][j][k] = s.readInt();
00355 }
00356 }
00357 }
00358
00359
00360 length = s.readInt();
00361 accept = new int[length][];
00362 for(int i = 0; i < accept.length; i++)
00363 {
00364 length = s.readInt();
00365 accept[i] = new int[length];
00366 for(int j = 0; j < accept[i].length; j++)
00367 {
00368 accept[i][j] = s.readInt();
00369 }
00370 }
00371
00372 s.close();
00373 }
00374 catch(Exception e)
00375 {
00376 throw new RuntimeException("Unable to read lexer.dat.");
00377 }
00378 }
00379 }
00380 protected void filter() throws LexerException, IOException
00381 {
00382 }
00383 private int getChar() throws IOException
00384 {
00385 if(eof)
00386 {
00387 return -1;
00388 }
00389
00390 int result = in.read();
00391
00392 if(result == -1)
00393 {
00394 eof = true;
00395 }
00396
00397 return result;
00398 }
00399 private String getText(int acceptLength)
00400 {
00401 StringBuffer s = new StringBuffer(acceptLength);
00402 for(int i = 0; i < acceptLength; i++)
00403 {
00404 s.append(text.charAt(i));
00405 }
00406
00407 return s.toString();
00408 }
00409 protected Token getToken() throws IOException, LexerException
00410 {
00411 int dfa_state = 0;
00412
00413 int start_pos = pos;
00414 int start_line = line;
00415
00416 int accept_state = -1;
00417 int accept_token = -1;
00418 int accept_length = -1;
00419 int accept_pos = -1;
00420 int accept_line = -1;
00421
00422 text.setLength(0);
00423
00424 while(true)
00425 {
00426 int c = getChar();
00427
00428 if(c != -1)
00429 {
00430 switch(c)
00431 {
00432 case 10:
00433 if(cr)
00434 {
00435 cr = false;
00436 }
00437 else
00438 {
00439 line++;
00440 pos = 0;
00441 }
00442 break;
00443 case 13:
00444 line++;
00445 pos = 0;
00446 cr = true;
00447 break;
00448 default:
00449 pos++;
00450 cr = false;
00451 break;
00452 };
00453
00454 text.append((char) c);
00455
00456 do
00457 {
00458 int oldState = (dfa_state < -1) ? (-2 -dfa_state) : dfa_state;
00459
00460 dfa_state = -1;
00461
00462 int low = 0;
00463 int high = gotoTable[oldState].length - 1;
00464
00465 while(low <= high)
00466 {
00467 int middle = (low + high) / 2;
00468
00469 if(c < gotoTable[oldState][middle][0])
00470 {
00471 high = middle - 1;
00472 }
00473 else if(c > gotoTable[oldState][middle][1])
00474 {
00475 low = middle + 1;
00476 }
00477 else
00478 {
00479 dfa_state = gotoTable[oldState][middle][2];
00480 break;
00481 }
00482 }
00483 }while(dfa_state < -1);
00484 }
00485 else
00486 {
00487 dfa_state = -1;
00488 }
00489
00490 if(dfa_state >= 0)
00491 {
00492 if(accept[state.id()][dfa_state] != -1)
00493 {
00494 accept_state = dfa_state;
00495 accept_token = accept[state.id()][dfa_state];
00496 accept_length = text.length();
00497 accept_pos = pos;
00498 accept_line = line;
00499 }
00500 }
00501 else
00502 {
00503 if(accept_state != -1)
00504 {
00505 switch(accept_token)
00506 {
00507 case 0:
00508 {
00509 Token token = new0(
00510 start_line + 1,
00511 start_pos + 1);
00512 pushBack(accept_length);
00513 pos = accept_pos;
00514 line = accept_line;
00515 return token;
00516 }
00517 case 1:
00518 {
00519 Token token = new1(
00520 start_line + 1,
00521 start_pos + 1);
00522 pushBack(accept_length);
00523 pos = accept_pos;
00524 line = accept_line;
00525 return token;
00526 }
00527 case 2:
00528 {
00529 Token token = new2(
00530 start_line + 1,
00531 start_pos + 1);
00532 pushBack(accept_length);
00533 pos = accept_pos;
00534 line = accept_line;
00535 return token;
00536 }
00537 case 3:
00538 {
00539 Token token = new3(
00540 start_line + 1,
00541 start_pos + 1);
00542 pushBack(accept_length);
00543 pos = accept_pos;
00544 line = accept_line;
00545 return token;
00546 }
00547 case 4:
00548 {
00549 Token token = new4(
00550 start_line + 1,
00551 start_pos + 1);
00552 pushBack(accept_length);
00553 pos = accept_pos;
00554 line = accept_line;
00555 return token;
00556 }
00557 case 5:
00558 {
00559 Token token = new5(
00560 start_line + 1,
00561 start_pos + 1);
00562 pushBack(accept_length);
00563 pos = accept_pos;
00564 line = accept_line;
00565 return token;
00566 }
00567 case 6:
00568 {
00569 Token token = new6(
00570 start_line + 1,
00571 start_pos + 1);
00572 pushBack(accept_length);
00573 pos = accept_pos;
00574 line = accept_line;
00575 return token;
00576 }
00577 case 7:
00578 {
00579 Token token = new7(
00580 start_line + 1,
00581 start_pos + 1);
00582 pushBack(accept_length);
00583 pos = accept_pos;
00584 line = accept_line;
00585 return token;
00586 }
00587 case 8:
00588 {
00589 Token token = new8(
00590 start_line + 1,
00591 start_pos + 1);
00592 pushBack(accept_length);
00593 pos = accept_pos;
00594 line = accept_line;
00595 return token;
00596 }
00597 case 9:
00598 {
00599 Token token = new9(
00600 start_line + 1,
00601 start_pos + 1);
00602 pushBack(accept_length);
00603 pos = accept_pos;
00604 line = accept_line;
00605 return token;
00606 }
00607 case 10:
00608 {
00609 Token token = new10(
00610 start_line + 1,
00611 start_pos + 1);
00612 pushBack(accept_length);
00613 pos = accept_pos;
00614 line = accept_line;
00615 return token;
00616 }
00617 case 11:
00618 {
00619 Token token = new11(
00620 start_line + 1,
00621 start_pos + 1);
00622 pushBack(accept_length);
00623 pos = accept_pos;
00624 line = accept_line;
00625 return token;
00626 }
00627 case 12:
00628 {
00629 Token token = new12(
00630 start_line + 1,
00631 start_pos + 1);
00632 pushBack(accept_length);
00633 pos = accept_pos;
00634 line = accept_line;
00635 return token;
00636 }
00637 case 13:
00638 {
00639 Token token = new13(
00640 start_line + 1,
00641 start_pos + 1);
00642 pushBack(accept_length);
00643 pos = accept_pos;
00644 line = accept_line;
00645 return token;
00646 }
00647 case 14:
00648 {
00649 Token token = new14(
00650 start_line + 1,
00651 start_pos + 1);
00652 pushBack(accept_length);
00653 pos = accept_pos;
00654 line = accept_line;
00655 return token;
00656 }
00657 case 15:
00658 {
00659 Token token = new15(
00660 start_line + 1,
00661 start_pos + 1);
00662 pushBack(accept_length);
00663 pos = accept_pos;
00664 line = accept_line;
00665 return token;
00666 }
00667 case 16:
00668 {
00669 Token token = new16(
00670 start_line + 1,
00671 start_pos + 1);
00672 pushBack(accept_length);
00673 pos = accept_pos;
00674 line = accept_line;
00675 return token;
00676 }
00677 case 17:
00678 {
00679 Token token = new17(
00680 start_line + 1,
00681 start_pos + 1);
00682 pushBack(accept_length);
00683 pos = accept_pos;
00684 line = accept_line;
00685 return token;
00686 }
00687 case 18:
00688 {
00689 Token token = new18(
00690 start_line + 1,
00691 start_pos + 1);
00692 pushBack(accept_length);
00693 pos = accept_pos;
00694 line = accept_line;
00695 return token;
00696 }
00697 case 19:
00698 {
00699 Token token = new19(
00700 start_line + 1,
00701 start_pos + 1);
00702 pushBack(accept_length);
00703 pos = accept_pos;
00704 line = accept_line;
00705 return token;
00706 }
00707 case 20:
00708 {
00709 Token token = new20(
00710 start_line + 1,
00711 start_pos + 1);
00712 pushBack(accept_length);
00713 pos = accept_pos;
00714 line = accept_line;
00715 return token;
00716 }
00717 case 21:
00718 {
00719 Token token = new21(
00720 start_line + 1,
00721 start_pos + 1);
00722 pushBack(accept_length);
00723 pos = accept_pos;
00724 line = accept_line;
00725 return token;
00726 }
00727 case 22:
00728 {
00729 Token token = new22(
00730 start_line + 1,
00731 start_pos + 1);
00732 pushBack(accept_length);
00733 pos = accept_pos;
00734 line = accept_line;
00735 return token;
00736 }
00737 case 23:
00738 {
00739 Token token = new23(
00740 start_line + 1,
00741 start_pos + 1);
00742 pushBack(accept_length);
00743 pos = accept_pos;
00744 line = accept_line;
00745 return token;
00746 }
00747 case 24:
00748 {
00749 Token token = new24(
00750 start_line + 1,
00751 start_pos + 1);
00752 pushBack(accept_length);
00753 pos = accept_pos;
00754 line = accept_line;
00755 return token;
00756 }
00757 case 25:
00758 {
00759 Token token = new25(
00760 start_line + 1,
00761 start_pos + 1);
00762 pushBack(accept_length);
00763 pos = accept_pos;
00764 line = accept_line;
00765 return token;
00766 }
00767 case 26:
00768 {
00769 Token token = new26(
00770 start_line + 1,
00771 start_pos + 1);
00772 pushBack(accept_length);
00773 pos = accept_pos;
00774 line = accept_line;
00775 return token;
00776 }
00777 case 27:
00778 {
00779 Token token = new27(
00780 start_line + 1,
00781 start_pos + 1);
00782 pushBack(accept_length);
00783 pos = accept_pos;
00784 line = accept_line;
00785 return token;
00786 }
00787 case 28:
00788 {
00789 Token token = new28(
00790 start_line + 1,
00791 start_pos + 1);
00792 pushBack(accept_length);
00793 pos = accept_pos;
00794 line = accept_line;
00795 return token;
00796 }
00797 case 29:
00798 {
00799 Token token = new29(
00800 start_line + 1,
00801 start_pos + 1);
00802 pushBack(accept_length);
00803 pos = accept_pos;
00804 line = accept_line;
00805 return token;
00806 }
00807 case 30:
00808 {
00809 Token token = new30(
00810 start_line + 1,
00811 start_pos + 1);
00812 pushBack(accept_length);
00813 pos = accept_pos;
00814 line = accept_line;
00815 return token;
00816 }
00817 case 31:
00818 {
00819 Token token = new31(
00820 start_line + 1,
00821 start_pos + 1);
00822 pushBack(accept_length);
00823 pos = accept_pos;
00824 line = accept_line;
00825 return token;
00826 }
00827 case 32:
00828 {
00829 Token token = new32(
00830 start_line + 1,
00831 start_pos + 1);
00832 pushBack(accept_length);
00833 pos = accept_pos;
00834 line = accept_line;
00835 return token;
00836 }
00837 case 33:
00838 {
00839 Token token = new33(
00840 start_line + 1,
00841 start_pos + 1);
00842 pushBack(accept_length);
00843 pos = accept_pos;
00844 line = accept_line;
00845 return token;
00846 }
00847 case 34:
00848 {
00849 Token token = new34(
00850 start_line + 1,
00851 start_pos + 1);
00852 pushBack(accept_length);
00853 pos = accept_pos;
00854 line = accept_line;
00855 return token;
00856 }
00857 case 35:
00858 {
00859 Token token = new35(
00860 start_line + 1,
00861 start_pos + 1);
00862 pushBack(accept_length);
00863 pos = accept_pos;
00864 line = accept_line;
00865 return token;
00866 }
00867 case 36:
00868 {
00869 Token token = new36(
00870 start_line + 1,
00871 start_pos + 1);
00872 pushBack(accept_length);
00873 pos = accept_pos;
00874 line = accept_line;
00875 return token;
00876 }
00877 case 37:
00878 {
00879 Token token = new37(
00880 start_line + 1,
00881 start_pos + 1);
00882 pushBack(accept_length);
00883 pos = accept_pos;
00884 line = accept_line;
00885 return token;
00886 }
00887 case 38:
00888 {
00889 Token token = new38(
00890 start_line + 1,
00891 start_pos + 1);
00892 pushBack(accept_length);
00893 pos = accept_pos;
00894 line = accept_line;
00895 return token;
00896 }
00897 case 39:
00898 {
00899 Token token = new39(
00900 start_line + 1,
00901 start_pos + 1);
00902 pushBack(accept_length);
00903 pos = accept_pos;
00904 line = accept_line;
00905 return token;
00906 }
00907 case 40:
00908 {
00909 Token token = new40(
00910 start_line + 1,
00911 start_pos + 1);
00912 pushBack(accept_length);
00913 pos = accept_pos;
00914 line = accept_line;
00915 return token;
00916 }
00917 case 41:
00918 {
00919 Token token = new41(
00920 start_line + 1,
00921 start_pos + 1);
00922 pushBack(accept_length);
00923 pos = accept_pos;
00924 line = accept_line;
00925 return token;
00926 }
00927 case 42:
00928 {
00929 Token token = new42(
00930 start_line + 1,
00931 start_pos + 1);
00932 pushBack(accept_length);
00933 pos = accept_pos;
00934 line = accept_line;
00935 return token;
00936 }
00937 case 43:
00938 {
00939 Token token = new43(
00940 start_line + 1,
00941 start_pos + 1);
00942 pushBack(accept_length);
00943 pos = accept_pos;
00944 line = accept_line;
00945 return token;
00946 }
00947 case 44:
00948 {
00949 Token token = new44(
00950 start_line + 1,
00951 start_pos + 1);
00952 pushBack(accept_length);
00953 pos = accept_pos;
00954 line = accept_line;
00955 return token;
00956 }
00957 case 45:
00958 {
00959 Token token = new45(
00960 start_line + 1,
00961 start_pos + 1);
00962 pushBack(accept_length);
00963 pos = accept_pos;
00964 line = accept_line;
00965 return token;
00966 }
00967 case 46:
00968 {
00969 Token token = new46(
00970 start_line + 1,
00971 start_pos + 1);
00972 pushBack(accept_length);
00973 pos = accept_pos;
00974 line = accept_line;
00975 return token;
00976 }
00977 case 47:
00978 {
00979 Token token = new47(
00980 start_line + 1,
00981 start_pos + 1);
00982 pushBack(accept_length);
00983 pos = accept_pos;
00984 line = accept_line;
00985 return token;
00986 }
00987 case 48:
00988 {
00989 Token token = new48(
00990 start_line + 1,
00991 start_pos + 1);
00992 pushBack(accept_length);
00993 pos = accept_pos;
00994 line = accept_line;
00995 return token;
00996 }
00997 case 49:
00998 {
00999 Token token = new49(
01000 start_line + 1,
01001 start_pos + 1);
01002 pushBack(accept_length);
01003 pos = accept_pos;
01004 line = accept_line;
01005 return token;
01006 }
01007 case 50:
01008 {
01009 Token token = new50(
01010 start_line + 1,
01011 start_pos + 1);
01012 pushBack(accept_length);
01013 pos = accept_pos;
01014 line = accept_line;
01015 return token;
01016 }
01017 case 51:
01018 {
01019 Token token = new51(
01020 start_line + 1,
01021 start_pos + 1);
01022 pushBack(accept_length);
01023 pos = accept_pos;
01024 line = accept_line;
01025 return token;
01026 }
01027 case 52:
01028 {
01029 Token token = new52(
01030 start_line + 1,
01031 start_pos + 1);
01032 pushBack(accept_length);
01033 pos = accept_pos;
01034 line = accept_line;
01035 return token;
01036 }
01037 case 53:
01038 {
01039 Token token = new53(
01040 start_line + 1,
01041 start_pos + 1);
01042 pushBack(accept_length);
01043 pos = accept_pos;
01044 line = accept_line;
01045 return token;
01046 }
01047 case 54:
01048 {
01049 Token token = new54(
01050 start_line + 1,
01051 start_pos + 1);
01052 pushBack(accept_length);
01053 pos = accept_pos;
01054 line = accept_line;
01055 return token;
01056 }
01057 case 55:
01058 {
01059 Token token = new55(
01060 start_line + 1,
01061 start_pos + 1);
01062 pushBack(accept_length);
01063 pos = accept_pos;
01064 line = accept_line;
01065 return token;
01066 }
01067 case 56:
01068 {
01069 Token token = new56(
01070 start_line + 1,
01071 start_pos + 1);
01072 pushBack(accept_length);
01073 pos = accept_pos;
01074 line = accept_line;
01075 return token;
01076 }
01077 case 57:
01078 {
01079 Token token = new57(
01080 start_line + 1,
01081 start_pos + 1);
01082 pushBack(accept_length);
01083 pos = accept_pos;
01084 line = accept_line;
01085 return token;
01086 }
01087 case 58:
01088 {
01089 Token token = new58(
01090 start_line + 1,
01091 start_pos + 1);
01092 pushBack(accept_length);
01093 pos = accept_pos;
01094 line = accept_line;
01095 return token;
01096 }
01097 case 59:
01098 {
01099 Token token = new59(
01100 start_line + 1,
01101 start_pos + 1);
01102 pushBack(accept_length);
01103 pos = accept_pos;
01104 line = accept_line;
01105 return token;
01106 }
01107 case 60:
01108 {
01109 Token token = new60(
01110 start_line + 1,
01111 start_pos + 1);
01112 pushBack(accept_length);
01113 pos = accept_pos;
01114 line = accept_line;
01115 return token;
01116 }
01117 case 61:
01118 {
01119 Token token = new61(
01120 start_line + 1,
01121 start_pos + 1);
01122 pushBack(accept_length);
01123 pos = accept_pos;
01124 line = accept_line;
01125 return token;
01126 }
01127 case 62:
01128 {
01129 Token token = new62(
01130 start_line + 1,
01131 start_pos + 1);
01132 pushBack(accept_length);
01133 pos = accept_pos;
01134 line = accept_line;
01135 return token;
01136 }
01137 case 63:
01138 {
01139 Token token = new63(
01140 start_line + 1,
01141 start_pos + 1);
01142 pushBack(accept_length);
01143 pos = accept_pos;
01144 line = accept_line;
01145 return token;
01146 }
01147 case 64:
01148 {
01149 Token token = new64(
01150 start_line + 1,
01151 start_pos + 1);
01152 pushBack(accept_length);
01153 pos = accept_pos;
01154 line = accept_line;
01155 return token;
01156 }
01157 case 65:
01158 {
01159 Token token = new65(
01160 start_line + 1,
01161 start_pos + 1);
01162 pushBack(accept_length);
01163 pos = accept_pos;
01164 line = accept_line;
01165 return token;
01166 }
01167 case 66:
01168 {
01169 Token token = new66(
01170 start_line + 1,
01171 start_pos + 1);
01172 pushBack(accept_length);
01173 pos = accept_pos;
01174 line = accept_line;
01175 return token;
01176 }
01177 case 67:
01178 {
01179 Token token = new67(
01180 start_line + 1,
01181 start_pos + 1);
01182 pushBack(accept_length);
01183 pos = accept_pos;
01184 line = accept_line;
01185 return token;
01186 }
01187 case 68:
01188 {
01189 Token token = new68(
01190 start_line + 1,
01191 start_pos + 1);
01192 pushBack(accept_length);
01193 pos = accept_pos;
01194 line = accept_line;
01195 return token;
01196 }
01197 case 69:
01198 {
01199 Token token = new69(
01200 start_line + 1,
01201 start_pos + 1);
01202 pushBack(accept_length);
01203 pos = accept_pos;
01204 line = accept_line;
01205 return token;
01206 }
01207 case 70:
01208 {
01209 Token token = new70(
01210 start_line + 1,
01211 start_pos + 1);
01212 pushBack(accept_length);
01213 pos = accept_pos;
01214 line = accept_line;
01215 return token;
01216 }
01217 case 71:
01218 {
01219 Token token = new71(
01220 getText(accept_length),
01221 start_line + 1,
01222 start_pos + 1);
01223 pushBack(accept_length);
01224 pos = accept_pos;
01225 line = accept_line;
01226 return token;
01227 }
01228 case 72:
01229 {
01230 Token token = new72(
01231 getText(accept_length),
01232 start_line + 1,
01233 start_pos + 1);
01234 pushBack(accept_length);
01235 pos = accept_pos;
01236 line = accept_line;
01237 return token;
01238 }
01239 case 73:
01240 {
01241 Token token = new73(
01242 getText(accept_length),
01243 start_line + 1,
01244 start_pos + 1);
01245 pushBack(accept_length);
01246 pos = accept_pos;
01247 line = accept_line;
01248 return token;
01249 }
01250 case 74:
01251 {
01252 Token token = new74(
01253 getText(accept_length),
01254 start_line + 1,
01255 start_pos + 1);
01256 pushBack(accept_length);
01257 pos = accept_pos;
01258 line = accept_line;
01259 return token;
01260 }
01261 case 75:
01262 {
01263 Token token = new75(
01264 getText(accept_length),
01265 start_line + 1,
01266 start_pos + 1);
01267 pushBack(accept_length);
01268 pos = accept_pos;
01269 line = accept_line;
01270 return token;
01271 }
01272 }
01273 }
01274 else
01275 {
01276 if(text.length() > 0)
01277 {
01278 throw new LexerException(
01279 "[" + (start_line + 1) + "," + (start_pos + 1) + "]" +
01280 " Unknown token: " + text);
01281 }
01282 else
01283 {
01284 EOF token = new EOF(
01285 start_line + 1,
01286 start_pos + 1);
01287 return token;
01288 }
01289 }
01290 }
01291 }
01292 }
01293 Token new0(int line, int pos) { return new TSemicolon(line, pos); }
01294 Token new1(int line, int pos) { return new TColon(line, pos); }
01295 Token new10(int line, int pos) { return new TComma(line, pos); }
01296 Token new11(int line, int pos) { return new TDot(line, pos); }
01297 Token new12(int line, int pos) { return new TDotdot(line, pos); }
01298 Token new13(int line, int pos) { return new TPlus(line, pos); }
01299 Token new14(int line, int pos) { return new TMinus(line, pos); }
01300 Token new15(int line, int pos) { return new TMult(line, pos); }
01301 Token new16(int line, int pos) { return new TDiv(line, pos); }
01302 Token new17(int line, int pos) { return new TMod(line, pos); }
01303 Token new18(int line, int pos) { return new TAnd(line, pos); }
01304 Token new19(int line, int pos) { return new TOr(line, pos); }
01305 Token new2(int line, int pos) { return new TLbrace(line, pos); }
01306 Token new20(int line, int pos) { return new TEq(line, pos); }
01307 Token new21(int line, int pos) { return new TEquals(line, pos); }
01308 Token new22(int line, int pos) { return new TNot(line, pos); }
01309 Token new23(int line, int pos) { return new TNoteq(line, pos); }
01310 Token new24(int line, int pos) { return new TLt(line, pos); }
01311 Token new25(int line, int pos) { return new TGt(line, pos); }
01312 Token new26(int line, int pos) { return new TLe(line, pos); }
01313 Token new27(int line, int pos) { return new TGe(line, pos); }
01314 Token new28(int line, int pos) { return new TAssign(line, pos); }
01315 Token new29(int line, int pos) { return new TAssert(line, pos); }
01316 Token new3(int line, int pos) { return new TRbrace(line, pos); }
01317 Token new30(int line, int pos) { return new TBoolean(line, pos); }
01318 Token new31(int line, int pos) { return new TTrue(line, pos); }
01319 Token new32(int line, int pos) { return new TFalse(line, pos); }
01320 Token new33(int line, int pos) { return new TProcess(line, pos); }
01321 Token new34(int line, int pos) { return new TEnd(line, pos); }
01322 Token new35(int line, int pos) { return new TRange(line, pos); }
01323 Token new36(int line, int pos) { return new TLock(line, pos); }
01324 Token new37(int line, int pos) { return new TReentrant(line, pos); }
01325 Token new38(int line, int pos) { return new TArray(line, pos); }
01326 Token new39(int line, int pos) { return new TOf(line, pos); }
01327 Token new4(int line, int pos) { return new TLparen(line, pos); }
01328 Token new40(int line, int pos) { return new TLength(line, pos); }
01329 Token new41(int line, int pos) { return new TInstanceof(line, pos); }
01330 Token new42(int line, int pos) { return new TRecord(line, pos); }
01331 Token new43(int line, int pos) { return new TCollection(line, pos); }
01332 Token new44(int line, int pos) { return new TRef(line, pos); }
01333 Token new45(int line, int pos) { return new TNew(line, pos); }
01334 Token new46(int line, int pos) { return new TNull(line, pos); }
01335 Token new47(int line, int pos) { return new TEnum(line, pos); }
01336 Token new48(int line, int pos) { return new TMain(line, pos); }
01337 Token new49(int line, int pos) { return new TThread(line, pos); }
01338 Token new5(int line, int pos) { return new TRparen(line, pos); }
01339 Token new50(int line, int pos) { return new TLoc(line, pos); }
01340 Token new51(int line, int pos) { return new TLive(line, pos); }
01341 Token new52(int line, int pos) { return new TWhen(line, pos); }
01342 Token new53(int line, int pos) { return new TDo(line, pos); }
01343 Token new54(int line, int pos) { return new TInvisible(line, pos); }
01344 Token new55(int line, int pos) { return new TGoto(line, pos); }
01345 Token new56(int line, int pos) { return new TUnlock(line, pos); }
01346 Token new57(int line, int pos) { return new TWait(line, pos); }
01347 Token new58(int line, int pos) { return new TUnwait(line, pos); }
01348 Token new59(int line, int pos) { return new TNotify(line, pos); }
01349 Token new6(int line, int pos) { return new TLbrack(line, pos); }
01350 Token new60(int line, int pos) { return new TNotifyall(line, pos); }
01351 Token new61(int line, int pos) { return new TLockavailable(line, pos); }
01352 Token new62(int line, int pos) { return new TStart(line, pos); }
01353 Token new63(int line, int pos) { return new TJoin(line, pos); }
01354 Token new64(int line, int pos) { return new TExit(line, pos); }
01355 Token new65(int line, int pos) { return new TChoose(line, pos); }
01356 Token new66(int line, int pos) { return new TThreadterminated(line, pos); }
01357 Token new67(int line, int pos) { return new THaslock(line, pos); }
01358 Token new68(int line, int pos) { return new TWasnotified(line, pos); }
01359 Token new69(int line, int pos) { return new TPrintln(line, pos); }
01360 Token new7(int line, int pos) { return new TRbrack(line, pos); }
01361 Token new70(int line, int pos) { return new TPredicates(line, pos); }
01362 Token new71(String text, int line, int pos) { return new TId(text, line, pos); }
01363 Token new72(String text, int line, int pos) { return new TInt(text, line, pos); }
01364 Token new73(String text, int line, int pos) { return new TString(text, line, pos); }
01365 Token new74(String text, int line, int pos) { return new TWhitespace(text, line, pos); }
01366 Token new75(String text, int line, int pos) { return new TComment(text, line, pos); }
01367 Token new8(int line, int pos) { return new TBar(line, pos); }
01368 Token new9(int line, int pos) { return new TAt(line, pos); }
01369 public Token next() throws LexerException, IOException
01370 {
01371 while(token == null)
01372 {
01373 token = getToken();
01374 filter();
01375 }
01376
01377 Token result = token;
01378 token = null;
01379 return result;
01380 }
01381 public Token peek() throws LexerException, IOException
01382 {
01383 while(token == null)
01384 {
01385 token = getToken();
01386 filter();
01387 }
01388
01389 return token;
01390 }
01391 private void pushBack(int acceptLength) throws IOException
01392 {
01393 int length = text.length();
01394 for(int i = length - 1; i >= acceptLength; i--)
01395 {
01396 eof = false;
01397
01398 in.unread(text.charAt(i));
01399 }
01400 }
01401 protected void unread(Token token) throws IOException
01402 {
01403 String text = token.getText();
01404 int length = text.length();
01405
01406 for(int i = length - 1; i >= 0; i--)
01407 {
01408 eof = false;
01409
01410 in.unread(text.charAt(i));
01411 }
01412
01413 pos = token.getPos() - 1;
01414 line = token.getLine() - 1;
01415 }
01416 }