/* The following code was generated by JFlex 1.3.5 on 12/12/06 10:27 PM */
package ppg.lex;
import java.io.InputStream;
import ppg.parse.*;
/**
* This class is a scanner generated by
* <a href="http://www.jflex.de/">JFlex</a> 1.3.5
* on 12/12/06 10:27 PM from the specification file
* <tt>file:/Users/nystrom/work/polyglot/workspaces/new/polyglot1/polyglot/src/ppg/lex/ppg.flex</tt>
*/
public class Lexer {
/** This character denotes the end of file */
final public static int YYEOF = -1;
/** initial size of the lookahead buffer */
final private static int YY_BUFFERSIZE = 16384;
/** lexical states */
final public static int CODE = 3;
final public static int STRING = 2;
final public static int YYINITIAL = 0;
final public static int COMMENT = 1;
/**
* Translates characters to character classes
*/
final private static char [] yycmap = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 0, 3, 3, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
10, 9, 18, 9, 9, 46, 9, 9, 9, 9, 6, 9, 41, 9, 40, 4,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 7, 39, 9, 38, 9, 9,
17, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 43, 11, 44, 15, 16,
17, 30, 1, 20, 23, 24, 32, 34, 37, 19, 1, 33, 21, 35, 13, 27,
28, 1, 26, 31, 14, 22, 29, 36, 25, 1, 1, 42, 45, 8, 17, 0
};
/**
* Translates a state to a row index in the transition table
*/
final private static int yy_rowMap [] = {
0, 47, 94, 141, 188, 235, 282, 329, 188, 376,
188, 423, 470, 188, 517, 564, 611, 658, 705, 752,
799, 846, 893, 940, 987, 188, 188, 188, 1034, 188,
188, 188, 1081, 1128, 1128, 1175, 188, 1222, 1269, 188,
1316, 1316, 1363, 1410, 188, 1457, 1504, 1551, 1598, 235,
1645, 1692, 1739, 1786, 1833, 1880, 1927, 1974, 2021, 2068,
2115, 2162, 2209, 2256, 188, 2303, 1175, 188, 2350, 2397,
2444, 1363, 188, 188, 2491, 2538, 2585, 2632, 2679, 2726,
2773, 2820, 2867, 2914, 2961, 3008, 3055, 3102, 3149, 3196,
3243, 3290, 3337, 3384, 3431, 3478, 3525, 3572, 3619, 235,
3666, 3713, 3760, 235, 235, 235, 3807, 3854, 3901, 3948,
3995, 4042, 4089, 4136, 235, 235, 4183, 4230, 4277, 4324,
4371, 4418, 4465, 4512, 4559, 235, 4606, 4653, 4700, 4747,
4794, 235, 188, 4841, 4888, 4935, 4982, 5029, 5076, 235,
5123, 5170, 5217, 5264, 235, 235, 5311, 5358, 5405, 5452,
235, 5499, 235, 5546, 5593, 235, 5640, 235, 235, 235,
5687, 235, 5734, 5781, 5828, 5875, 5922, 235, 235, 235
};
/**
* The packed transition table of the DFA (part 0)
*/
final private static String yy_packed0 =
"\1\5\1\6\1\5\1\7\1\10\1\7\1\11\1\12"+
"\1\13\1\5\1\7\1\5\1\6\1\14\1\15\3\5"+
"\1\16\1\17\1\20\1\21\1\6\1\22\1\23\1\6"+
"\1\24\1\25\1\26\1\6\1\27\1\30\4\6\1\31"+
"\1\6\1\5\1\32\1\33\1\34\1\35\1\36\1\37"+
"\1\40\1\41\5\42\1\43\1\44\50\42\1\45\2\46"+
"\1\45\1\46\1\0\5\46\1\47\6\46\1\50\34\46"+
"\5\51\1\52\1\51\1\53\47\51\60\0\2\6\11\0"+
"\3\6\1\0\1\6\2\0\23\6\14\0\1\7\1\0"+
"\1\7\4\0\1\7\50\0\1\54\1\0\1\55\57\0"+
"\1\56\50\0\2\6\11\0\3\6\1\0\1\6\2\0"+
"\10\6\1\57\12\6\12\0\2\6\11\0\3\6\1\0"+
"\1\6\2\0\5\6\1\60\1\6\1\61\1\62\12\6"+
"\12\0\2\6\11\0\1\6\1\63\1\6\1\0\1\6"+
"\2\0\20\6\1\64\2\6\12\0\2\6\11\0\3\6"+
"\1\0\1\6\2\0\10\6\1\65\12\6\12\0\2\6"+
"\11\0\3\6\1\0\1\6\2\0\5\6\1\66\15\6"+
"\12\0\2\6\11\0\3\6\1\0\1\6\2\0\7\6"+
"\1\67\13\6\12\0\2\6\11\0\3\6\1\0\1\6"+
"\2\0\6\6\1\70\14\6\12\0\2\6\11\0\3\6"+
"\1\0\1\6\2\0\1\71\22\6\12\0\2\6\11\0"+
"\3\6\1\0\1\6\2\0\12\6\1\72\10\6\12\0"+
"\2\6\11\0\3\6\1\0\1\6\2\0\7\6\1\73"+
"\3\6\1\74\7\6\12\0\2\6\11\0\3\6\1\0"+
"\1\6\2\0\1\6\1\75\21\6\12\0\2\6\11\0"+
"\2\6\1\76\1\0\1\6\2\0\1\6\1\77\21\6"+
"\12\0\2\6\11\0\3\6\1\0\1\6\2\0\1\100"+
"\22\6\20\0\1\101\103\0\1\102\22\0\6\43\1\103"+
"\54\43\1\104\1\43\1\103\50\43\1\0\2\46\1\0"+
"\1\46\1\0\5\46\1\47\6\46\1\50\34\46\2\0"+
"\1\105\1\106\1\0\1\106\4\0\1\106\4\46\1\107"+
"\2\0\1\46\34\0\7\52\1\110\56\52\1\110\1\111"+
"\46\52\5\54\1\0\51\54\46\0\1\112\11\0\2\6"+
"\11\0\1\6\1\113\1\6\1\0\1\6\2\0\23\6"+
"\12\0\2\6\11\0\3\6\1\0\1\6\2\0\7\6"+
"\1\114\13\6\12\0\2\6\11\0\3\6\1\0\1\6"+
"\2\0\13\6\1\115\7\6\12\0\2\6\11\0\3\6"+
"\1\0\1\6\2\0\1\116\1\117\21\6\12\0\2\6"+
"\11\0\3\6\1\0\1\6\2\0\11\6\1\120\11\6"+
"\12\0\2\6\11\0\3\6\1\0\1\6\2\0\4\6"+
"\1\121\16\6\12\0\2\6\11\0\3\6\1\0\1\6"+
"\2\0\15\6\1\122\5\6\12\0\2\6\11\0\3\6"+
"\1\0\1\6\2\0\10\6\1\123\12\6\12\0\2\6"+
"\11\0\2\6\1\124\1\0\1\6\2\0\23\6\12\0"+
"\2\6\11\0\3\6\1\0\1\6\2\0\17\6\1\125"+
"\3\6\12\0\2\6\11\0\3\6\1\0\1\6\2\0"+
"\5\6\1\126\15\6\12\0\2\6\11\0\3\6\1\0"+
"\1\6\2\0\5\6\1\127\15\6\12\0\2\6\11\0"+
"\3\6\1\0\1\6\2\0\1\6\1\130\5\6\1\131"+
"\13\6\12\0\2\6\11\0\2\6\1\132\1\0\1\6"+
"\2\0\23\6\12\0\2\6\11\0\3\6\1\0\1\6"+
"\2\0\13\6\1\133\7\6\12\0\2\6\11\0\3\6"+
"\1\0\1\6\2\0\13\6\1\134\7\6\12\0\2\6"+
"\11\0\2\6\1\135\1\0\1\6\2\0\23\6\43\0"+
"\1\136\26\0\1\137\57\0\1\106\1\0\1\106\4\0"+
"\1\106\1\46\44\0\1\46\6\0\1\46\2\0\7\46"+
"\1\0\23\46\4\0\4\46\2\0\2\6\11\0\2\6"+
"\1\140\1\0\1\6\2\0\13\6\1\141\7\6\12\0"+
"\2\6\11\0\3\6\1\0\1\6\2\0\20\6\1\142"+
"\2\6\12\0\2\6\11\0\1\6\1\143\1\6\1\0"+
"\1\6\2\0\23\6\12\0\2\6\11\0\2\6\1\144"+
"\1\0\1\6\2\0\23\6\12\0\2\6\11\0\3\6"+
"\1\0\1\6\2\0\2\6\1\145\20\6\12\0\2\6"+
"\11\0\3\6\1\0\1\6\2\0\2\6\1\146\5\6"+
"\1\147\12\6\12\0\2\6\11\0\3\6\1\0\1\6"+
"\2\0\5\6\1\150\15\6\12\0\2\6\11\0\2\6"+
"\1\151\1\0\1\6\2\0\23\6\12\0\2\6\11\0"+
"\3\6\1\0\1\6\2\0\11\6\1\152\11\6\12\0"+
"\2\6\11\0\3\6\1\0\1\6\2\0\5\6\1\153"+
"\15\6\12\0\2\6\11\0\3\6\1\0\1\6\2\0"+
"\22\6\1\154\12\0\2\6\11\0\3\6\1\0\1\6"+
"\2\0\7\6\1\155\13\6\12\0\2\6\11\0\3\6"+
"\1\0\1\6\2\0\1\6\1\156\21\6\12\0\2\6"+
"\11\0\3\6\1\0\1\6\2\0\16\6\1\157\4\6"+
"\12\0\2\6\11\0\3\6\1\0\1\6\2\0\14\6"+
"\1\160\6\6\12\0\2\6\11\0\3\6\1\0\1\6"+
"\2\0\1\161\22\6\12\0\2\6\11\0\3\6\1\0"+
"\1\6\2\0\7\6\1\162\13\6\12\0\2\6\11\0"+
"\1\6\1\163\1\6\1\0\1\6\2\0\23\6\12\0"+
"\2\6\11\0\3\6\1\0\1\6\2\0\22\6\1\164"+
"\41\0\1\165\30\0\1\46\55\0\2\6\11\0\3\6"+
"\1\0\1\6\2\0\5\6\1\166\15\6\12\0\2\6"+
"\11\0\3\6\1\0\1\6\2\0\14\6\1\167\6\6"+
"\12\0\2\6\11\0\3\6\1\0\1\6\2\0\1\170"+
"\22\6\12\0\2\6\11\0\3\6\1\0\1\6\2\0"+
"\14\6\1\171\6\6\12\0\2\6\11\0\3\6\1\0"+
"\1\6\2\0\3\6\1\172\17\6\12\0\2\6\11\0"+
"\3\6\1\0\1\6\2\0\5\6\1\173\15\6\12\0"+
"\2\6\11\0\3\6\1\0\1\6\2\0\7\6\1\174"+
"\13\6\12\0\2\6\11\0\1\6\1\175\1\6\1\0"+
"\1\6\2\0\23\6\12\0\2\6\11\0\2\6\1\176"+
"\1\0\1\6\2\0\23\6\12\0\2\6\11\0\3\6"+
"\1\0\1\6\2\0\7\6\1\177\13\6\12\0\2\6"+
"\11\0\3\6\1\0\1\6\2\0\5\6\1\200\15\6"+
"\12\0\2\6\11\0\3\6\1\0\1\6\2\0\13\6"+
"\1\201\7\6\12\0\2\6\11\0\3\6\1\0\1\6"+
"\2\0\5\6\1\202\15\6\12\0\2\6\11\0\3\6"+
"\1\0\1\6\2\0\10\6\1\203\12\6\12\0\2\6"+
"\11\0\2\6\1\204\1\0\1\6\2\0\23\6\35\0"+
"\1\205\33\0\2\6\11\0\3\6\1\0\1\6\2\0"+
"\7\6\1\206\13\6\12\0\2\6\11\0\3\6\1\0"+
"\1\6\2\0\14\6\1\207\6\6\12\0\2\6\11\0"+
"\1\6\1\210\1\6\1\0\1\6\2\0\23\6\12\0"+
"\2\6\11\0\3\6\1\0\1\6\2\0\15\6\1\211"+
"\5\6\12\0\2\6\11\0\3\6\1\0\1\6\2\0"+
"\4\6\1\212\16\6\12\0\2\6\11\0\3\6\1\0"+
"\1\6\2\0\20\6\1\213\2\6\12\0\2\6\11\0"+
"\2\6\1\214\1\0\1\6\2\0\23\6\12\0\2\6"+
"\11\0\3\6\1\0\1\6\2\0\4\6\1\215\16\6"+
"\12\0\2\6\11\0\3\6\1\0\1\6\2\0\1\216"+
"\22\6\12\0\2\6\11\0\3\6\1\0\1\6\2\0"+
"\4\6\1\217\16\6\12\0\2\6\11\0\3\6\1\0"+
"\1\6\2\0\17\6\1\220\3\6\12\0\2\6\11\0"+
"\3\6\1\0\1\6\2\0\7\6\1\221\13\6\12\0"+
"\2\6\11\0\1\6\1\222\1\6\1\0\1\6\2\0"+
"\23\6\12\0\2\6\11\0\3\6\1\0\1\6\2\0"+
"\20\6\1\223\2\6\12\0\2\6\11\0\3\6\1\0"+
"\1\6\2\0\10\6\1\224\12\6\12\0\2\6\11\0"+
"\3\6\1\0\1\6\2\0\13\6\1\225\7\6\12\0"+
"\2\6\11\0\3\6\1\0\1\6\2\0\5\6\1\226"+
"\15\6\12\0\2\6\11\0\3\6\1\0\1\6\2\0"+
"\5\6\1\227\15\6\12\0\2\6\11\0\3\6\1\0"+
"\1\6\2\0\5\6\1\230\15\6\12\0\2\6\11\0"+
"\3\6\1\0\1\6\2\0\14\6\1\231\6\6\12\0"+
"\2\6\11\0\3\6\1\0\1\6\2\0\4\6\1\232"+
"\16\6\12\0\2\6\11\0\3\6\1\0\1\6\2\0"+
"\5\6\1\233\15\6\12\0\2\6\11\0\3\6\1\0"+
"\1\6\2\0\5\6\1\234\15\6\12\0\2\6\11\0"+
"\3\6\1\0\1\6\2\0\1\235\22\6\12\0\2\6"+
"\11\0\3\6\1\0\1\6\2\0\1\6\1\236\21\6"+
"\12\0\2\6\11\0\3\6\1\0\1\6\2\0\2\6"+
"\1\237\20\6\12\0\2\6\11\0\3\6\1\0\1\6"+
"\2\0\7\6\1\240\13\6\12\0\2\6\11\0\1\6"+
"\1\241\1\6\1\0\1\6\2\0\23\6\12\0\2\6"+
"\11\0\3\6\1\0\1\6\2\0\5\6\1\242\15\6"+
"\12\0\2\6\11\0\1\6\1\243\1\6\1\0\1\6"+
"\2\0\23\6\12\0\2\6\11\0\1\6\1\244\1\6"+
"\1\0\1\6\2\0\23\6\12\0\2\6\11\0\2\6"+
"\1\245\1\0\1\6\2\0\23\6\12\0\2\6\11\0"+
"\3\6\1\0\1\6\2\0\1\6\1\246\21\6\12\0"+
"\2\6\11\0\3\6\1\0\1\6\2\0\13\6\1\247"+
"\7\6\12\0\2\6\11\0\3\6\1\0\1\6\2\0"+
"\14\6\1\250\6\6\12\0\2\6\11\0\3\6\1\0"+
"\1\6\2\0\5\6\1\251\15\6\12\0\2\6\11\0"+
"\3\6\1\0\1\6\2\0\2\6\1\252\20\6\11\0";
/**
* The transition table of the DFA
*/
final private static int yytrans [] = yy_unpack();
/* error codes */
final private static int YY_UNKNOWN_ERROR = 0;
final private static int YY_ILLEGAL_STATE = 1;
final private static int YY_NO_MATCH = 2;
final private static int YY_PUSHBACK_2BIG = 3;
/* error messages for the codes above */
final private static String YY_ERROR_MSG[] = {
"Unkown internal scanner error",
"Internal error: unknown state",
"Error: could not match input",
"Error: pushback value was too large"
};
/**
* YY_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
*/
private final static byte YY_ATTRIBUTE[] = {
0, 0, 1, 0, 9, 1, 1, 1, 9, 1, 9, 1, 1, 9, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 1, 9, 9, 9,
1, 1, 0, 1, 9, 1, 1, 9, 1, 0, 1, 1, 9, 0, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
9, 0, 0, 9, 0, 0, 0, 0, 9, 9, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1
};
/** the input device */
private java.io.Reader yy_reader;
/** the current state of the DFA */
private int yy_state;
/** the current lexical state */
private int yy_lexical_state = YYINITIAL;
/** this buffer contains the current text to be matched and is
the source of the yytext() string */
private char yy_buffer[] = new char[YY_BUFFERSIZE];
/** the textposition at the last accepting state */
private int yy_markedPos;
/** the textposition at the last state to be included in yytext */
private int yy_pushbackPos;
/** the current text position in the buffer */
private int yy_currentPos;
/** startRead marks the beginning of the yytext() string in the buffer */
private int yy_startRead;
/** endRead marks the last character in the buffer, that has been read
from input */
private int yy_endRead;
/** 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;
/**
* yy_atBOL == true <=> the scanner is currently at the beginning of a line
*/
private boolean yy_atBOL = true;
/** yy_atEOF == true <=> the scanner is at the EOF */
private boolean yy_atEOF;
/* user code: */
private int lastId = -1;
private String filename = "";
private String lineSeparator;
/*
private Position pos() {
return new Position(filename, yyline+1, yycolumn);
}
*/
public Lexer(InputStream in, String filename) {
this(in);
this.filename = filename;
}
private void error(String message) throws LexicalError {
throw new LexicalError(filename, yyline+1, message);
}
private Token t(int id, Object value) {
lastId = id;
return new Token(id, filename, yyline + 1, yychar, yychar + yylength(), value);
}
private Token t(int id) {
return t(id, yytext());
}
/**
* 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 Lexer(java.io.Reader in) {
lineSeparator = System.getProperty("line.separator", "\n");
this.yy_reader = 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 Lexer(java.io.InputStream in) {
this(new java.io.InputStreamReader(in));
}
/**
* Unpacks the split, compressed DFA transition table.
*
* @return the unpacked transition table
*/
private static int [] yy_unpack() {
int [] trans = new int[5969];
int offset = 0;
offset = yy_unpack(yy_packed0, offset, trans);
return trans;
}
/**
* Unpacks the compressed DFA transition table.
*
* @param packed the packed transition table
* @return the index of the last entry
*/
private static int yy_unpack(String packed, int offset, int [] trans) {
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 trans[j++] = value; while (--count > 0);
}
return j;
}
/**
* Refills the input buffer.
*
* @return <code>false</code>, iff there was new input.
*
* @exception IOException if any I/O-Error occurs
*/
private boolean yy_refill() throws java.io.IOException {
/* first: make room (if you can) */
if (yy_startRead > 0) {
System.arraycopy(yy_buffer, yy_startRead,
yy_buffer, 0,
yy_endRead-yy_startRead);
/* translate stored positions */
yy_endRead-= yy_startRead;
yy_currentPos-= yy_startRead;
yy_markedPos-= yy_startRead;
yy_pushbackPos-= yy_startRead;
yy_startRead = 0;
}
/* is the buffer big enough? */
if (yy_currentPos >= yy_buffer.length) {
/* if not: blow it up */
char newBuffer[] = new char[yy_currentPos*2];
System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
yy_buffer = newBuffer;
}
/* finally: fill the buffer with new input */
int numRead = yy_reader.read(yy_buffer, yy_endRead,
yy_buffer.length-yy_endRead);
if (numRead < 0) {
return true;
}
else {
yy_endRead+= numRead;
return false;
}
}
/**
* Closes the input stream.
*/
final public void yyclose() throws java.io.IOException {
yy_atEOF = true; /* indicate end of file */
yy_endRead = yy_startRead; /* invalidate buffer */
if (yy_reader != null)
yy_reader.close();
}
/**
* Closes the current stream, and resets the
* scanner to read from a new input stream.
*
* All internal variables are reset, the old input stream
* <b>cannot</b> be reused (internal buffer is discarded and lost).
* Lexical state is set to <tt>YY_INITIAL</tt>.
*
* @param reader the new input stream
*/
final public void yyreset(java.io.Reader reader) throws java.io.IOException {
yyclose();
yy_reader = reader;
yy_atBOL = true;
yy_atEOF = false;
yy_endRead = yy_startRead = 0;
yy_currentPos = yy_markedPos = yy_pushbackPos = 0;
yyline = yychar = yycolumn = 0;
yy_lexical_state = YYINITIAL;
}
/**
* Returns the current lexical state.
*/
final public int yystate() {
return yy_lexical_state;
}
/**
* Enters a new lexical state
*
* @param newState the new lexical state
*/
final public void yybegin(int newState) {
yy_lexical_state = newState;
}
/**
* Returns the text matched by the current regular expression.
*/
final public String yytext() {
return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
}
/**
* Returns the character at position <tt>pos</tt> 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
*/
final public char yycharat(int pos) {
return yy_buffer[yy_startRead+pos];
}
/**
* Returns the length of the matched text region.
*/
final public int yylength() {
return yy_markedPos-yy_startRead;
}
/**
* 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 yy_ScanError(int errorCode) {
String message;
try {
message = YY_ERROR_MSG[errorCode];
}
catch (ArrayIndexOutOfBoundsException e) {
message = YY_ERROR_MSG[YY_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()!
*/
private void yypushback(int number) {
if ( number > yylength() )
yy_ScanError(YY_PUSHBACK_2BIG);
yy_markedPos -= 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 IOException if any I/O-Error occurs
*/
public Token getToken() throws java.io.IOException, LexicalError
{
int yy_input;
int yy_action;
// cached fields:
int yy_currentPos_l;
int yy_startRead_l;
int yy_markedPos_l;
int yy_endRead_l = yy_endRead;
char [] yy_buffer_l = yy_buffer;
char [] yycmap_l = yycmap;
int [] yytrans_l = yytrans;
int [] yy_rowMap_l = yy_rowMap;
byte [] yy_attr_l = YY_ATTRIBUTE;
while (true) {
yy_markedPos_l = yy_markedPos;
yychar+= yy_markedPos_l-yy_startRead;
boolean yy_r = false;
for (yy_currentPos_l = yy_startRead; yy_currentPos_l < yy_markedPos_l;
yy_currentPos_l++) {
switch (yy_buffer_l[yy_currentPos_l]) {
case '\u000B':
case '\u000C':
case '\u0085':
case '\u2028':
case '\u2029':
yyline++;
yy_r = false;
break;
case '\r':
yyline++;
yy_r = true;
break;
case '\n':
if (yy_r)
yy_r = false;
else {
yyline++;
}
break;
default:
yy_r = false;
}
}
if (yy_r) {
// peek one character ahead if it is \n (if we have counted one line too much)
boolean yy_peek;
if (yy_markedPos_l < yy_endRead_l)
yy_peek = yy_buffer_l[yy_markedPos_l] == '\n';
else if (yy_atEOF)
yy_peek = false;
else {
boolean eof = yy_refill();
yy_markedPos_l = yy_markedPos;
yy_buffer_l = yy_buffer;
if (eof)
yy_peek = false;
else
yy_peek = yy_buffer_l[yy_markedPos_l] == '\n';
}
if (yy_peek) yyline--;
}
yy_action = -1;
yy_startRead_l = yy_currentPos_l = yy_currentPos =
yy_startRead = yy_markedPos_l;
yy_state = yy_lexical_state;
yy_forAction: {
while (true) {
if (yy_currentPos_l < yy_endRead_l)
yy_input = yy_buffer_l[yy_currentPos_l++];
else if (yy_atEOF) {
yy_input = YYEOF;
break yy_forAction;
}
else {
// store back cached positions
yy_currentPos = yy_currentPos_l;
yy_markedPos = yy_markedPos_l;
boolean eof = yy_refill();
// get translated positions and possibly new buffer
yy_currentPos_l = yy_currentPos;
yy_markedPos_l = yy_markedPos;
yy_buffer_l = yy_buffer;
yy_endRead_l = yy_endRead;
if (eof) {
yy_input = YYEOF;
break yy_forAction;
}
else {
yy_input = yy_buffer_l[yy_currentPos_l++];
}
}
int yy_next = yytrans_l[ yy_rowMap_l[yy_state] + yycmap_l[yy_input] ];
if (yy_next == -1) break yy_forAction;
yy_state = yy_next;
int yy_attributes = yy_attr_l[yy_state];
if ( (yy_attributes & 1) == 1 ) {
yy_action = yy_state;
yy_markedPos_l = yy_currentPos_l;
if ( (yy_attributes & 8) == 8 ) break yy_forAction;
}
}
}
// store back cached position
yy_markedPos = yy_markedPos_l;
switch (yy_action) {
case 5:
case 11:
case 12:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 46:
case 47:
case 48:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
case 58:
case 59:
case 60:
case 61:
case 62:
case 63:
case 75:
case 76:
case 77:
case 78:
case 79:
case 80:
case 81:
case 82:
case 83:
case 84:
case 85:
case 86:
case 87:
case 88:
case 89:
case 90:
case 91:
case 92:
case 95:
case 96:
case 97:
case 98:
case 100:
case 101:
case 102:
case 106:
case 107:
case 108:
case 109:
case 110:
case 111:
case 112:
case 113:
case 117:
case 118:
case 119:
case 120:
case 121:
case 122:
case 123:
case 124:
case 126:
case 127:
case 128:
case 129:
case 130:
case 133:
case 134:
case 135:
case 136:
case 137:
case 138:
case 141:
case 142:
case 143:
case 146:
case 147:
case 148:
case 149:
case 151:
case 153:
case 154:
case 156:
case 160:
case 162:
case 163:
case 164:
case 165:
case 166:
{ return t(Constant.ID, yytext().intern()); }
case 171: break;
case 64:
{ yybegin (CODE); }
case 172: break;
case 155:
{ return t(Constant.PACKAGE); }
case 173: break;
case 152:
{ return t(Constant.EXTENDS); }
case 174: break;
case 150:
{ return t(Constant.INCLUDE); }
case 175: break;
case 145:
{ return t(Constant.ACTION); }
case 176: break;
case 144:
{ return t(Constant.PARSER); }
case 177: break;
case 140:
{ return t(Constant.EXTEND); }
case 178: break;
case 139:
{ return t(Constant.IMPORT); }
case 179: break;
case 132:
{ return t(Constant.PERCENT_PREC); }
case 180: break;
case 30:
{ return t(Constant.RBRACK); }
case 181: break;
case 29:
{ return t(Constant.LBRACK); }
case 182: break;
case 28:
{ return t(Constant.LBRACE); }
case 183: break;
case 10:
{ return t(Constant.RBRACE); }
case 184: break;
case 39:
{
yybegin(YYINITIAL);
String literal = yytext();
return t(Constant.STRING_CONST, literal.substring(0, literal.length()-1));
}
case 185: break;
case 131:
{ return t(Constant.START); }
case 186: break;
case 27:
{ return t(Constant.COMMA); }
case 187: break;
case 25:
{ return t(Constant.SEMI); }
case 188: break;
case 8:
{ return t(Constant.STAR); }
case 189: break;
case 9:
{ return t(Constant.COLON); }
case 190: break;
case 99:
{ return t(Constant.INIT); }
case 191: break;
case 103:
{ return t(Constant.CODE); }
case 192: break;
case 104:
{ return t(Constant.LEFT); }
case 193: break;
case 105:
{ return t(Constant.DROP); }
case 194: break;
case 114:
{ return t(Constant.SCAN); }
case 195: break;
case 115:
{ return t(Constant.WITH); }
case 196: break;
case 125:
{ return t(Constant.RIGHT); }
case 197: break;
case 169:
{ return t(Constant.NONTERMINAL); }
case 198: break;
case 168:
{ return t(Constant.PRECEDENCE); }
case 199: break;
case 167:
{ return t(Constant.IMPLEMENTS); }
case 200: break;
case 31:
{ return t(Constant.BAR); }
case 201: break;
case 26:
{ return t(Constant.DOT); }
case 202: break;
case 49:
{ return t(Constant.TO); }
case 203: break;
case 74:
{ return t(Constant.NON); }
case 204: break;
case 36:
{
error("Illegal character in string literal: " + yytext());
}
case 205: break;
case 72:
{
yybegin(YYINITIAL);
String codeStr = yytext();
// cut off ":}" from the end of the code string
return t(Constant.CODE_STR, codeStr.substring(0, codeStr.length()-2));
}
case 206: break;
case 161:
{ return t(Constant.OVERRIDE); }
case 207: break;
case 159:
{ return t(Constant.TRANSFER); }
case 208: break;
case 158:
{ return t(Constant.TERMINAL); }
case 209: break;
case 157:
{ return t(Constant.NONASSOC); }
case 210: break;
case 4:
case 7:
case 32:
{
error("Invalid character: " + yytext());
}
case 211: break;
case 67:
{ yybegin (YYINITIAL); }
case 212: break;
case 33:
case 35:
{
error("Illegal comment");
}
case 213: break;
case 38:
{
error("Illegal escape character");
}
case 214: break;
case 73:
{ return t(Constant.COLON_COLON_EQUALS); }
case 215: break;
case 2:
case 37:
{
error("Unclosed string literal");
}
case 216: break;
case 40:
case 42:
{
error("Invalid character in code block: '" + yytext() + "'");
}
case 217: break;
case 13:
{ yybegin(STRING); }
case 218: break;
case 44:
{ yybegin (COMMENT); }
case 219: break;
case 6:
{ }
case 220: break;
case 43:
{ }
case 221: break;
default:
if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
yy_atEOF = true;
{ return t(Constant.EOF, "EOF");
//return Constant.EOF;
}
}
else {
yy_ScanError(YY_NO_MATCH);
}
}
}
}
}