pylucene 3.5.0-3
[pylucene.git] / lucene-java-3.5.0 / lucene / src / java / org / apache / lucene / analysis / standard / ClassicTokenizerImpl.java
1 /* The following code was generated by JFlex 1.5.0-SNAPSHOT on 9/30/11 1:23 PM */
2
3 package org.apache.lucene.analysis.standard;
4
5 /**
6  * Licensed to the Apache Software Foundation (ASF) under one or more
7  * contributor license agreements.  See the NOTICE file distributed with
8  * this work for additional information regarding copyright ownership.
9  * The ASF licenses this file to You under the Apache License, Version 2.0
10  * (the "License"); you may not use this file except in compliance with
11  * the License.  You may obtain a copy of the License at
12  *
13  *     http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21
22 /*
23
24 WARNING: if you change ClassicTokenizerImpl.jflex and need to regenerate
25       the tokenizer, only use the trunk version of JFlex 1.5 at the moment!
26
27 */
28
29 import java.io.Reader;
30 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
31
32
33 /**
34  * This class is a scanner generated by 
35  * <a href="http://www.jflex.de/">JFlex</a> 1.5.0-SNAPSHOT
36  * on 9/30/11 1:23 PM from the specification file
37  * <tt>/lucene/3x/lucene/src/java/org/apache/lucene/analysis/standard/ClassicTokenizerImpl.jflex</tt>
38  */
39 class ClassicTokenizerImpl implements StandardTokenizerInterface {
40
41   /** This character denotes the end of file */
42   public static final int YYEOF = -1;
43
44   /** initial size of the lookahead buffer */
45   private static final int ZZ_BUFFERSIZE = 16384;
46
47   /** lexical states */
48   public static final int YYINITIAL = 0;
49
50   /**
51    * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
52    * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l
53    *                  at the beginning of a line
54    * l is of the form l = 2*k, k a non negative integer
55    */
56   private static final int ZZ_LEXSTATE[] = { 
57      0, 0
58   };
59
60   /** 
61    * Translates characters to character classes
62    */
63   private static final String ZZ_CMAP_PACKED = 
64     "\11\0\1\0\1\15\1\0\1\0\1\14\22\0\1\0\5\0\1\5"+
65     "\1\3\4\0\1\11\1\7\1\4\1\11\12\2\6\0\1\6\32\12"+
66     "\4\0\1\10\1\0\32\12\57\0\1\12\12\0\1\12\4\0\1\12"+
67     "\5\0\27\12\1\0\37\12\1\0\u0128\12\2\0\22\12\34\0\136\12"+
68     "\2\0\11\12\2\0\7\12\16\0\2\12\16\0\5\12\11\0\1\12"+
69     "\213\0\1\12\13\0\1\12\1\0\3\12\1\0\1\12\1\0\24\12"+
70     "\1\0\54\12\1\0\10\12\2\0\32\12\14\0\202\12\12\0\71\12"+
71     "\2\0\2\12\2\0\2\12\3\0\46\12\2\0\2\12\67\0\46\12"+
72     "\2\0\1\12\7\0\47\12\110\0\33\12\5\0\3\12\56\0\32\12"+
73     "\5\0\13\12\25\0\12\2\7\0\143\12\1\0\1\12\17\0\2\12"+
74     "\11\0\12\2\3\12\23\0\1\12\1\0\33\12\123\0\46\12\u015f\0"+
75     "\65\12\3\0\1\12\22\0\1\12\7\0\12\12\4\0\12\2\25\0"+
76     "\10\12\2\0\2\12\2\0\26\12\1\0\7\12\1\0\1\12\3\0"+
77     "\4\12\42\0\2\12\1\0\3\12\4\0\12\2\2\12\23\0\6\12"+
78     "\4\0\2\12\2\0\26\12\1\0\7\12\1\0\2\12\1\0\2\12"+
79     "\1\0\2\12\37\0\4\12\1\0\1\12\7\0\12\2\2\0\3\12"+
80     "\20\0\7\12\1\0\1\12\1\0\3\12\1\0\26\12\1\0\7\12"+
81     "\1\0\2\12\1\0\5\12\3\0\1\12\22\0\1\12\17\0\1\12"+
82     "\5\0\12\2\25\0\10\12\2\0\2\12\2\0\26\12\1\0\7\12"+
83     "\1\0\2\12\2\0\4\12\3\0\1\12\36\0\2\12\1\0\3\12"+
84     "\4\0\12\2\25\0\6\12\3\0\3\12\1\0\4\12\3\0\2\12"+
85     "\1\0\1\12\1\0\2\12\3\0\2\12\3\0\3\12\3\0\10\12"+
86     "\1\0\3\12\55\0\11\2\25\0\10\12\1\0\3\12\1\0\27\12"+
87     "\1\0\12\12\1\0\5\12\46\0\2\12\4\0\12\2\25\0\10\12"+
88     "\1\0\3\12\1\0\27\12\1\0\12\12\1\0\5\12\44\0\1\12"+
89     "\1\0\2\12\4\0\12\2\25\0\10\12\1\0\3\12\1\0\27\12"+
90     "\1\0\20\12\46\0\2\12\4\0\12\2\25\0\22\12\3\0\30\12"+
91     "\1\0\11\12\1\0\1\12\2\0\7\12\71\0\1\1\60\12\1\1"+
92     "\2\12\14\1\7\12\11\1\12\2\47\0\2\12\1\0\1\12\2\0"+
93     "\2\12\1\0\1\12\2\0\1\12\6\0\4\12\1\0\7\12\1\0"+
94     "\3\12\1\0\1\12\1\0\1\12\2\0\2\12\1\0\4\12\1\0"+
95     "\2\12\11\0\1\12\2\0\5\12\1\0\1\12\11\0\12\2\2\0"+
96     "\2\12\42\0\1\12\37\0\12\2\26\0\10\12\1\0\42\12\35\0"+
97     "\4\12\164\0\42\12\1\0\5\12\1\0\2\12\25\0\12\2\6\0"+
98     "\6\12\112\0\46\12\12\0\47\12\11\0\132\12\5\0\104\12\5\0"+
99     "\122\12\6\0\7\12\1\0\77\12\1\0\1\12\1\0\4\12\2\0"+
100     "\7\12\1\0\1\12\1\0\4\12\2\0\47\12\1\0\1\12\1\0"+
101     "\4\12\2\0\37\12\1\0\1\12\1\0\4\12\2\0\7\12\1\0"+
102     "\1\12\1\0\4\12\2\0\7\12\1\0\7\12\1\0\27\12\1\0"+
103     "\37\12\1\0\1\12\1\0\4\12\2\0\7\12\1\0\47\12\1\0"+
104     "\23\12\16\0\11\2\56\0\125\12\14\0\u026c\12\2\0\10\12\12\0"+
105     "\32\12\5\0\113\12\225\0\64\12\54\0\12\2\46\0\12\2\6\0"+
106     "\130\12\10\0\51\12\u0557\0\234\12\4\0\132\12\6\0\26\12\2\0"+
107     "\6\12\2\0\46\12\2\0\6\12\2\0\10\12\1\0\1\12\1\0"+
108     "\1\12\1\0\1\12\1\0\37\12\2\0\65\12\1\0\7\12\1\0"+
109     "\1\12\3\0\3\12\1\0\7\12\3\0\4\12\2\0\6\12\4\0"+
110     "\15\12\5\0\3\12\1\0\7\12\202\0\1\12\202\0\1\12\4\0"+
111     "\1\12\2\0\12\12\1\0\1\12\3\0\5\12\6\0\1\12\1\0"+
112     "\1\12\1\0\1\12\1\0\4\12\1\0\3\12\1\0\7\12\u0ecb\0"+
113     "\2\12\52\0\5\12\12\0\1\13\124\13\10\13\2\13\2\13\132\13"+
114     "\1\13\3\13\6\13\50\13\3\13\1\0\136\12\21\0\30\12\70\0"+
115     "\20\13\u0100\0\200\13\200\0\u19b6\13\12\13\100\0\u51a6\13\132\13\u048d\12"+
116     "\u0773\0\u2ba4\12\u215c\0\u012e\13\322\13\7\12\14\0\5\12\5\0\1\12"+
117     "\1\0\12\12\1\0\15\12\1\0\5\12\1\0\1\12\1\0\2\12"+
118     "\1\0\2\12\1\0\154\12\41\0\u016b\12\22\0\100\12\2\0\66\12"+
119     "\50\0\14\12\164\0\3\12\1\0\1\12\1\0\207\12\23\0\12\2"+
120     "\7\0\32\12\6\0\32\12\12\0\1\13\72\13\37\12\3\0\6\12"+
121     "\2\0\6\12\2\0\6\12\2\0\3\12\43\0";
122
123   /** 
124    * Translates characters to character classes
125    */
126   private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
127
128   /** 
129    * Translates DFA states to action switch labels.
130    */
131   private static final int [] ZZ_ACTION = zzUnpackAction();
132
133   private static final String ZZ_ACTION_PACKED_0 =
134     "\1\0\1\1\3\2\1\3\1\1\13\0\1\2\3\4"+
135     "\2\0\1\5\1\0\1\5\3\4\6\5\1\6\1\4"+
136     "\2\7\1\10\1\0\1\10\3\0\2\10\1\11\1\12"+
137     "\1\4";
138
139   private static int [] zzUnpackAction() {
140     int [] result = new int[51];
141     int offset = 0;
142     offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
143     return result;
144   }
145
146   private static int zzUnpackAction(String packed, int offset, int [] result) {
147     int i = 0;       /* index in packed string  */
148     int j = offset;  /* index in unpacked array */
149     int l = packed.length();
150     while (i < l) {
151       int count = packed.charAt(i++);
152       int value = packed.charAt(i++);
153       do result[j++] = value; while (--count > 0);
154     }
155     return j;
156   }
157
158
159   /** 
160    * Translates a state to a row index in the transition table
161    */
162   private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
163
164   private static final String ZZ_ROWMAP_PACKED_0 =
165     "\0\0\0\16\0\34\0\52\0\70\0\16\0\106\0\124"+
166     "\0\142\0\160\0\176\0\214\0\232\0\250\0\266\0\304"+
167     "\0\322\0\340\0\356\0\374\0\u010a\0\u0118\0\u0126\0\u0134"+
168     "\0\u0142\0\u0150\0\u015e\0\u016c\0\u017a\0\u0188\0\u0196\0\u01a4"+
169     "\0\u01b2\0\u01c0\0\u01ce\0\u01dc\0\u01ea\0\u01f8\0\322\0\u0206"+
170     "\0\u0214\0\u0222\0\u0230\0\u023e\0\u024c\0\u025a\0\124\0\214"+
171     "\0\u0268\0\u0276\0\u0284";
172
173   private static int [] zzUnpackRowMap() {
174     int [] result = new int[51];
175     int offset = 0;
176     offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
177     return result;
178   }
179
180   private static int zzUnpackRowMap(String packed, int offset, int [] result) {
181     int i = 0;  /* index in packed string  */
182     int j = offset;  /* index in unpacked array */
183     int l = packed.length();
184     while (i < l) {
185       int high = packed.charAt(i++) << 16;
186       result[j++] = high | packed.charAt(i++);
187     }
188     return j;
189   }
190
191   /** 
192    * The transition table of the DFA
193    */
194   private static final int [] ZZ_TRANS = zzUnpackTrans();
195
196   private static final String ZZ_TRANS_PACKED_0 =
197     "\1\2\1\3\1\4\7\2\1\5\1\6\1\7\1\2"+
198     "\17\0\2\3\1\0\1\10\1\0\1\11\2\12\1\13"+
199     "\1\3\4\0\1\3\1\4\1\0\1\14\1\0\1\11"+
200     "\2\15\1\16\1\4\4\0\1\3\1\4\1\17\1\20"+
201     "\1\21\1\22\2\12\1\13\1\23\20\0\1\2\1\0"+
202     "\1\24\1\25\7\0\1\26\4\0\2\27\7\0\1\27"+
203     "\4\0\1\30\1\31\7\0\1\32\5\0\1\33\7\0"+
204     "\1\13\4\0\1\34\1\35\7\0\1\36\4\0\1\37"+
205     "\1\40\7\0\1\41\4\0\1\42\1\43\7\0\1\44"+
206     "\15\0\1\45\4\0\1\24\1\25\7\0\1\46\15\0"+
207     "\1\47\4\0\2\27\7\0\1\50\4\0\1\3\1\4"+
208     "\1\17\1\10\1\21\1\22\2\12\1\13\1\23\4\0"+
209     "\2\24\1\0\1\51\1\0\1\11\2\52\1\0\1\24"+
210     "\4\0\1\24\1\25\1\0\1\53\1\0\1\11\2\54"+
211     "\1\55\1\25\4\0\1\24\1\25\1\0\1\51\1\0"+
212     "\1\11\2\52\1\0\1\26\4\0\2\27\1\0\1\56"+
213     "\2\0\1\56\2\0\1\27\4\0\2\30\1\0\1\52"+
214     "\1\0\1\11\2\52\1\0\1\30\4\0\1\30\1\31"+
215     "\1\0\1\54\1\0\1\11\2\54\1\55\1\31\4\0"+
216     "\1\30\1\31\1\0\1\52\1\0\1\11\2\52\1\0"+
217     "\1\32\5\0\1\33\1\0\1\55\2\0\3\55\1\33"+
218     "\4\0\2\34\1\0\1\57\1\0\1\11\2\12\1\13"+
219     "\1\34\4\0\1\34\1\35\1\0\1\60\1\0\1\11"+
220     "\2\15\1\16\1\35\4\0\1\34\1\35\1\0\1\57"+
221     "\1\0\1\11\2\12\1\13\1\36\4\0\2\37\1\0"+
222     "\1\12\1\0\1\11\2\12\1\13\1\37\4\0\1\37"+
223     "\1\40\1\0\1\15\1\0\1\11\2\15\1\16\1\40"+
224     "\4\0\1\37\1\40\1\0\1\12\1\0\1\11\2\12"+
225     "\1\13\1\41\4\0\2\42\1\0\1\13\2\0\3\13"+
226     "\1\42\4\0\1\42\1\43\1\0\1\16\2\0\3\16"+
227     "\1\43\4\0\1\42\1\43\1\0\1\13\2\0\3\13"+
228     "\1\44\6\0\1\17\6\0\1\45\4\0\1\24\1\25"+
229     "\1\0\1\61\1\0\1\11\2\52\1\0\1\26\4\0"+
230     "\2\27\1\0\1\56\2\0\1\56\2\0\1\50\4\0"+
231     "\2\24\7\0\1\24\4\0\2\30\7\0\1\30\4\0"+
232     "\2\34\7\0\1\34\4\0\2\37\7\0\1\37\4\0"+
233     "\2\42\7\0\1\42\4\0\2\62\7\0\1\62\4\0"+
234     "\2\24\7\0\1\63\4\0\2\62\1\0\1\56\2\0"+
235     "\1\56\2\0\1\62\4\0\2\24\1\0\1\61\1\0"+
236     "\1\11\2\52\1\0\1\24\3\0";
237
238   private static int [] zzUnpackTrans() {
239     int [] result = new int[658];
240     int offset = 0;
241     offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
242     return result;
243   }
244
245   private static int zzUnpackTrans(String packed, int offset, int [] result) {
246     int i = 0;       /* index in packed string  */
247     int j = offset;  /* index in unpacked array */
248     int l = packed.length();
249     while (i < l) {
250       int count = packed.charAt(i++);
251       int value = packed.charAt(i++);
252       value--;
253       do result[j++] = value; while (--count > 0);
254     }
255     return j;
256   }
257
258
259   /* error codes */
260   private static final int ZZ_UNKNOWN_ERROR = 0;
261   private static final int ZZ_NO_MATCH = 1;
262   private static final int ZZ_PUSHBACK_2BIG = 2;
263
264   /* error messages for the codes above */
265   private static final String ZZ_ERROR_MSG[] = {
266     "Unkown internal scanner error",
267     "Error: could not match input",
268     "Error: pushback value was too large"
269   };
270
271   /**
272    * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
273    */
274   private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
275
276   private static final String ZZ_ATTRIBUTE_PACKED_0 =
277     "\1\0\1\11\3\1\1\11\1\1\13\0\4\1\2\0"+
278     "\1\1\1\0\17\1\1\0\1\1\3\0\5\1";
279
280   private static int [] zzUnpackAttribute() {
281     int [] result = new int[51];
282     int offset = 0;
283     offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
284     return result;
285   }
286
287   private static int zzUnpackAttribute(String packed, int offset, int [] result) {
288     int i = 0;       /* index in packed string  */
289     int j = offset;  /* index in unpacked array */
290     int l = packed.length();
291     while (i < l) {
292       int count = packed.charAt(i++);
293       int value = packed.charAt(i++);
294       do result[j++] = value; while (--count > 0);
295     }
296     return j;
297   }
298
299   /** the input device */
300   private java.io.Reader zzReader;
301
302   /** the current state of the DFA */
303   private int zzState;
304
305   /** the current lexical state */
306   private int zzLexicalState = YYINITIAL;
307
308   /** this buffer contains the current text to be matched and is
309       the source of the yytext() string */
310   private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
311
312   /** the textposition at the last accepting state */
313   private int zzMarkedPos;
314
315   /** the current text position in the buffer */
316   private int zzCurrentPos;
317
318   /** startRead marks the beginning of the yytext() string in the buffer */
319   private int zzStartRead;
320
321   /** endRead marks the last character in the buffer, that has been read
322       from input */
323   private int zzEndRead;
324
325   /** number of newlines encountered up to the start of the matched text */
326   private int yyline;
327
328   /** the number of characters up to the start of the matched text */
329   private int yychar;
330
331   /**
332    * the number of characters from the last newline up to the start of the 
333    * matched text
334    */
335   private int yycolumn;
336
337   /** 
338    * zzAtBOL == true <=> the scanner is currently at the beginning of a line
339    */
340   private boolean zzAtBOL = true;
341
342   /** zzAtEOF == true <=> the scanner is at the EOF */
343   private boolean zzAtEOF;
344
345   /** denotes if the user-EOF-code has already been executed */
346   private boolean zzEOFDone;
347
348   /* user code: */
349
350 public static final int ALPHANUM          = StandardTokenizer.ALPHANUM;
351 public static final int APOSTROPHE        = StandardTokenizer.APOSTROPHE;
352 public static final int ACRONYM           = StandardTokenizer.ACRONYM;
353 public static final int COMPANY           = StandardTokenizer.COMPANY;
354 public static final int EMAIL             = StandardTokenizer.EMAIL;
355 public static final int HOST              = StandardTokenizer.HOST;
356 public static final int NUM               = StandardTokenizer.NUM;
357 public static final int CJ                = StandardTokenizer.CJ;
358 /**
359  * @deprecated this solves a bug where HOSTs that end with '.' are identified
360  *             as ACRONYMs.
361  */
362 @Deprecated
363 public static final int ACRONYM_DEP       = StandardTokenizer.ACRONYM_DEP;
364
365 public static final String [] TOKEN_TYPES = StandardTokenizer.TOKEN_TYPES;
366
367 public final int yychar()
368 {
369     return yychar;
370 }
371
372 /**
373  * Fills CharTermAttribute with the current token text.
374  */
375 public final void getText(CharTermAttribute t) {
376   t.copyBuffer(zzBuffer, zzStartRead, zzMarkedPos-zzStartRead);
377 }
378
379
380
381   /**
382    * Creates a new scanner
383    * There is also a java.io.InputStream version of this constructor.
384    *
385    * @param   in  the java.io.Reader to read input from.
386    */
387   ClassicTokenizerImpl(java.io.Reader in) {
388     this.zzReader = in;
389   }
390
391   /**
392    * Creates a new scanner.
393    * There is also java.io.Reader version of this constructor.
394    *
395    * @param   in  the java.io.Inputstream to read input from.
396    */
397   ClassicTokenizerImpl(java.io.InputStream in) {
398     this(new java.io.InputStreamReader(in));
399   }
400
401   /** 
402    * Unpacks the compressed character translation table.
403    *
404    * @param packed   the packed character translation table
405    * @return         the unpacked character translation table
406    */
407   private static char [] zzUnpackCMap(String packed) {
408     char [] map = new char[0x10000];
409     int i = 0;  /* index in packed string  */
410     int j = 0;  /* index in unpacked array */
411     while (i < 1154) {
412       int  count = packed.charAt(i++);
413       char value = packed.charAt(i++);
414       do map[j++] = value; while (--count > 0);
415     }
416     return map;
417   }
418
419
420   /**
421    * Refills the input buffer.
422    *
423    * @return      <code>false</code>, iff there was new input.
424    * 
425    * @exception   java.io.IOException  if any I/O-Error occurs
426    */
427   private boolean zzRefill() throws java.io.IOException {
428
429     /* first: make room (if you can) */
430     if (zzStartRead > 0) {
431       System.arraycopy(zzBuffer, zzStartRead,
432                        zzBuffer, 0,
433                        zzEndRead-zzStartRead);
434
435       /* translate stored positions */
436       zzEndRead-= zzStartRead;
437       zzCurrentPos-= zzStartRead;
438       zzMarkedPos-= zzStartRead;
439       zzStartRead = 0;
440     }
441
442     /* is the buffer big enough? */
443     if (zzCurrentPos >= zzBuffer.length) {
444       /* if not: blow it up */
445       char newBuffer[] = new char[zzCurrentPos*2];
446       System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
447       zzBuffer = newBuffer;
448     }
449
450     /* finally: fill the buffer with new input */
451     int numRead = zzReader.read(zzBuffer, zzEndRead,
452                                             zzBuffer.length-zzEndRead);
453
454     if (numRead > 0) {
455       zzEndRead+= numRead;
456       return false;
457     }
458     // unlikely but not impossible: read 0 characters, but not at end of stream    
459     if (numRead == 0) {
460       int c = zzReader.read();
461       if (c == -1) {
462         return true;
463       } else {
464         zzBuffer[zzEndRead++] = (char) c;
465         return false;
466       }     
467     }
468
469         // numRead < 0
470     return true;
471   }
472
473     
474   /**
475    * Closes the input stream.
476    */
477   public final void yyclose() throws java.io.IOException {
478     zzAtEOF = true;            /* indicate end of file */
479     zzEndRead = zzStartRead;  /* invalidate buffer    */
480
481     if (zzReader != null)
482       zzReader.close();
483   }
484
485
486   /**
487    * Resets the scanner to read from a new input stream.
488    * Does not close the old reader.
489    *
490    * All internal variables are reset, the old input stream 
491    * <b>cannot</b> be reused (internal buffer is discarded and lost).
492    * Lexical state is set to <tt>ZZ_INITIAL</tt>.
493    *
494    * Internal scan buffer is resized down to its initial length, if it has grown.
495    *
496    * @param reader   the new input stream 
497    */
498   public final void yyreset(java.io.Reader reader) {
499     zzReader = reader;
500     zzAtBOL  = true;
501     zzAtEOF  = false;
502     zzEOFDone = false;
503     zzEndRead = zzStartRead = 0;
504     zzCurrentPos = zzMarkedPos = 0;
505     yyline = yychar = yycolumn = 0;
506     zzLexicalState = YYINITIAL;
507     if (zzBuffer.length > ZZ_BUFFERSIZE)
508       zzBuffer = new char[ZZ_BUFFERSIZE];
509   }
510
511
512   /**
513    * Returns the current lexical state.
514    */
515   public final int yystate() {
516     return zzLexicalState;
517   }
518
519
520   /**
521    * Enters a new lexical state
522    *
523    * @param newState the new lexical state
524    */
525   public final void yybegin(int newState) {
526     zzLexicalState = newState;
527   }
528
529
530   /**
531    * Returns the text matched by the current regular expression.
532    */
533   public final String yytext() {
534     return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
535   }
536
537
538   /**
539    * Returns the character at position <tt>pos</tt> from the 
540    * matched text. 
541    * 
542    * It is equivalent to yytext().charAt(pos), but faster
543    *
544    * @param pos the position of the character to fetch. 
545    *            A value from 0 to yylength()-1.
546    *
547    * @return the character at position pos
548    */
549   public final char yycharat(int pos) {
550     return zzBuffer[zzStartRead+pos];
551   }
552
553
554   /**
555    * Returns the length of the matched text region.
556    */
557   public final int yylength() {
558     return zzMarkedPos-zzStartRead;
559   }
560
561
562   /**
563    * Reports an error that occured while scanning.
564    *
565    * In a wellformed scanner (no or only correct usage of 
566    * yypushback(int) and a match-all fallback rule) this method 
567    * will only be called with things that "Can't Possibly Happen".
568    * If this method is called, something is seriously wrong
569    * (e.g. a JFlex bug producing a faulty scanner etc.).
570    *
571    * Usual syntax/scanner level error handling should be done
572    * in error fallback rules.
573    *
574    * @param   errorCode  the code of the errormessage to display
575    */
576   private void zzScanError(int errorCode) {
577     String message;
578     try {
579       message = ZZ_ERROR_MSG[errorCode];
580     }
581     catch (ArrayIndexOutOfBoundsException e) {
582       message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
583     }
584
585     throw new Error(message);
586   } 
587
588
589   /**
590    * Pushes the specified amount of characters back into the input stream.
591    *
592    * They will be read again by then next call of the scanning method
593    *
594    * @param number  the number of characters to be read again.
595    *                This number must not be greater than yylength()!
596    */
597   public void yypushback(int number)  {
598     if ( number > yylength() )
599       zzScanError(ZZ_PUSHBACK_2BIG);
600
601     zzMarkedPos -= number;
602   }
603
604
605   /**
606    * Resumes scanning until the next regular expression is matched,
607    * the end of input is encountered or an I/O-Error occurs.
608    *
609    * @return      the next token
610    * @exception   java.io.IOException  if any I/O-Error occurs
611    */
612   public int getNextToken() throws java.io.IOException {
613     int zzInput;
614     int zzAction;
615
616     // cached fields:
617     int zzCurrentPosL;
618     int zzMarkedPosL;
619     int zzEndReadL = zzEndRead;
620     char [] zzBufferL = zzBuffer;
621     char [] zzCMapL = ZZ_CMAP;
622
623     int [] zzTransL = ZZ_TRANS;
624     int [] zzRowMapL = ZZ_ROWMAP;
625     int [] zzAttrL = ZZ_ATTRIBUTE;
626
627     while (true) {
628       zzMarkedPosL = zzMarkedPos;
629
630       yychar+= zzMarkedPosL-zzStartRead;
631
632       zzAction = -1;
633
634       zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
635   
636       zzState = ZZ_LEXSTATE[zzLexicalState];
637
638       // set up zzAction for empty match case:
639       int zzAttributes = zzAttrL[zzState];
640       if ( (zzAttributes & 1) == 1 ) {
641         zzAction = zzState;
642       }
643
644
645       zzForAction: {
646         while (true) {
647     
648           if (zzCurrentPosL < zzEndReadL)
649             zzInput = zzBufferL[zzCurrentPosL++];
650           else if (zzAtEOF) {
651             zzInput = YYEOF;
652             break zzForAction;
653           }
654           else {
655             // store back cached positions
656             zzCurrentPos  = zzCurrentPosL;
657             zzMarkedPos   = zzMarkedPosL;
658             boolean eof = zzRefill();
659             // get translated positions and possibly new buffer
660             zzCurrentPosL  = zzCurrentPos;
661             zzMarkedPosL   = zzMarkedPos;
662             zzBufferL      = zzBuffer;
663             zzEndReadL     = zzEndRead;
664             if (eof) {
665               zzInput = YYEOF;
666               break zzForAction;
667             }
668             else {
669               zzInput = zzBufferL[zzCurrentPosL++];
670             }
671           }
672           int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
673           if (zzNext == -1) break zzForAction;
674           zzState = zzNext;
675
676           zzAttributes = zzAttrL[zzState];
677           if ( (zzAttributes & 1) == 1 ) {
678             zzAction = zzState;
679             zzMarkedPosL = zzCurrentPosL;
680             if ( (zzAttributes & 8) == 8 ) break zzForAction;
681           }
682
683         }
684       }
685
686       // store back cached position
687       zzMarkedPos = zzMarkedPosL;
688
689       switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
690         case 10: 
691           { return EMAIL;
692           }
693         case 11: break;
694         case 2: 
695           { return ALPHANUM;
696           }
697         case 12: break;
698         case 4: 
699           { return HOST;
700           }
701         case 13: break;
702         case 8: 
703           { return ACRONYM_DEP;
704           }
705         case 14: break;
706         case 5: 
707           { return NUM;
708           }
709         case 15: break;
710         case 1: 
711           { /* Break so we don't hit fall-through warning: */ break;/* ignore */
712           }
713         case 16: break;
714         case 9: 
715           { return ACRONYM;
716           }
717         case 17: break;
718         case 7: 
719           { return COMPANY;
720           }
721         case 18: break;
722         case 6: 
723           { return APOSTROPHE;
724           }
725         case 19: break;
726         case 3: 
727           { return CJ;
728           }
729         case 20: break;
730         default: 
731           if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
732             zzAtEOF = true;
733             return YYEOF;
734           } 
735           else {
736             zzScanError(ZZ_NO_MATCH);
737           }
738       }
739     }
740   }
741
742
743 }