001: /* The following code was generated by JFlex 1.3.5 on 13-9-06 0:53 */
002:
003: package vqwiki.lex;
004:
005: /*
006: Very Quick Wiki - WikiWikiWeb clone
007: Copyright (C) 2001 Gareth Cronin
008:
009: This program is free software; you can redistribute it and/or modify
010: it under the terms of the GNU General Public License as published by
011: the Free Software Foundation; either version 2 of the License, or
012: (at your option) any later version.
013:
014: This program is distributed in the hope that it will be useful,
015: but WITHOUT ANY WARRANTY; without even the implied warranty of
016: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
017: GNU General Public License for more details.
018:
019: You should have received a copy of the GNU General Public License
020: along with this program (gpl.txt); if not, write to the Free Software
021: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
022: */
023:
024: import vqwiki.*;
025:
026: /**
027: * This class is a scanner generated by
028: * <a href="http://www.jflex.de/">JFlex</a> 1.3.5
029: * on 13-9-06 0:53 from the specification file
030: * <tt>file:/C:/SourceForge/VQWiki_2X/vqwiki-classic/jlex/SearchLexer</tt>
031: */
032: public class SearchLexer {
033:
034: /** This character denotes the end of file */
035: final public static int YYEOF = -1;
036:
037: /** initial size of the lookahead buffer */
038: final private static int YY_BUFFERSIZE = 16384;
039:
040: /** lexical states */
041: final public static int YYINITIAL = 0;
042: final public static int NORMAL = 1;
043:
044: /**
045: * Translates characters to character classes
046: */
047: final private static String yycmap_packed = "\11\2\1\1\1\4\2\0\1\1\16\2\4\0\1\1\3\0\1\2"
048: + "\13\0\12\2\1\0\1\0\1\3\1\0\1\5\2\0\32\2\4\0"
049: + "\1\2\1\0\3\2\2\2\1\2\1\2\1\2\2\2\1\2\1\2"
050: + "\5\2\1\2\1\2\1\2\6\2\4\0\41\2\2\0\4\2\4\0"
051: + "\1\2\12\0\1\2\4\0\1\2\5\0\27\2\1\0\37\2\1\0"
052: + "\u0128\2\2\0\22\2\34\0\136\2\2\0\11\2\2\0\7\2\16\0"
053: + "\2\2\16\0\5\2\11\0\1\2\21\0\117\2\21\0\3\2\27\0"
054: + "\1\2\13\0\1\2\1\0\3\2\1\0\1\2\1\0\24\2\1\0"
055: + "\54\2\1\0\10\2\2\0\32\2\14\0\202\2\1\0\4\2\5\0"
056: + "\71\2\2\0\2\2\2\0\2\2\3\0\46\2\2\0\2\2\67\0"
057: + "\46\2\2\0\1\2\7\0\47\2\11\0\21\2\1\0\27\2\1\0"
058: + "\3\2\1\0\1\2\1\0\2\2\1\0\1\2\13\0\33\2\5\0"
059: + "\3\2\56\0\32\2\5\0\26\2\12\0\12\2\6\0\144\2\1\0"
060: + "\10\2\2\0\12\2\1\0\4\2\2\0\15\2\22\0\36\2\3\0"
061: + "\33\2\65\0\61\2\u0150\0\3\2\1\0\65\2\2\0\22\2\2\0"
062: + "\5\2\3\0\14\2\2\0\12\2\21\0\3\2\1\0\10\2\2\0"
063: + "\2\2\2\0\26\2\1\0\7\2\1\0\1\2\3\0\4\2\2\0"
064: + "\1\2\1\0\7\2\2\0\2\2\2\0\3\2\11\0\1\2\4\0"
065: + "\2\2\1\0\5\2\2\0\16\2\16\0\1\2\2\0\6\2\4\0"
066: + "\2\2\2\0\26\2\1\0\7\2\1\0\2\2\1\0\2\2\1\0"
067: + "\2\2\2\0\1\2\1\0\5\2\4\0\2\2\2\0\3\2\13\0"
068: + "\4\2\1\0\1\2\7\0\17\2\14\0\3\2\1\0\7\2\1\0"
069: + "\1\2\1\0\3\2\1\0\26\2\1\0\7\2\1\0\2\2\1\0"
070: + "\5\2\2\0\12\2\1\0\3\2\1\0\3\2\2\0\1\2\17\0"
071: + "\1\2\5\0\12\2\21\0\3\2\1\0\10\2\2\0\2\2\2\0"
072: + "\26\2\1\0\7\2\1\0\2\2\2\0\4\2\2\0\10\2\3\0"
073: + "\2\2\2\0\3\2\10\0\2\2\4\0\2\2\1\0\3\2\4\0"
074: + "\12\2\22\0\2\2\1\0\6\2\3\0\3\2\1\0\4\2\3\0"
075: + "\2\2\1\0\1\2\1\0\2\2\3\0\2\2\3\0\3\2\3\0"
076: + "\10\2\1\0\3\2\4\0\5\2\3\0\3\2\1\0\4\2\11\0"
077: + "\1\2\17\0\11\2\21\0\3\2\1\0\10\2\1\0\3\2\1\0"
078: + "\27\2\1\0\12\2\1\0\5\2\4\0\7\2\1\0\3\2\1\0"
079: + "\4\2\7\0\2\2\11\0\2\2\4\0\12\2\22\0\2\2\1\0"
080: + "\10\2\1\0\3\2\1\0\27\2\1\0\12\2\1\0\5\2\4\0"
081: + "\7\2\1\0\3\2\1\0\4\2\7\0\2\2\7\0\1\2\1\0"
082: + "\2\2\4\0\12\2\22\0\2\2\1\0\10\2\1\0\3\2\1\0"
083: + "\27\2\1\0\20\2\4\0\6\2\2\0\3\2\1\0\4\2\11\0"
084: + "\1\2\10\0\2\2\4\0\12\2\22\0\2\2\1\0\22\2\3\0"
085: + "\30\2\1\0\11\2\1\0\1\2\2\0\7\2\3\0\1\2\4\0"
086: + "\6\2\1\0\1\2\1\0\10\2\22\0\2\2\15\0\72\2\4\0"
087: + "\20\2\1\0\12\2\47\0\2\2\1\0\1\2\2\0\2\2\1\0"
088: + "\1\2\2\0\1\2\6\0\4\2\1\0\7\2\1\0\3\2\1\0"
089: + "\1\2\1\0\1\2\2\0\2\2\1\0\15\2\1\0\3\2\2\0"
090: + "\5\2\1\0\1\2\1\0\6\2\2\0\12\2\2\0\2\2\42\0"
091: + "\1\2\27\0\2\2\6\0\12\2\13\0\1\2\1\0\1\2\1\0"
092: + "\1\2\4\0\12\2\1\0\42\2\6\0\24\2\1\0\6\2\4\0"
093: + "\10\2\1\0\44\2\11\0\1\2\71\0\42\2\1\0\5\2\1\0"
094: + "\2\2\1\0\7\2\3\0\4\2\6\0\12\2\6\0\12\2\106\0"
095: + "\46\2\12\0\47\2\11\0\132\2\5\0\104\2\5\0\122\2\6\0"
096: + "\7\2\1\0\77\2\1\0\1\2\1\0\4\2\2\0\7\2\1\0"
097: + "\1\2\1\0\4\2\2\0\47\2\1\0\1\2\1\0\4\2\2\0"
098: + "\37\2\1\0\1\2\1\0\4\2\2\0\7\2\1\0\1\2\1\0"
099: + "\4\2\2\0\7\2\1\0\7\2\1\0\27\2\1\0\37\2\1\0"
100: + "\1\2\1\0\4\2\2\0\7\2\1\0\47\2\1\0\23\2\16\0"
101: + "\11\2\56\0\125\2\14\0\u026c\2\2\0\10\2\12\0\32\2\5\0"
102: + "\113\2\225\0\124\2\7\0\1\2\4\0\12\2\41\0\4\2\1\0"
103: + "\12\2\6\0\130\2\10\0\52\2\u0556\0\234\2\4\0\132\2\6\0"
104: + "\26\2\2\0\6\2\2\0\46\2\2\0\6\2\2\0\10\2\1\0"
105: + "\1\2\1\0\1\2\1\0\1\2\1\0\37\2\2\0\65\2\1\0"
106: + "\7\2\1\0\1\2\3\0\3\2\1\0\7\2\3\0\4\2\2\0"
107: + "\6\2\4\0\15\2\5\0\3\2\1\0\7\2\17\0\4\2\32\0"
108: + "\5\2\20\0\2\2\51\0\6\2\17\0\1\2\40\0\20\2\40\0"
109: + "\15\2\4\0\1\2\40\0\1\2\4\0\1\2\2\0\12\2\1\0"
110: + "\1\2\3\0\5\2\6\0\1\2\1\0\1\2\1\0\1\2\1\0"
111: + "\4\2\1\0\3\2\1\0\7\2\46\0\44\2\u0e81\0\3\2\31\0"
112: + "\17\2\1\0\5\2\2\0\3\2\6\0\124\2\4\0\2\2\2\0"
113: + "\2\2\2\0\136\2\6\0\50\2\4\0\136\2\21\0\30\2\u0248\0"
114: + "\u19b6\2\112\0\u51a6\2\132\0\u048d\2\u0773\0\u2ba4\2\u215c\0\u012e\2\322\0"
115: + "\7\2\14\0\5\2\5\0\14\2\1\0\15\2\1\0\5\2\1\0"
116: + "\1\2\1\0\2\2\1\0\2\2\1\0\154\2\41\0\u016b\2\22\0"
117: + "\100\2\2\0\66\2\50\0\14\2\44\0\4\2\17\0\2\2\30\0"
118: + "\3\2\31\0\1\2\6\0\3\2\1\0\1\2\1\0\207\2\2\0"
119: + "\1\2\4\0\1\2\13\0\12\2\7\0\32\2\4\0\1\2\1\0"
120: + "\32\2\12\0\132\2\3\0\6\2\2\0\6\2\2\0\6\2\2\0"
121: + "\3\2\3\0\2\2\3\0\2\2\22\0\3\2\4\0";
122:
123: /**
124: * Translates characters to character classes
125: */
126: final private static char[] yycmap = yy_unpack_cmap(yycmap_packed);
127:
128: /**
129: * Translates a state to a row index in the transition table
130: */
131: final private static int yy_rowMap[] = { 0, 6, 0, 12, 18, 24, 30,
132: 30 };
133:
134: /**
135: * The packed transition table of the DFA (part 0)
136: */
137: final private static String yy_packed0 = "\6\0\1\3\1\4\1\5\1\6\1\4\1\3\1\0"
138: + "\1\4\2\0\1\4\3\0\1\5\3\0\4\7\1\0" + "\5\7\1\0\1\10";
139:
140: /**
141: * The transition table of the DFA
142: */
143: final private static int yytrans[] = yy_unpack();
144:
145: /* error codes */
146: final private static int YY_UNKNOWN_ERROR = 0;
147: final private static int YY_ILLEGAL_STATE = 1;
148: final private static int YY_NO_MATCH = 2;
149: final private static int YY_PUSHBACK_2BIG = 3;
150:
151: /* error messages for the codes above */
152: final private static String YY_ERROR_MSG[] = {
153: "Unkown internal scanner error",
154: "Internal error: unknown state",
155: "Error: could not match input",
156: "Error: pushback value was too large" };
157:
158: /**
159: * YY_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
160: */
161: private final static byte YY_ATTRIBUTE[] = { 8, 0, 9, 1, 1, 1, 0, 1 };
162:
163: /** the input device */
164: private java.io.Reader yy_reader;
165:
166: /** the current state of the DFA */
167: private int yy_state;
168:
169: /** the current lexical state */
170: private int yy_lexical_state = YYINITIAL;
171:
172: /** this buffer contains the current text to be matched and is
173: the source of the yytext() string */
174: private char yy_buffer[] = new char[YY_BUFFERSIZE];
175:
176: /** the textposition at the last accepting state */
177: private int yy_markedPos;
178:
179: /** the textposition at the last state to be included in yytext */
180: private int yy_pushbackPos;
181:
182: /** the current text position in the buffer */
183: private int yy_currentPos;
184:
185: /** startRead marks the beginning of the yytext() string in the buffer */
186: private int yy_startRead;
187:
188: /** endRead marks the last character in the buffer, that has been read
189: from input */
190: private int yy_endRead;
191:
192: /** number of newlines encountered up to the start of the matched text */
193: private int yyline;
194:
195: /** the number of characters up to the start of the matched text */
196: private int yychar;
197:
198: /**
199: * the number of characters from the last newline up to the start of the
200: * matched text
201: */
202: private int yycolumn;
203:
204: /**
205: * yy_atBOL == true <=> the scanner is currently at the beginning of a line
206: */
207: private boolean yy_atBOL = true;
208:
209: /** yy_atEOF == true <=> the scanner is at the EOF */
210: private boolean yy_atEOF;
211:
212: /**
213: * Creates a new scanner
214: * There is also a java.io.InputStream version of this constructor.
215: *
216: * @param in the java.io.Reader to read input from.
217: */
218: public SearchLexer(java.io.Reader in) {
219: yybegin(NORMAL);
220: this .yy_reader = in;
221: }
222:
223: /**
224: * Creates a new scanner.
225: * There is also java.io.Reader version of this constructor.
226: *
227: * @param in the java.io.Inputstream to read input from.
228: */
229: public SearchLexer(java.io.InputStream in) {
230: this (new java.io.InputStreamReader(in));
231: }
232:
233: /**
234: * Unpacks the split, compressed DFA transition table.
235: *
236: * @return the unpacked transition table
237: */
238: private static int[] yy_unpack() {
239: int[] trans = new int[36];
240: int offset = 0;
241: offset = yy_unpack(yy_packed0, offset, trans);
242: return trans;
243: }
244:
245: /**
246: * Unpacks the compressed DFA transition table.
247: *
248: * @param packed the packed transition table
249: * @return the index of the last entry
250: */
251: private static int yy_unpack(String packed, int offset, int[] trans) {
252: int i = 0; /* index in packed string */
253: int j = offset; /* index in unpacked array */
254: int l = packed.length();
255: while (i < l) {
256: int count = packed.charAt(i++);
257: int value = packed.charAt(i++);
258: value--;
259: do
260: trans[j++] = value;
261: while (--count > 0);
262: }
263: return j;
264: }
265:
266: /**
267: * Unpacks the compressed character translation table.
268: *
269: * @param packed the packed character translation table
270: * @return the unpacked character translation table
271: */
272: private static char[] yy_unpack_cmap(String packed) {
273: char[] map = new char[0x10000];
274: int i = 0; /* index in packed string */
275: int j = 0; /* index in unpacked array */
276: while (i < 1496) {
277: int count = packed.charAt(i++);
278: char value = packed.charAt(i++);
279: do
280: map[j++] = value;
281: while (--count > 0);
282: }
283: return map;
284: }
285:
286: /**
287: * Refills the input buffer.
288: *
289: * @return <code>false</code>, iff there was new input.
290: *
291: * @exception IOException if any I/O-Error occurs
292: */
293: private boolean yy_refill() throws java.io.IOException {
294:
295: /* first: make room (if you can) */
296: if (yy_startRead > 0) {
297: System.arraycopy(yy_buffer, yy_startRead, yy_buffer, 0,
298: yy_endRead - yy_startRead);
299:
300: /* translate stored positions */
301: yy_endRead -= yy_startRead;
302: yy_currentPos -= yy_startRead;
303: yy_markedPos -= yy_startRead;
304: yy_pushbackPos -= yy_startRead;
305: yy_startRead = 0;
306: }
307:
308: /* is the buffer big enough? */
309: if (yy_currentPos >= yy_buffer.length) {
310: /* if not: blow it up */
311: char newBuffer[] = new char[yy_currentPos * 2];
312: System.arraycopy(yy_buffer, 0, newBuffer, 0,
313: yy_buffer.length);
314: yy_buffer = newBuffer;
315: }
316:
317: /* finally: fill the buffer with new input */
318: int numRead = yy_reader.read(yy_buffer, yy_endRead,
319: yy_buffer.length - yy_endRead);
320:
321: if (numRead < 0) {
322: return true;
323: } else {
324: yy_endRead += numRead;
325: return false;
326: }
327: }
328:
329: /**
330: * Closes the input stream.
331: */
332: final public void yyclose() throws java.io.IOException {
333: yy_atEOF = true; /* indicate end of file */
334: yy_endRead = yy_startRead; /* invalidate buffer */
335:
336: if (yy_reader != null)
337: yy_reader.close();
338: }
339:
340: /**
341: * Closes the current stream, and resets the
342: * scanner to read from a new input stream.
343: *
344: * All internal variables are reset, the old input stream
345: * <b>cannot</b> be reused (internal buffer is discarded and lost).
346: * Lexical state is set to <tt>YY_INITIAL</tt>.
347: *
348: * @param reader the new input stream
349: */
350: final public void yyreset(java.io.Reader reader)
351: throws java.io.IOException {
352: yyclose();
353: yy_reader = reader;
354: yy_atBOL = true;
355: yy_atEOF = false;
356: yy_endRead = yy_startRead = 0;
357: yy_currentPos = yy_markedPos = yy_pushbackPos = 0;
358: yyline = yychar = yycolumn = 0;
359: yy_lexical_state = YYINITIAL;
360: }
361:
362: /**
363: * Returns the current lexical state.
364: */
365: final public int yystate() {
366: return yy_lexical_state;
367: }
368:
369: /**
370: * Enters a new lexical state
371: *
372: * @param newState the new lexical state
373: */
374: final public void yybegin(int newState) {
375: yy_lexical_state = newState;
376: }
377:
378: /**
379: * Returns the text matched by the current regular expression.
380: */
381: final public String yytext() {
382: return new String(yy_buffer, yy_startRead, yy_markedPos
383: - yy_startRead);
384: }
385:
386: /**
387: * Returns the character at position <tt>pos</tt> from the
388: * matched text.
389: *
390: * It is equivalent to yytext().charAt(pos), but faster
391: *
392: * @param pos the position of the character to fetch.
393: * A value from 0 to yylength()-1.
394: *
395: * @return the character at position pos
396: */
397: final public char yycharat(int pos) {
398: return yy_buffer[yy_startRead + pos];
399: }
400:
401: /**
402: * Returns the length of the matched text region.
403: */
404: final public int yylength() {
405: return yy_markedPos - yy_startRead;
406: }
407:
408: /**
409: * Reports an error that occured while scanning.
410: *
411: * In a wellformed scanner (no or only correct usage of
412: * yypushback(int) and a match-all fallback rule) this method
413: * will only be called with things that "Can't Possibly Happen".
414: * If this method is called, something is seriously wrong
415: * (e.g. a JFlex bug producing a faulty scanner etc.).
416: *
417: * Usual syntax/scanner level error handling should be done
418: * in error fallback rules.
419: *
420: * @param errorCode the code of the errormessage to display
421: */
422: private void yy_ScanError(int errorCode) {
423: String message;
424: try {
425: message = YY_ERROR_MSG[errorCode];
426: } catch (ArrayIndexOutOfBoundsException e) {
427: message = YY_ERROR_MSG[YY_UNKNOWN_ERROR];
428: }
429:
430: throw new Error(message);
431: }
432:
433: /**
434: * Pushes the specified amount of characters back into the input stream.
435: *
436: * They will be read again by then next call of the scanning method
437: *
438: * @param number the number of characters to be read again.
439: * This number must not be greater than yylength()!
440: */
441: private void yypushback(int number) {
442: if (number > yylength())
443: yy_ScanError(YY_PUSHBACK_2BIG);
444:
445: yy_markedPos -= number;
446: }
447:
448: /**
449: * Resumes scanning until the next regular expression is matched,
450: * the end of input is encountered or an I/O-Error occurs.
451: *
452: * @return the next token
453: * @exception IOException if any I/O-Error occurs
454: */
455: public String yylex() throws java.io.IOException {
456: int yy_input;
457: int yy_action;
458:
459: // cached fields:
460: int yy_currentPos_l;
461: int yy_startRead_l;
462: int yy_markedPos_l;
463: int yy_endRead_l = yy_endRead;
464: char[] yy_buffer_l = yy_buffer;
465: char[] yycmap_l = yycmap;
466:
467: int[] yytrans_l = yytrans;
468: int[] yy_rowMap_l = yy_rowMap;
469: byte[] yy_attr_l = YY_ATTRIBUTE;
470:
471: while (true) {
472: yy_markedPos_l = yy_markedPos;
473:
474: yy_action = -1;
475:
476: yy_startRead_l = yy_currentPos_l = yy_currentPos = yy_startRead = yy_markedPos_l;
477:
478: yy_state = yy_lexical_state;
479:
480: yy_forAction: {
481: while (true) {
482:
483: if (yy_currentPos_l < yy_endRead_l)
484: yy_input = yy_buffer_l[yy_currentPos_l++];
485: else if (yy_atEOF) {
486: yy_input = YYEOF;
487: break yy_forAction;
488: } else {
489: // store back cached positions
490: yy_currentPos = yy_currentPos_l;
491: yy_markedPos = yy_markedPos_l;
492: boolean eof = yy_refill();
493: // get translated positions and possibly new buffer
494: yy_currentPos_l = yy_currentPos;
495: yy_markedPos_l = yy_markedPos;
496: yy_buffer_l = yy_buffer;
497: yy_endRead_l = yy_endRead;
498: if (eof) {
499: yy_input = YYEOF;
500: break yy_forAction;
501: } else {
502: yy_input = yy_buffer_l[yy_currentPos_l++];
503: }
504: }
505: int yy_next = yytrans_l[yy_rowMap_l[yy_state]
506: + yycmap_l[yy_input]];
507: if (yy_next == -1)
508: break yy_forAction;
509: yy_state = yy_next;
510:
511: int yy_attributes = yy_attr_l[yy_state];
512: if ((yy_attributes & 1) == 1) {
513: yy_action = yy_state;
514: yy_markedPos_l = yy_currentPos_l;
515: if ((yy_attributes & 8) == 8)
516: break yy_forAction;
517: }
518:
519: }
520: }
521:
522: // store back cached position
523: yy_markedPos = yy_markedPos_l;
524:
525: switch (yy_action) {
526:
527: case 3: {
528:
529: }
530: case 9:
531: break;
532: case 2:
533: case 5: {
534:
535: }
536: case 10:
537: break;
538: case 4: {
539: return yytext();
540: }
541: case 11:
542: break;
543: case 7: {
544:
545: }
546: case 12:
547: break;
548: default:
549: if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
550: yy_atEOF = true;
551: {
552: return null;
553: }
554: } else {
555: yy_ScanError(YY_NO_MATCH);
556: }
557: }
558: }
559: }
560:
561: }
|