/* The following code was generated by JFlex 1.4.1 on 5/3/06 3:19 PM */
package grammar;
import java.util.*;
/**
* This class is a scanner generated by
* JFlex 1.4.1
* on 5/3/06 3:19 PM from the specification file
* Source/grammar/Yylex.jflex
*/
public class Yylex {
/** This character denotes the end of file */
public static final int YYEOF = -1;
/** initial size of the lookahead buffer */
private static final int ZZ_BUFFERSIZE = 16384;
/** lexical states */
public static final int YYINITIAL = 0;
public static final int COMMENT = 2;
public static final int NORMAL = 1;
/**
* Translates characters to character classes
*/
private static final char [] ZZ_CMAP = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 52, 15, 0, 13, 52, 56, 14, 42, 43, 50, 49, 0, 10, 11, 51,
3, 20, 20, 20, 5, 5, 5, 5, 4, 4, 0, 0, 53, 48, 54, 0,
0, 7, 7, 7, 12, 9, 12, 13, 13, 13, 13, 13, 8, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13, 6, 13, 13, 46, 16, 47, 52, 13,
0, 21, 17, 25, 34, 28, 18, 38, 31, 32, 13, 29, 27, 36, 19, 26,
37, 13, 24, 22, 23, 33, 39, 40, 35, 30, 41, 44, 55, 45, 0, 0
};
/**
* Translates DFA states to action switch labels.
*/
private static final int [] ZZ_ACTION = zzUnpackAction();
private static final String ZZ_ACTION_PACKED_0 =
"\3\0\1\1\2\2\2\1\1\3\4\1\17\3\1\4"+
"\1\5\1\6\1\7\1\10\1\11\13\1\3\0\1\1"+
"\4\0\32\3\1\1\2\3\1\1\6\3\1\12\1\13"+
"\2\1\1\14\1\15\2\1\3\0\27\3\1\1\41\3"+
"\1\1\4\3\1\1\35\3";
private static int [] zzUnpackAction() {
int [] result = new int[192];
int offset = 0;
offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
return result;
}
private static int zzUnpackAction(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
do result[j++] = value; while (--count > 0);
}
return j;
}
/**
* Translates a state to a row index in the transition table
*/
private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
private static final String ZZ_ROWMAP_PACKED_0 =
"\0\0\0\71\0\162\0\0\0\253\0\0\0\344\0\u011d"+
"\0\u0156\0\u018f\0\u01c8\0\u0201\0\u023a\0\u0273\0\u02ac\0\u02e5"+
"\0\u031e\0\u0357\0\u0390\0\u03c9\0\u0402\0\u043b\0\u0474\0\u04ad"+
"\0\u04e6\0\u051f\0\u0558\0\u0591\0\0\0\0\0\0\0\0"+
"\0\0\0\0\0\u05ca\0\u0603\0\u063c\0\u0675\0\u06ae\0\u06e7"+
"\0\u0720\0\u0759\0\u0792\0\u07cb\0\u0804\0\u083d\0\u0876\0\u08af"+
"\0\u08e8\0\u0921\0\u095a\0\u023a\0\u0993\0\u09cc\0\u0a05\0\u0a3e"+
"\0\u0a77\0\u0ab0\0\u0ae9\0\u0b22\0\u0b5b\0\u0b94\0\u0bcd\0\u0c06"+
"\0\u0c3f\0\u0c78\0\u0cb1\0\u0cea\0\u0d23\0\u0d5c\0\u0d95\0\u0dce"+
"\0\u0e07\0\u0e40\0\u0e79\0\u0eb2\0\u0eeb\0\u0f24\0\u0f5d\0\u0156"+
"\0\u0f96\0\u0fcf\0\u1008\0\u1041\0\u107a\0\u10b3\0\u10ec\0\u1125"+
"\0\u115e\0\0\0\0\0\u1197\0\u11d0\0\0\0\0\0\u1209"+
"\0\u1242\0\u127b\0\u12b4\0\u12ed\0\u1326\0\u135f\0\u1398\0\u13d1"+
"\0\u140a\0\u1443\0\u147c\0\u14b5\0\u14ee\0\u1527\0\u1560\0\u1599"+
"\0\u15d2\0\u160b\0\u1644\0\u167d\0\u16b6\0\u16ef\0\u1728\0\u1761"+
"\0\u179a\0\u17d3\0\u180c\0\u1845\0\u187e\0\u18b7\0\u18f0\0\u1929"+
"\0\u1962\0\u199b\0\u19d4\0\u1a0d\0\u1a46\0\u1a7f\0\u1ab8\0\u1af1"+
"\0\u1b2a\0\u1b63\0\u1b9c\0\u1bd5\0\u1c0e\0\u1c47\0\u1c80\0\u1cb9"+
"\0\u1cf2\0\u1d2b\0\u1d64\0\u1d9d\0\u1dd6\0\u1e0f\0\u1e48\0\u1e81"+
"\0\u1eba\0\u1ef3\0\u1f2c\0\u1f65\0\u1f9e\0\u1fd7\0\u2010\0\u2049"+
"\0\u2082\0\u20bb\0\u167d\0\u20f4\0\u212d\0\u2166\0\u219f\0\u21d8"+
"\0\u2211\0\u224a\0\u2283\0\u22bc\0\u22f5\0\u232e\0\u2367\0\u23a0"+
"\0\u23d9\0\u2412\0\u244b\0\u2484\0\u24bd\0\u24f6\0\u252f\0\u2568"+
"\0\u25a1\0\u25da\0\u2613\0\u264c\0\u2685\0\u26be\0\u26f7\0\u2730";
private static int [] zzUnpackRowMap() {
int [] result = new int[192];
int offset = 0;
offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
return result;
}
private static int zzUnpackRowMap(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int high = packed.charAt(i++) << 16;
result[j++] = high | packed.charAt(i++);
}
return j;
}
/**
* The transition table of the DFA
*/
private static final int [] ZZ_TRANS = zzUnpackTrans();
private static final String ZZ_TRANS_PACKED_0 =
"\71\0\1\4\1\5\1\6\1\7\2\10\4\11\1\12"+
"\1\13\2\11\1\14\1\15\1\4\1\16\1\17\1\20"+
"\1\10\1\21\1\22\1\23\1\24\1\25\1\11\1\26"+
"\1\27\3\11\1\30\1\11\1\31\2\11\1\32\1\11"+
"\1\33\1\34\1\11\1\35\1\36\1\37\1\40\1\41"+
"\1\42\1\43\1\44\1\45\1\46\1\43\1\47\1\50"+
"\1\51\1\52\1\4\1\5\1\6\57\4\1\53\1\54"+
"\5\4\2\0\1\6\71\0\1\55\1\56\1\55\1\57"+
"\1\0\1\4\1\60\1\0\1\61\1\4\5\0\1\4"+
"\1\0\1\55\6\0\1\4\1\60\5\0\1\4\1\57"+
"\30\0\3\10\2\0\1\4\1\60\1\0\1\61\1\4"+
"\5\0\1\4\1\0\1\10\6\0\1\4\1\60\5\0"+
"\1\4\31\0\7\11\2\0\2\11\3\0\31\11\31\0"+
"\1\4\45\0\1\4\13\0\3\61\16\0\1\61\44\0"+
"\1\62\2\0\13\62\1\0\1\62\1\63\50\62\1\64"+
"\2\0\14\64\1\4\1\65\50\64\3\0\7\11\2\0"+
"\2\11\3\0\7\11\1\66\1\11\1\67\3\11\1\70"+
"\13\11\22\0\7\11\2\0\2\11\3\0\4\11\1\71"+
"\4\11\1\72\1\73\4\11\1\74\11\11\22\0\7\11"+
"\2\0\2\11\3\0\4\11\1\75\6\11\1\76\4\11"+
"\1\77\10\11\22\0\7\11\2\0\2\11\3\0\1\100"+
"\30\11\22\0\7\11\2\0\2\11\3\0\6\11\1\101"+
"\6\11\1\102\1\103\1\11\1\104\6\11\1\105\1\11"+
"\22\0\7\11\2\0\2\11\3\0\7\11\1\106\6\11"+
"\1\107\12\11\22\0\7\11\2\0\2\11\3\0\13\11"+
"\1\110\15\11\22\0\7\11\2\0\2\11\3\0\4\11"+
"\1\111\4\11\1\112\1\113\3\11\1\114\12\11\22\0"+
"\7\11\2\0\2\11\3\0\11\11\1\115\17\11\22\0"+
"\7\11\2\0\2\11\3\0\12\11\1\116\7\11\1\117"+
"\6\11\22\0\7\11\2\0\2\11\3\0\1\11\1\120"+
"\1\121\20\11\1\122\5\11\22\0\7\11\2\0\2\11"+
"\3\0\11\11\1\123\1\11\1\124\15\11\22\0\7\11"+
"\2\0\2\11\3\0\4\11\1\125\2\11\1\126\10\11"+
"\1\127\10\11\22\0\7\11\2\0\2\11\3\0\11\11"+
"\1\130\17\11\22\0\7\11\2\0\2\11\3\0\16\11"+
"\1\131\12\11\77\0\1\4\70\0\2\4\67\0\1\4"+
"\2\0\1\132\65\0\1\4\1\0\1\133\1\134\65\0"+
"\1\4\4\0\1\43\63\0\1\4\5\0\1\135\62\0"+
"\1\4\6\0\1\4\61\0\1\4\7\0\1\4\63\0"+
"\1\136\67\0\1\137\11\0\1\55\1\56\1\55\2\0"+
"\1\4\1\60\1\0\1\61\1\4\5\0\1\4\1\0"+
"\1\55\6\0\1\4\1\60\5\0\1\4\31\0\3\56"+
"\3\0\1\60\1\0\1\61\1\4\5\0\1\4\1\0"+
"\1\56\7\0\1\60\5\0\1\4\31\0\3\140\1\0"+
"\1\140\1\0\1\140\2\0\1\140\4\0\2\140\1\0"+
"\2\140\3\0\1\140\2\0\1\140\5\0\1\140\31\0"+
"\3\141\4\0\1\142\11\0\1\141\34\0\1\142\12\0"+
"\3\61\3\0\1\60\2\0\1\4\5\0\1\4\1\0"+
"\1\61\7\0\1\60\5\0\1\4\44\0\1\4\55\0"+
"\1\143\1\0\1\144\10\0\6\62\1\143\2\0\2\62"+
"\43\0\1\64\1\0\1\64\10\0\7\64\2\0\2\64"+
"\43\0\7\11\2\0\2\11\3\0\13\11\1\145\15\11"+
"\22\0\7\11\2\0\2\11\3\0\11\11\1\146\17\11"+
"\22\0\7\11\2\0\2\11\3\0\6\11\1\147\22\11"+
"\22\0\7\11\2\0\2\11\3\0\12\11\1\116\16\11"+
"\22\0\7\11\2\0\2\11\3\0\7\11\1\120\21\11"+
"\22\0\7\11\2\0\2\11\3\0\11\11\1\150\17\11"+
"\22\0\7\11\2\0\2\11\3\0\2\11\1\151\26\11"+
"\22\0\7\11\2\0\2\11\3\0\6\11\1\152\22\11"+
"\22\0\7\11\2\0\2\11\3\0\27\11\1\120\1\11"+
"\22\0\7\11\2\0\2\11\3\0\12\11\1\153\16\11"+
"\22\0\7\11\2\0\2\11\3\0\5\11\1\154\23\11"+
"\22\0\7\11\2\0\2\11\3\0\4\11\1\155\24\11"+
"\22\0\7\11\2\0\2\11\3\0\2\11\1\156\26\11"+
"\22\0\7\11\2\0\2\11\3\0\11\11\1\157\17\11"+
"\22\0\7\11\2\0\2\11\3\0\24\11\1\160\4\11"+
"\22\0\7\11\2\0\2\11\3\0\17\11\1\161\11\11"+
"\22\0\7\11\2\0\2\11\3\0\4\11\1\162\10\11"+
"\1\120\2\11\1\147\10\11\22\0\7\11\2\0\2\11"+
"\3\0\7\11\1\163\7\11\1\164\11\11\22\0\7\11"+
"\2\0\2\11\3\0\6\11\1\165\22\11\22\0\7\11"+
"\2\0\2\11\3\0\5\11\1\147\1\166\22\11\22\0"+
"\7\11\2\0\2\11\3\0\2\11\1\167\26\11\22\0"+
"\7\11\2\0\2\11\3\0\4\11\1\170\24\11\22\0"+
"\7\11\2\0\2\11\3\0\4\11\1\72\24\11\22\0"+
"\7\11\2\0\2\11\3\0\2\11\1\171\26\11\22\0"+
"\7\11\2\0\2\11\3\0\5\11\1\147\23\11\22\0"+
"\7\11\2\0\2\11\3\0\6\11\1\172\22\11\22\0"+
"\7\11\2\0\2\11\3\0\5\11\1\173\1\174\22\11"+
"\22\0\7\11\2\0\2\11\3\0\24\11\1\175\4\11"+
"\22\0\7\11\2\0\2\11\3\0\20\11\1\176\10\11"+
"\22\0\7\11\2\0\2\11\3\0\1\11\1\177\27\11"+
"\22\0\7\11\2\0\2\11\3\0\10\11\1\200\20\11"+
"\22\0\7\11\2\0\2\11\3\0\11\11\1\201\5\11"+
"\1\202\11\11\22\0\7\11\2\0\2\11\3\0\1\203"+
"\30\11\22\0\7\11\2\0\2\11\3\0\12\11\1\204"+
"\4\11\1\205\11\11\22\0\7\11\2\0\2\11\3\0"+
"\17\11\1\206\11\11\17\0\1\134\2\0\66\134\60\0"+
"\1\4\5\0\1\43\5\0\3\140\1\0\1\140\1\4"+
"\1\140\2\0\1\140\4\0\2\140\1\0\2\140\3\0"+
"\1\140\1\0\1\4\1\140\5\0\1\140\31\0\3\141"+
"\6\0\1\4\5\0\1\4\1\0\1\141\15\0\1\4"+
"\31\0\3\141\16\0\1\141\47\0\1\144\1\0\1\144"+
"\10\0\1\4\5\0\1\144\47\0\1\62\1\0\1\62"+
"\10\0\1\4\5\0\1\62\47\0\7\11\2\0\2\11"+
"\3\0\4\11\1\207\24\11\22\0\7\11\2\0\2\11"+
"\3\0\12\11\1\210\16\11\22\0\7\11\2\0\2\11"+
"\3\0\13\11\1\120\15\11\22\0\7\11\2\0\2\11"+
"\3\0\4\11\1\211\24\11\22\0\7\11\2\0\2\11"+
"\3\0\4\11\1\212\24\11\22\0\7\11\2\0\2\11"+
"\3\0\17\11\1\213\11\11\22\0\7\11\2\0\2\11"+
"\3\0\12\11\1\120\16\11\22\0\7\11\2\0\2\11"+
"\3\0\6\11\1\214\22\11\22\0\7\11\2\0\2\11"+
"\3\0\6\11\1\215\22\11\22\0\7\11\2\0\2\11"+
"\3\0\10\11\1\216\20\11\22\0\7\11\2\0\2\11"+
"\3\0\7\11\1\211\21\11\22\0\7\11\2\0\2\11"+
"\3\0\13\11\1\72\15\11\22\0\7\11\2\0\2\11"+
"\3\0\6\11\1\166\22\11\22\0\7\11\2\0\2\11"+
"\3\0\2\11\1\217\26\11\22\0\7\11\2\0\2\11"+
"\3\0\11\11\1\220\17\11\22\0\7\11\2\0\2\11"+
"\3\0\5\11\1\120\23\11\22\0\7\11\2\0\2\11"+
"\3\0\20\11\1\221\10\11\22\0\7\11\2\0\2\11"+
"\3\0\10\11\1\222\20\11\22\0\7\11\2\0\2\11"+
"\3\0\6\11\1\223\22\11\22\0\7\11\2\0\2\11"+
"\3\0\5\11\1\164\23\11\22\0\7\11\2\0\2\11"+
"\3\0\25\11\1\120\3\11\22\0\7\11\2\0\2\11"+
"\3\0\13\11\1\224\15\11\22\0\7\11\2\0\2\11"+
"\3\0\6\11\1\225\22\11\22\0\7\11\2\0\2\11"+
"\3\0\13\11\1\226\15\11\22\0\7\11\2\0\2\11"+
"\3\0\11\11\1\157\1\227\16\11\22\0\7\11\2\0"+
"\2\11\3\0\1\206\30\11\22\0\7\11\2\0\2\11"+
"\3\0\4\11\1\230\24\11\22\0\7\11\2\0\2\11"+
"\3\0\14\11\1\231\14\11\22\0\7\11\2\0\2\11"+
"\3\0\6\11\1\232\22\11\22\0\7\11\2\0\2\11"+
"\3\0\26\11\1\233\2\11\22\0\7\11\2\0\2\11"+
"\3\0\12\11\1\215\16\11\22\0\7\11\2\0\2\11"+
"\3\0\4\11\1\234\24\11\22\0\7\11\2\0\2\11"+
"\3\0\21\11\1\120\7\11\22\0\7\11\2\0\2\11"+
"\3\0\12\11\1\147\16\11\22\0\7\11\2\0\2\11"+
"\3\0\14\11\1\120\14\11\22\0\7\11\2\0\2\11"+
"\3\0\13\11\1\235\15\11\22\0\7\11\2\0\2\11"+
"\3\0\6\11\1\120\22\11\22\0\7\11\2\0\2\11"+
"\3\0\12\11\1\236\16\11\22\0\7\11\2\0\2\11"+
"\3\0\26\11\1\147\2\11\22\0\7\11\2\0\2\11"+
"\3\0\7\11\1\237\21\11\22\0\7\11\2\0\2\11"+
"\3\0\17\11\1\240\11\11\22\0\7\11\2\0\2\11"+
"\3\0\16\11\1\241\12\11\22\0\7\11\2\0\2\11"+
"\3\0\5\11\1\242\23\11\22\0\7\11\2\0\2\11"+
"\3\0\27\11\1\243\1\11\22\0\7\11\2\0\2\11"+
"\3\0\7\11\1\244\21\11\22\0\7\11\2\0\2\11"+
"\3\0\16\11\1\120\12\11\22\0\7\11\2\0\2\11"+
"\3\0\17\11\1\245\11\11\22\0\7\11\2\0\2\11"+
"\3\0\2\11\1\246\26\11\22\0\7\11\2\0\2\11"+
"\3\0\4\11\1\247\24\11\22\0\7\11\2\0\2\11"+
"\3\0\7\11\1\250\21\11\22\0\7\11\2\0\2\11"+
"\3\0\13\11\1\251\15\11\22\0\7\11\2\0\2\11"+
"\3\0\20\11\1\252\10\11\22\0\7\11\2\0\2\11"+
"\3\0\4\11\1\253\24\11\22\0\7\11\2\0\2\11"+
"\3\0\13\11\1\254\15\11\22\0\7\11\2\0\2\11"+
"\3\0\4\11\1\70\24\11\22\0\7\11\2\0\2\11"+
"\3\0\6\11\1\131\22\11\22\0\7\11\2\0\2\11"+
"\3\0\4\11\1\244\24\11\22\0\7\11\2\0\2\11"+
"\3\0\12\11\1\255\16\11\22\0\7\11\2\0\2\11"+
"\3\0\4\11\1\256\24\11\22\0\7\11\2\0\2\11"+
"\3\0\10\11\1\120\20\11\22\0\7\11\2\0\2\11"+
"\3\0\7\11\1\257\21\11\22\0\7\11\2\0\2\11"+
"\3\0\17\11\1\260\11\11\22\0\7\11\2\0\2\11"+
"\3\0\2\11\1\120\26\11\22\0\7\11\2\0\2\11"+
"\3\0\2\11\1\261\26\11\22\0\7\11\2\0\2\11"+
"\3\0\21\11\1\164\7\11\22\0\7\11\2\0\2\11"+
"\3\0\2\11\1\262\26\11\22\0\7\11\2\0\2\11"+
"\3\0\1\11\1\263\27\11\22\0\7\11\2\0\2\11"+
"\3\0\23\11\1\264\5\11\22\0\7\11\2\0\2\11"+
"\3\0\12\11\1\211\16\11\22\0\7\11\2\0\2\11"+
"\3\0\25\11\1\147\3\11\22\0\7\11\2\0\2\11"+
"\3\0\10\11\1\265\20\11\22\0\7\11\2\0\2\11"+
"\3\0\15\11\1\120\13\11\22\0\7\11\2\0\2\11"+
"\3\0\10\11\1\211\20\11\22\0\7\11\2\0\2\11"+
"\3\0\11\11\1\266\17\11\22\0\7\11\2\0\2\11"+
"\3\0\13\11\1\267\15\11\22\0\7\11\2\0\2\11"+
"\3\0\20\11\1\147\10\11\22\0\7\11\2\0\2\11"+
"\3\0\10\11\1\270\20\11\22\0\7\11\2\0\2\11"+
"\3\0\4\11\1\271\24\11\22\0\7\11\2\0\2\11"+
"\3\0\13\11\1\272\15\11\22\0\7\11\2\0\2\11"+
"\3\0\6\11\1\273\22\11\22\0\7\11\2\0\2\11"+
"\3\0\2\11\1\274\26\11\22\0\7\11\2\0\2\11"+
"\3\0\2\11\1\211\26\11\22\0\7\11\2\0\2\11"+
"\3\0\13\11\1\275\15\11\22\0\7\11\2\0\2\11"+
"\3\0\10\11\1\147\20\11\22\0\7\11\2\0\2\11"+
"\3\0\2\11\1\276\26\11\22\0\7\11\2\0\2\11"+
"\3\0\13\11\1\205\15\11\22\0\7\11\2\0\2\11"+
"\3\0\17\11\1\277\11\11\22\0\7\11\2\0\2\11"+
"\3\0\11\11\1\300\17\11\22\0\7\11\2\0\2\11"+
"\3\0\6\11\1\164\22\11\22\0\7\11\2\0\2\11"+
"\3\0\30\11\1\273\22\0\7\11\2\0\2\11\3\0"+
"\1\11\1\120\27\11\17\0";
private static int [] zzUnpackTrans() {
int [] result = new int[10089];
int offset = 0;
offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
return result;
}
private static int zzUnpackTrans(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
value--;
do result[j++] = value; while (--count > 0);
}
return j;
}
/* error codes */
private static final int ZZ_UNKNOWN_ERROR = 0;
private static final int ZZ_NO_MATCH = 1;
private static final int ZZ_PUSHBACK_2BIG = 2;
/* error messages for the codes above */
private static final String ZZ_ERROR_MSG[] = {
"Unkown internal scanner error",
"Error: could not match input",
"Error: pushback value was too large"
};
/**
* ZZ_ATTRIBUTE[aState] contains the attributes of state aState
*/
private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
private static final String ZZ_ATTRIBUTE_PACKED_0 =
"\1\10\2\0\1\11\1\1\1\11\26\1\6\11\13\1"+
"\3\0\1\1\4\0\44\1\2\11\2\1\2\11\2\1"+
"\3\0\134\1";
private static int [] zzUnpackAttribute() {
int [] result = new int[192];
int offset = 0;
offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
return result;
}
private static int zzUnpackAttribute(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
do result[j++] = value; while (--count > 0);
}
return j;
}
/** the input device */
private java.io.Reader zzReader;
/** the current state of the DFA */
private int zzState;
/** the current lexical state */
private int zzLexicalState = YYINITIAL;
/** this buffer contains the current text to be matched and is
the source of the yytext() string */
private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
/** the textposition at the last accepting state */
private int zzMarkedPos;
/** the textposition at the last state to be included in yytext */
private int zzPushbackPos;
/** the current text position in the buffer */
private int zzCurrentPos;
/** startRead marks the beginning of the yytext() string in the buffer */
private int zzStartRead;
/** endRead marks the last character in the buffer, that has been read
from input */
private int zzEndRead;
/** number of newlines encountered up to the start of the matched text */
private int yyline;
/** the number of characters up to the start of the matched text */
private int yychar;
/**
* the number of characters from the last newline up to the start of the
* matched text
*/
private int yycolumn;
/**
* zzAtBOL == true <=> the scanner is currently at the beginning of a line
*/
private boolean zzAtBOL = true;
/** zzAtEOF == true <=> the scanner is at the EOF */
private boolean zzAtEOF;
/* user code: */
final static String leftParenth = "(";
final static String leftBrace = "{";
final static String leftBracket = "[";
int line = 1;
class IdentInfo {
private String ident;
public String ident() { return ident; }
private Vector< Integer > lines = new Vector< Integer >();
public IdentInfo( String ident ) {
this.ident = ident;
}
void addLine( int line ) {
lines.addElement( new Integer( line ) );
}
void print() {
System.out.print( ident + ":" );
for ( int i = 0; i < lines.size(); i++ )
System.out.print( "\t" + lines.elementAt( i ) );
System.out.println();
}
}
class IdentTable {
Vector< IdentInfo > table = new Vector< IdentInfo >();
public IdentInfo identInfo( int i ) {
return ( IdentInfo ) table.elementAt( i );
}
public int size() {
return table.size();
}
void addLine( String ident, int line ) {
// System.out.println( "addLine( " + ident + ", " + line + " )" );
for ( int i = 0; i < size(); i++ ) {
IdentInfo identInfo = identInfo( i );
int compare = identInfo.ident().compareTo( ident );
if ( compare == 0 ) {
identInfo.addLine( line );
return;
}
else if ( compare > 0 ) {
identInfo = new IdentInfo( ident );
table.insertElementAt( identInfo, i );
identInfo.addLine( line );
return;
}
}
IdentInfo identInfo = new IdentInfo( ident );
table.insertElementAt( identInfo, size() );
identInfo.addLine( line );
}
void print() {
System.out.println( "Identifier Table" );
for ( int i = 0; i < size(); i++ ) {
IdentInfo identInfo = identInfo( i );
identInfo.print();
}
}
}
IdentTable identTable = new IdentTable();
void error( String s ) {
System.err.println( line + ": " + s );
}
Stack< String > stack = new Stack< String >();
void push( String symbol ) {
stack.push( symbol );
}
void pop( String left ) {
while ( ! stack.empty() ) {
String top = ( String ) stack.pop();
if ( top.equals( left ) )
return;
error( "Incomplete " + top + "..." );
}
error( "Missing " + left + "..." );
}
public void finish() {
while ( ! stack.empty() ) {
String top = ( String ) stack.pop();
error( "Incomplete " + top + "..." );
}
if ( yystate() != NORMAL )
error( "Incomplete /* ... " );
identTable.print();
}
/**
* Creates a new scanner
* There is also a java.io.InputStream version of this constructor.
*
* @param in the java.io.Reader to read input from.
*/
public Yylex(java.io.Reader in) {
yybegin( NORMAL );
this.zzReader = in;
}
/**
* Creates a new scanner.
* There is also java.io.Reader version of this constructor.
*
* @param in the java.io.Inputstream to read input from.
*/
public Yylex(java.io.InputStream in) {
this(new java.io.InputStreamReader(in));
}
/**
* Refills the input buffer.
*
* @return false
, iff there was new input.
*
* @exception java.io.IOException if any I/O-Error occurs
*/
private boolean zzRefill() throws java.io.IOException {
/* first: make room (if you can) */
if (zzStartRead > 0) {
System.arraycopy(zzBuffer, zzStartRead,
zzBuffer, 0,
zzEndRead-zzStartRead);
/* translate stored positions */
zzEndRead-= zzStartRead;
zzCurrentPos-= zzStartRead;
zzMarkedPos-= zzStartRead;
zzPushbackPos-= zzStartRead;
zzStartRead = 0;
}
/* is the buffer big enough? */
if (zzCurrentPos >= zzBuffer.length) {
/* if not: blow it up */
char newBuffer[] = new char[zzCurrentPos*2];
System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
zzBuffer = newBuffer;
}
/* finally: fill the buffer with new input */
int numRead = zzReader.read(zzBuffer, zzEndRead,
zzBuffer.length-zzEndRead);
if (numRead < 0) {
return true;
}
else {
zzEndRead+= numRead;
return false;
}
}
/**
* Closes the input stream.
*/
public final void yyclose() throws java.io.IOException {
zzAtEOF = true; /* indicate end of file */
zzEndRead = zzStartRead; /* invalidate buffer */
if (zzReader != null)
zzReader.close();
}
/**
* Resets the scanner to read from a new input stream.
* Does not close the old reader.
*
* All internal variables are reset, the old input stream
* cannot be reused (internal buffer is discarded and lost).
* Lexical state is set to ZZ_INITIAL.
*
* @param reader the new input stream
*/
public final void yyreset(java.io.Reader reader) {
zzReader = reader;
zzAtBOL = true;
zzAtEOF = false;
zzEndRead = zzStartRead = 0;
zzCurrentPos = zzMarkedPos = zzPushbackPos = 0;
yyline = yychar = yycolumn = 0;
zzLexicalState = YYINITIAL;
}
/**
* Returns the current lexical state.
*/
public final int yystate() {
return zzLexicalState;
}
/**
* Enters a new lexical state
*
* @param newState the new lexical state
*/
public final void yybegin(int newState) {
zzLexicalState = newState;
}
/**
* Returns the text matched by the current regular expression.
*/
public final String yytext() {
return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
}
/**
* Returns the character at position pos from the
* matched text.
*
* It is equivalent to yytext().charAt(pos), but faster
*
* @param pos the position of the character to fetch.
* A value from 0 to yylength()-1.
*
* @return the character at position pos
*/
public final char yycharat(int pos) {
return zzBuffer[zzStartRead+pos];
}
/**
* Returns the length of the matched text region.
*/
public final int yylength() {
return zzMarkedPos-zzStartRead;
}
/**
* Reports an error that occured while scanning.
*
* In a wellformed scanner (no or only correct usage of
* yypushback(int) and a match-all fallback rule) this method
* will only be called with things that "Can't Possibly Happen".
* If this method is called, something is seriously wrong
* (e.g. a JFlex bug producing a faulty scanner etc.).
*
* Usual syntax/scanner level error handling should be done
* in error fallback rules.
*
* @param errorCode the code of the errormessage to display
*/
private void zzScanError(int errorCode) {
String message;
try {
message = ZZ_ERROR_MSG[errorCode];
}
catch (ArrayIndexOutOfBoundsException e) {
message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
}
throw new Error(message);
}
/**
* Pushes the specified amount of characters back into the input stream.
*
* They will be read again by then next call of the scanning method
*
* @param number the number of characters to be read again.
* This number must not be greater than yylength()!
*/
public void yypushback(int number) {
if ( number > yylength() )
zzScanError(ZZ_PUSHBACK_2BIG);
zzMarkedPos -= number;
}
/**
* Resumes scanning until the next regular expression is matched,
* the end of input is encountered or an I/O-Error occurs.
*
* @return the next token
* @exception java.io.IOException if any I/O-Error occurs
*/
public void yylex() throws java.io.IOException {
int zzInput;
int zzAction;
// cached fields:
int zzCurrentPosL;
int zzMarkedPosL;
int zzEndReadL = zzEndRead;
char [] zzBufferL = zzBuffer;
char [] zzCMapL = ZZ_CMAP;
int [] zzTransL = ZZ_TRANS;
int [] zzRowMapL = ZZ_ROWMAP;
int [] zzAttrL = ZZ_ATTRIBUTE;
while (true) {
zzMarkedPosL = zzMarkedPos;
yychar+= zzMarkedPosL-zzStartRead;
zzAction = -1;
zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
zzState = zzLexicalState;
zzForAction: {
while (true) {
if (zzCurrentPosL < zzEndReadL)
zzInput = zzBufferL[zzCurrentPosL++];
else if (zzAtEOF) {
zzInput = YYEOF;
break zzForAction;
}
else {
// store back cached positions
zzCurrentPos = zzCurrentPosL;
zzMarkedPos = zzMarkedPosL;
boolean eof = zzRefill();
// get translated positions and possibly new buffer
zzCurrentPosL = zzCurrentPos;
zzMarkedPosL = zzMarkedPos;
zzBufferL = zzBuffer;
zzEndReadL = zzEndRead;
if (eof) {
zzInput = YYEOF;
break zzForAction;
}
else {
zzInput = zzBufferL[zzCurrentPosL++];
}
}
int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
if (zzNext == -1) break zzForAction;
zzState = zzNext;
int zzAttributes = zzAttrL[zzState];
if ( (zzAttributes & 1) == 1 ) {
zzAction = zzState;
zzMarkedPosL = zzCurrentPosL;
if ( (zzAttributes & 8) == 8 ) break zzForAction;
}
}
}
// store back cached position
zzMarkedPos = zzMarkedPosL;
switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
case 8:
{ push( leftBracket );
}
case 14: break;
case 11:
{ yybegin( COMMENT );
}
case 15: break;
case 6:
{ push( leftBrace );
}
case 16: break;
case 4:
{ push( leftParenth );
}
case 17: break;
case 9:
{ pop( leftBracket );
}
case 18: break;
case 7:
{ pop( leftBrace );
}
case 19: break;
case 13:
{ error( "Nested /* ... " );
}
case 20: break;
case 10:
{ error( "Missing /* ..." );
}
case 21: break;
case 5:
{ pop( leftParenth );
}
case 22: break;
case 2:
{ line++;
}
case 23: break;
case 3:
{ identTable.addLine( yytext(), line );
}
case 24: break;
case 12:
{ yybegin( NORMAL );
}
case 25: break;
case 1:
{
}
case 26: break;
default:
if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
zzAtEOF = true;
{ finish();
return;
}
}
else {
zzScanError(ZZ_NO_MATCH);
}
}
}
}
}