c527efb9a6e83ed24e688d36c0aa535aea1b1bd4
[iot2.git] / iotjava / iotparser / Lexer.java
1 package iotparser;
2
3 /* The following code was generated by JFlex 1.6.1 */
4
5 // JFlex parser specification written by
6 // Rahmadi Trimananda
7 // for Sentinel system
8 // University of California, Irvine
9
10 // Technische Universitaet Muenchen 
11 // Fakultaet fuer Informatik 
12
13 import java_cup.runtime.Symbol;
14 import java_cup.runtime.ComplexSymbolFactory;
15 import java_cup.runtime.ComplexSymbolFactory.Location;
16
17
18 /**
19  * This class is a scanner generated by 
20  * <a href="http://www.jflex.de/">JFlex</a> 1.6.1
21  * from the specification file <tt>iotparser.jflex</tt>
22  */
23 public class Lexer implements java_cup.runtime.Scanner, sym {
24
25   /** This character denotes the end of file */
26   public static final int YYEOF = -1;
27
28   /** initial size of the lookahead buffer */
29   private static final int ZZ_BUFFERSIZE = 16384;
30
31   /** lexical states */
32   public static final int YYINITIAL = 0;
33   public static final int STRING = 2;
34
35   /**
36    * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
37    * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l
38    *                  at the beginning of a line
39    * l is of the form l = 2*k, k a non negative integer
40    */
41   private static final int ZZ_LEXSTATE[] = { 
42      0,  0,  1, 1
43   };
44
45   /** 
46    * Translates characters to character classes
47    */
48   private static final String ZZ_CMAP_PACKED = 
49     "\11\0\1\6\1\4\1\46\1\6\1\3\22\0\1\6\1\0\1\35"+
50     "\1\0\1\1\3\0\1\40\1\41\2\0\1\36\1\0\1\37\1\0"+
51     "\12\2\1\0\1\5\1\0\1\44\3\0\32\1\1\0\1\45\2\0"+
52     "\1\1\1\0\1\24\1\16\1\27\1\25\1\20\1\23\1\22\1\13"+
53     "\1\7\2\1\1\21\1\32\1\10\1\14\1\31\1\33\1\15\1\12"+
54     "\1\11\1\26\1\30\1\34\1\1\1\17\1\1\1\42\1\0\1\43"+
55     "\7\0\1\46\u1fa2\0\1\46\1\46\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\udfe6\0";
56
57   /** 
58    * Translates characters to character classes
59    */
60   private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
61
62   /** 
63    * Translates DFA states to action switch labels.
64    */
65   private static final int [] ZZ_ACTION = zzUnpackAction();
66
67   private static final String ZZ_ACTION_PACKED_0 =
68     "\2\0\1\1\1\2\2\3\1\4\15\2\1\5\1\6"+
69     "\1\7\1\10\1\11\1\12\1\13\1\14\1\15\1\16"+
70     "\1\17\1\0\10\2\1\20\10\2\1\21\1\22\1\23"+
71     "\1\24\1\25\24\2\1\26\1\27\3\2\1\30\1\2"+
72     "\1\31\2\2\1\32\2\2\1\33\2\2\1\34\6\2"+
73     "\1\35\2\2\1\36\2\2\1\37\1\40\2\2\1\41"+
74     "\3\2\1\42\2\2\1\43\3\2\1\44\1\45";
75
76   private static int [] zzUnpackAction() {
77     int [] result = new int[120];
78     int offset = 0;
79     offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
80     return result;
81   }
82
83   private static int zzUnpackAction(String packed, int offset, int [] result) {
84     int i = 0;       /* index in packed string  */
85     int j = offset;  /* index in unpacked array */
86     int l = packed.length();
87     while (i < l) {
88       int count = packed.charAt(i++);
89       int value = packed.charAt(i++);
90       do result[j++] = value; while (--count > 0);
91     }
92     return j;
93   }
94
95
96   /** 
97    * Translates a state to a row index in the transition table
98    */
99   private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
100
101   private static final String ZZ_ROWMAP_PACKED_0 =
102     "\0\0\0\47\0\116\0\165\0\234\0\116\0\116\0\303"+
103     "\0\352\0\u0111\0\u0138\0\u015f\0\u0186\0\u01ad\0\u01d4\0\u01fb"+
104     "\0\u0222\0\u0249\0\u0270\0\u0297\0\116\0\116\0\116\0\116"+
105     "\0\116\0\116\0\116\0\116\0\u02be\0\116\0\u02e5\0\u030c"+
106     "\0\u0333\0\u035a\0\u0381\0\u03a8\0\u03cf\0\u03f6\0\u041d\0\u0444"+
107     "\0\165\0\u046b\0\u0492\0\u04b9\0\u04e0\0\u0507\0\u052e\0\u0555"+
108     "\0\u057c\0\116\0\116\0\116\0\116\0\u05a3\0\u05ca\0\u05f1"+
109     "\0\u0618\0\u063f\0\u0666\0\u068d\0\u06b4\0\u06db\0\u0702\0\u0729"+
110     "\0\u0750\0\u0777\0\u079e\0\u07c5\0\u07ec\0\u0813\0\u083a\0\u0861"+
111     "\0\u0888\0\u08af\0\165\0\165\0\u08d6\0\u08fd\0\u0924\0\165"+
112     "\0\u094b\0\165\0\u0972\0\u0999\0\165\0\u09c0\0\u09e7\0\165"+
113     "\0\u0a0e\0\u0a35\0\165\0\u0a5c\0\u0a83\0\u0aaa\0\u0ad1\0\u0af8"+
114     "\0\u0b1f\0\165\0\u0b46\0\u0b6d\0\165\0\u0b94\0\u0bbb\0\165"+
115     "\0\165\0\u0be2\0\u0c09\0\165\0\u0c30\0\u0c57\0\u0c7e\0\165"+
116     "\0\u0ca5\0\u0ccc\0\165\0\u0cf3\0\u0d1a\0\u0d41\0\165\0\165";
117
118   private static int [] zzUnpackRowMap() {
119     int [] result = new int[120];
120     int offset = 0;
121     offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
122     return result;
123   }
124
125   private static int zzUnpackRowMap(String packed, int offset, int [] result) {
126     int i = 0;  /* index in packed string  */
127     int j = offset;  /* index in unpacked array */
128     int l = packed.length();
129     while (i < l) {
130       int high = packed.charAt(i++) << 16;
131       result[j++] = high | packed.charAt(i++);
132     }
133     return j;
134   }
135
136   /** 
137    * The transition table of the DFA
138    */
139   private static final int [] ZZ_TRANS = zzUnpackTrans();
140
141   private static final String ZZ_TRANS_PACKED_0 =
142     "\1\3\1\4\1\3\1\5\1\6\1\7\1\6\1\10"+
143     "\2\4\1\11\2\4\1\12\1\13\2\4\1\14\1\4"+
144     "\1\15\1\16\1\17\1\4\1\20\1\21\1\22\1\23"+
145     "\1\4\1\24\1\25\1\26\1\27\1\30\1\31\1\32"+
146     "\1\33\1\34\1\3\1\0\3\35\1\0\1\3\30\35"+
147     "\1\36\7\35\1\37\1\35\50\0\2\4\4\0\26\4"+
148     "\16\0\1\40\43\0\2\4\4\0\1\4\1\41\24\4"+
149     "\13\0\2\4\4\0\2\4\1\42\1\4\1\43\21\4"+
150     "\13\0\2\4\4\0\11\4\1\44\14\4\13\0\2\4"+
151     "\4\0\5\4\1\45\2\4\1\46\15\4\13\0\2\4"+
152     "\4\0\5\4\1\47\20\4\13\0\2\4\4\0\12\4"+
153     "\1\50\13\4\13\0\2\4\4\0\3\4\1\51\22\4"+
154     "\13\0\2\4\4\0\5\4\1\52\3\4\1\53\14\4"+
155     "\13\0\2\4\4\0\4\4\1\54\10\4\1\55\10\4"+
156     "\13\0\2\4\4\0\5\4\1\56\20\4\13\0\2\4"+
157     "\4\0\17\4\1\57\6\4\13\0\2\4\4\0\11\4"+
158     "\1\60\14\4\13\0\2\4\4\0\1\61\25\4\12\0"+
159     "\3\35\2\0\30\35\1\0\7\35\1\0\1\35\10\0"+
160     "\1\62\1\63\3\0\1\64\17\0\1\65\16\0\1\6"+
161     "\42\0\2\4\4\0\2\4\1\66\23\4\13\0\2\4"+
162     "\4\0\6\4\1\67\17\4\13\0\2\4\4\0\5\4"+
163     "\1\70\20\4\13\0\2\4\4\0\24\4\1\71\1\4"+
164     "\13\0\2\4\4\0\5\4\1\72\20\4\13\0\2\4"+
165     "\4\0\2\4\1\73\23\4\13\0\2\4\4\0\1\4"+
166     "\1\74\24\4\13\0\2\4\4\0\5\4\1\75\20\4"+
167     "\13\0\2\4\4\0\17\4\1\76\6\4\13\0\2\4"+
168     "\4\0\3\4\1\77\22\4\13\0\2\4\4\0\15\4"+
169     "\1\100\10\4\13\0\2\4\4\0\22\4\1\101\3\4"+
170     "\13\0\2\4\4\0\1\102\25\4\13\0\2\4\4\0"+
171     "\7\4\1\103\16\4\13\0\2\4\4\0\2\4\1\104"+
172     "\23\4\13\0\2\4\4\0\2\4\1\105\23\4\13\0"+
173     "\2\4\4\0\11\4\1\106\14\4\13\0\2\4\4\0"+
174     "\1\107\25\4\13\0\2\4\4\0\6\4\1\110\17\4"+
175     "\13\0\2\4\4\0\17\4\1\111\6\4\13\0\2\4"+
176     "\4\0\12\4\1\112\13\4\13\0\2\4\4\0\11\4"+
177     "\1\113\14\4\13\0\2\4\4\0\13\4\1\114\12\4"+
178     "\13\0\2\4\4\0\15\4\1\115\10\4\13\0\2\4"+
179     "\4\0\7\4\1\116\16\4\13\0\2\4\4\0\20\4"+
180     "\1\117\5\4\13\0\2\4\4\0\6\4\1\120\17\4"+
181     "\13\0\2\4\4\0\15\4\1\121\10\4\13\0\2\4"+
182     "\4\0\16\4\1\122\7\4\13\0\2\4\4\0\12\4"+
183     "\1\123\13\4\13\0\2\4\4\0\4\4\1\124\21\4"+
184     "\13\0\2\4\4\0\4\4\1\125\21\4\13\0\2\4"+
185     "\4\0\6\4\1\126\17\4\13\0\2\4\4\0\1\4"+
186     "\1\127\24\4\13\0\2\4\4\0\2\4\1\130\23\4"+
187     "\13\0\2\4\4\0\1\131\25\4\13\0\2\4\4\0"+
188     "\11\4\1\132\14\4\13\0\2\4\4\0\2\4\1\133"+
189     "\23\4\13\0\2\4\4\0\12\4\1\134\13\4\13\0"+
190     "\2\4\4\0\6\4\1\135\17\4\13\0\2\4\4\0"+
191     "\7\4\1\136\16\4\13\0\2\4\4\0\1\137\25\4"+
192     "\13\0\2\4\4\0\5\4\1\140\20\4\13\0\2\4"+
193     "\4\0\14\4\1\141\11\4\13\0\2\4\4\0\13\4"+
194     "\1\142\12\4\13\0\2\4\4\0\6\4\1\143\17\4"+
195     "\13\0\2\4\4\0\15\4\1\144\10\4\13\0\2\4"+
196     "\4\0\11\4\1\145\14\4\13\0\2\4\4\0\1\146"+
197     "\25\4\13\0\2\4\4\0\1\147\25\4\13\0\2\4"+
198     "\4\0\20\4\1\150\5\4\13\0\2\4\4\0\16\4"+
199     "\1\151\7\4\13\0\2\4\4\0\15\4\1\152\10\4"+
200     "\13\0\2\4\4\0\11\4\1\153\14\4\13\0\2\4"+
201     "\4\0\1\4\1\154\24\4\13\0\2\4\4\0\22\4"+
202     "\1\155\3\4\13\0\2\4\4\0\12\4\1\156\13\4"+
203     "\13\0\2\4\4\0\20\4\1\157\5\4\13\0\2\4"+
204     "\4\0\3\4\1\160\22\4\13\0\2\4\4\0\2\4"+
205     "\1\161\23\4\13\0\2\4\4\0\1\162\25\4\13\0"+
206     "\2\4\4\0\11\4\1\163\14\4\13\0\2\4\4\0"+
207     "\1\164\25\4\13\0\2\4\4\0\2\4\1\165\23\4"+
208     "\13\0\2\4\4\0\5\4\1\166\20\4\13\0\2\4"+
209     "\4\0\10\4\1\167\15\4\13\0\2\4\4\0\1\4"+
210     "\1\170\24\4\12\0";
211
212   private static int [] zzUnpackTrans() {
213     int [] result = new int[3432];
214     int offset = 0;
215     offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
216     return result;
217   }
218
219   private static int zzUnpackTrans(String packed, int offset, int [] result) {
220     int i = 0;       /* index in packed string  */
221     int j = offset;  /* index in unpacked array */
222     int l = packed.length();
223     while (i < l) {
224       int count = packed.charAt(i++);
225       int value = packed.charAt(i++);
226       value--;
227       do result[j++] = value; while (--count > 0);
228     }
229     return j;
230   }
231
232
233   /* error codes */
234   private static final int ZZ_UNKNOWN_ERROR = 0;
235   private static final int ZZ_NO_MATCH = 1;
236   private static final int ZZ_PUSHBACK_2BIG = 2;
237
238   /* error messages for the codes above */
239   private static final String ZZ_ERROR_MSG[] = {
240     "Unknown internal scanner error",
241     "Error: could not match input",
242     "Error: pushback value was too large"
243   };
244
245   /**
246    * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
247    */
248   private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
249
250   private static final String ZZ_ATTRIBUTE_PACKED_0 =
251     "\2\0\1\11\2\1\2\11\15\1\10\11\1\1\1\11"+
252     "\1\1\1\0\21\1\4\11\103\1";
253
254   private static int [] zzUnpackAttribute() {
255     int [] result = new int[120];
256     int offset = 0;
257     offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
258     return result;
259   }
260
261   private static int zzUnpackAttribute(String packed, int offset, int [] result) {
262     int i = 0;       /* index in packed string  */
263     int j = offset;  /* index in unpacked array */
264     int l = packed.length();
265     while (i < l) {
266       int count = packed.charAt(i++);
267       int value = packed.charAt(i++);
268       do result[j++] = value; while (--count > 0);
269     }
270     return j;
271   }
272
273   /** the input device */
274   private java.io.Reader zzReader;
275
276   /** the current state of the DFA */
277   private int zzState;
278
279   /** the current lexical state */
280   private int zzLexicalState = YYINITIAL;
281
282   /** this buffer contains the current text to be matched and is
283       the source of the yytext() string */
284   private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
285
286   /** the textposition at the last accepting state */
287   private int zzMarkedPos;
288
289   /** the current text position in the buffer */
290   private int zzCurrentPos;
291
292   /** startRead marks the beginning of the yytext() string in the buffer */
293   private int zzStartRead;
294
295   /** endRead marks the last character in the buffer, that has been read
296       from input */
297   private int zzEndRead;
298
299   /** number of newlines encountered up to the start of the matched text */
300   private int yyline;
301
302   /** the number of characters up to the start of the matched text */
303   private int yychar;
304
305   /**
306    * the number of characters from the last newline up to the start of the 
307    * matched text
308    */
309   private int yycolumn;
310
311   /** 
312    * zzAtBOL == true <=> the scanner is currently at the beginning of a line
313    */
314   private boolean zzAtBOL = true;
315
316   /** zzAtEOF == true <=> the scanner is at the EOF */
317   private boolean zzAtEOF;
318
319   /** denotes if the user-EOF-code has already been executed */
320   private boolean zzEOFDone;
321   
322   /** 
323    * The number of occupied positions in zzBuffer beyond zzEndRead.
324    * When a lead/high surrogate has been read from the input stream
325    * into the final zzBuffer position, this will have a value of 1;
326    * otherwise, it will have a value of 0.
327    */
328   private int zzFinalHighSurrogate = 0;
329
330   /* user code: */
331     StringBuffer string = new StringBuffer();
332     public Lexer(java.io.Reader in, ComplexSymbolFactory sf){
333         this(in);
334         symbolFactory = sf;
335     }
336     ComplexSymbolFactory symbolFactory;
337
338   private Symbol symbol(String name, int sym) {
339       return symbolFactory.newSymbol(name, sym, new Location(yyline+1,yycolumn+1,yychar), new Location(yyline+1,yycolumn+yylength(),yychar+yylength()));
340   }
341   
342   private Symbol symbol(String name, int sym, Object val) {
343       Location left = new Location(yyline+1,yycolumn+1,yychar);
344       Location right= new Location(yyline+1,yycolumn+yylength(), yychar+yylength());
345       return symbolFactory.newSymbol(name, sym, left, right,val);
346   } 
347   private Symbol symbol(String name, int sym, Object val,int buflength) {
348       Location left = new Location(yyline+1,yycolumn+yylength()-buflength,yychar+yylength()-buflength);
349       Location right= new Location(yyline+1,yycolumn+yylength(), yychar+yylength());
350       return symbolFactory.newSymbol(name, sym, left, right,val);
351   }       
352   private void error(String message) {
353     System.out.println("Error at line "+(yyline+1)+", column "+(yycolumn+1)+" : "+message);
354   }
355
356
357   /**
358    * Creates a new scanner
359    *
360    * @param   in  the java.io.Reader to read input from.
361    */
362   public Lexer(java.io.Reader in) {
363     this.zzReader = in;
364   }
365
366
367   /** 
368    * Unpacks the compressed character translation table.
369    *
370    * @param packed   the packed character translation table
371    * @return         the unpacked character translation table
372    */
373   private static char [] zzUnpackCMap(String packed) {
374     char [] map = new char[0x110000];
375     int i = 0;  /* index in packed string  */
376     int j = 0;  /* index in unpacked array */
377     while (i < 164) {
378       int  count = packed.charAt(i++);
379       char value = packed.charAt(i++);
380       do map[j++] = value; while (--count > 0);
381     }
382     return map;
383   }
384
385
386   /**
387    * Refills the input buffer.
388    *
389    * @return      <code>false</code>, iff there was new input.
390    * 
391    * @exception   java.io.IOException  if any I/O-Error occurs
392    */
393   private boolean zzRefill() throws java.io.IOException {
394
395     /* first: make room (if you can) */
396     if (zzStartRead > 0) {
397       zzEndRead += zzFinalHighSurrogate;
398       zzFinalHighSurrogate = 0;
399       System.arraycopy(zzBuffer, zzStartRead,
400                        zzBuffer, 0,
401                        zzEndRead-zzStartRead);
402
403       /* translate stored positions */
404       zzEndRead-= zzStartRead;
405       zzCurrentPos-= zzStartRead;
406       zzMarkedPos-= zzStartRead;
407       zzStartRead = 0;
408     }
409
410     /* is the buffer big enough? */
411     if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate) {
412       /* if not: blow it up */
413       char newBuffer[] = new char[zzBuffer.length*2];
414       System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
415       zzBuffer = newBuffer;
416       zzEndRead += zzFinalHighSurrogate;
417       zzFinalHighSurrogate = 0;
418     }
419
420     /* fill the buffer with new input */
421     int requested = zzBuffer.length - zzEndRead;
422     int numRead = zzReader.read(zzBuffer, zzEndRead, requested);
423
424     /* not supposed to occur according to specification of java.io.Reader */
425     if (numRead == 0) {
426       throw new java.io.IOException("Reader returned 0 characters. See JFlex examples for workaround.");
427     }
428     if (numRead > 0) {
429       zzEndRead += numRead;
430       /* If numRead == requested, we might have requested to few chars to
431          encode a full Unicode character. We assume that a Reader would
432          otherwise never return half characters. */
433       if (numRead == requested) {
434         if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) {
435           --zzEndRead;
436           zzFinalHighSurrogate = 1;
437         }
438       }
439       /* potentially more input available */
440       return false;
441     }
442
443     /* numRead < 0 ==> end of stream */
444     return true;
445   }
446
447     
448   /**
449    * Closes the input stream.
450    */
451   public final void yyclose() throws java.io.IOException {
452     zzAtEOF = true;            /* indicate end of file */
453     zzEndRead = zzStartRead;  /* invalidate buffer    */
454
455     if (zzReader != null)
456       zzReader.close();
457   }
458
459
460   /**
461    * Resets the scanner to read from a new input stream.
462    * Does not close the old reader.
463    *
464    * All internal variables are reset, the old input stream 
465    * <b>cannot</b> be reused (internal buffer is discarded and lost).
466    * Lexical state is set to <tt>ZZ_INITIAL</tt>.
467    *
468    * Internal scan buffer is resized down to its initial length, if it has grown.
469    *
470    * @param reader   the new input stream 
471    */
472   public final void yyreset(java.io.Reader reader) {
473     zzReader = reader;
474     zzAtBOL  = true;
475     zzAtEOF  = false;
476     zzEOFDone = false;
477     zzEndRead = zzStartRead = 0;
478     zzCurrentPos = zzMarkedPos = 0;
479     zzFinalHighSurrogate = 0;
480     yyline = yychar = yycolumn = 0;
481     zzLexicalState = YYINITIAL;
482     if (zzBuffer.length > ZZ_BUFFERSIZE)
483       zzBuffer = new char[ZZ_BUFFERSIZE];
484   }
485
486
487   /**
488    * Returns the current lexical state.
489    */
490   public final int yystate() {
491     return zzLexicalState;
492   }
493
494
495   /**
496    * Enters a new lexical state
497    *
498    * @param newState the new lexical state
499    */
500   public final void yybegin(int newState) {
501     zzLexicalState = newState;
502   }
503
504
505   /**
506    * Returns the text matched by the current regular expression.
507    */
508   public final String yytext() {
509     return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
510   }
511
512
513   /**
514    * Returns the character at position <tt>pos</tt> from the 
515    * matched text. 
516    * 
517    * It is equivalent to yytext().charAt(pos), but faster
518    *
519    * @param pos the position of the character to fetch. 
520    *            A value from 0 to yylength()-1.
521    *
522    * @return the character at position pos
523    */
524   public final char yycharat(int pos) {
525     return zzBuffer[zzStartRead+pos];
526   }
527
528
529   /**
530    * Returns the length of the matched text region.
531    */
532   public final int yylength() {
533     return zzMarkedPos-zzStartRead;
534   }
535
536
537   /**
538    * Reports an error that occured while scanning.
539    *
540    * In a wellformed scanner (no or only correct usage of 
541    * yypushback(int) and a match-all fallback rule) this method 
542    * will only be called with things that "Can't Possibly Happen".
543    * If this method is called, something is seriously wrong
544    * (e.g. a JFlex bug producing a faulty scanner etc.).
545    *
546    * Usual syntax/scanner level error handling should be done
547    * in error fallback rules.
548    *
549    * @param   errorCode  the code of the errormessage to display
550    */
551   private void zzScanError(int errorCode) {
552     String message;
553     try {
554       message = ZZ_ERROR_MSG[errorCode];
555     }
556     catch (ArrayIndexOutOfBoundsException e) {
557       message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
558     }
559
560     throw new Error(message);
561   } 
562
563
564   /**
565    * Pushes the specified amount of characters back into the input stream.
566    *
567    * They will be read again by then next call of the scanning method
568    *
569    * @param number  the number of characters to be read again.
570    *                This number must not be greater than yylength()!
571    */
572   public void yypushback(int number)  {
573     if ( number > yylength() )
574       zzScanError(ZZ_PUSHBACK_2BIG);
575
576     zzMarkedPos -= number;
577   }
578
579
580   /**
581    * Contains user EOF-code, which will be executed exactly once,
582    * when the end of file is reached
583    */
584   private void zzDoEOF() throws java.io.IOException {
585     if (!zzEOFDone) {
586       zzEOFDone = true;
587       yyclose();
588     }
589   }
590
591
592   /**
593    * Resumes scanning until the next regular expression is matched,
594    * the end of input is encountered or an I/O-Error occurs.
595    *
596    * @return      the next token
597    * @exception   java.io.IOException  if any I/O-Error occurs
598    */
599   public java_cup.runtime.Symbol next_token() throws java.io.IOException {
600     int zzInput;
601     int zzAction;
602
603     // cached fields:
604     int zzCurrentPosL;
605     int zzMarkedPosL;
606     int zzEndReadL = zzEndRead;
607     char [] zzBufferL = zzBuffer;
608     char [] zzCMapL = ZZ_CMAP;
609
610     int [] zzTransL = ZZ_TRANS;
611     int [] zzRowMapL = ZZ_ROWMAP;
612     int [] zzAttrL = ZZ_ATTRIBUTE;
613
614     while (true) {
615       zzMarkedPosL = zzMarkedPos;
616
617       yychar+= zzMarkedPosL-zzStartRead;
618
619       boolean zzR = false;
620       int zzCh;
621       int zzCharCount;
622       for (zzCurrentPosL = zzStartRead  ;
623            zzCurrentPosL < zzMarkedPosL ;
624            zzCurrentPosL += zzCharCount ) {
625         zzCh = Character.codePointAt(zzBufferL, zzCurrentPosL, zzMarkedPosL);
626         zzCharCount = Character.charCount(zzCh);
627         switch (zzCh) {
628         case '\u000B':
629         case '\u000C':
630         case '\u0085':
631         case '\u2028':
632         case '\u2029':
633           yyline++;
634           yycolumn = 0;
635           zzR = false;
636           break;
637         case '\r':
638           yyline++;
639           yycolumn = 0;
640           zzR = true;
641           break;
642         case '\n':
643           if (zzR)
644             zzR = false;
645           else {
646             yyline++;
647             yycolumn = 0;
648           }
649           break;
650         default:
651           zzR = false;
652           yycolumn += zzCharCount;
653         }
654       }
655
656       if (zzR) {
657         // peek one character ahead if it is \n (if we have counted one line too much)
658         boolean zzPeek;
659         if (zzMarkedPosL < zzEndReadL)
660           zzPeek = zzBufferL[zzMarkedPosL] == '\n';
661         else if (zzAtEOF)
662           zzPeek = false;
663         else {
664           boolean eof = zzRefill();
665           zzEndReadL = zzEndRead;
666           zzMarkedPosL = zzMarkedPos;
667           zzBufferL = zzBuffer;
668           if (eof) 
669             zzPeek = false;
670           else 
671             zzPeek = zzBufferL[zzMarkedPosL] == '\n';
672         }
673         if (zzPeek) yyline--;
674       }
675       zzAction = -1;
676
677       zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
678   
679       zzState = ZZ_LEXSTATE[zzLexicalState];
680
681       // set up zzAction for empty match case:
682       int zzAttributes = zzAttrL[zzState];
683       if ( (zzAttributes & 1) == 1 ) {
684         zzAction = zzState;
685       }
686
687
688       zzForAction: {
689         while (true) {
690     
691           if (zzCurrentPosL < zzEndReadL) {
692             zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
693             zzCurrentPosL += Character.charCount(zzInput);
694           }
695           else if (zzAtEOF) {
696             zzInput = YYEOF;
697             break zzForAction;
698           }
699           else {
700             // store back cached positions
701             zzCurrentPos  = zzCurrentPosL;
702             zzMarkedPos   = zzMarkedPosL;
703             boolean eof = zzRefill();
704             // get translated positions and possibly new buffer
705             zzCurrentPosL  = zzCurrentPos;
706             zzMarkedPosL   = zzMarkedPos;
707             zzBufferL      = zzBuffer;
708             zzEndReadL     = zzEndRead;
709             if (eof) {
710               zzInput = YYEOF;
711               break zzForAction;
712             }
713             else {
714               zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
715               zzCurrentPosL += Character.charCount(zzInput);
716             }
717           }
718           int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
719           if (zzNext == -1) break zzForAction;
720           zzState = zzNext;
721
722           zzAttributes = zzAttrL[zzState];
723           if ( (zzAttributes & 1) == 1 ) {
724             zzAction = zzState;
725             zzMarkedPosL = zzCurrentPosL;
726             if ( (zzAttributes & 8) == 8 ) break zzForAction;
727           }
728
729         }
730       }
731
732       // store back cached position
733       zzMarkedPos = zzMarkedPosL;
734
735       if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
736         zzAtEOF = true;
737             zzDoEOF();
738           {      return symbolFactory.newSymbol("EOF", EOF, new Location(yyline+1,yycolumn+1,yychar), new Location(yyline+1,yycolumn+1,yychar+1));
739  }
740       }
741       else {
742         switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
743           case 1: 
744             { /* throw new Error("Illegal character <"+ yytext()+">");*/
745                     error("Illegal character <"+ yytext()+">");
746             }
747           case 38: break;
748           case 2: 
749             { return symbol("Identifier",IDENT, yytext());
750             }
751           case 39: break;
752           case 3: 
753             { /* ignore */
754             }
755           case 40: break;
756           case 4: 
757             { return symbol("semicolon",SEMICOLON);
758             }
759           case 41: break;
760           case 5: 
761             { string.setLength(0); yybegin(STRING);
762             }
763           case 42: break;
764           case 6: 
765             { return symbol("comma",COMMA);
766             }
767           case 43: break;
768           case 7: 
769             { return symbol("dot",DOT);
770             }
771           case 44: break;
772           case 8: 
773             { return symbol("(",LPAR);
774             }
775           case 45: break;
776           case 9: 
777             { return symbol(")",RPAR);
778             }
779           case 46: break;
780           case 10: 
781             { return symbol("{",BEGIN);
782             }
783           case 47: break;
784           case 11: 
785             { return symbol("}",END);
786             }
787           case 48: break;
788           case 12: 
789             { return symbol("=",ASSIGN);
790             }
791           case 49: break;
792           case 13: 
793             { string.append( yytext() );
794             }
795           case 50: break;
796           case 14: 
797             { yybegin(YYINITIAL); 
798       return symbol("StringConst",STRINGCONST,string.toString(),string.length());
799             }
800           case 51: break;
801           case 15: 
802             { string.append('\\');
803             }
804           case 52: break;
805           case 16: 
806             { return symbol("as",AS);
807             }
808           case 53: break;
809           case 17: 
810             { string.append('\n');
811             }
812           case 54: break;
813           case 18: 
814             { string.append('\t');
815             }
816           case 55: break;
817           case 19: 
818             { string.append('\r');
819             }
820           case 56: break;
821           case 20: 
822             { string.append('\"');
823             }
824           case 57: break;
825           case 21: 
826             { return symbol("int",TYPE, "INT" );
827             }
828           case 58: break;
829           case 22: 
830             { return symbol("byte",TYPE, "BYTE" );
831             }
832           case 59: break;
833           case 23: 
834             { return symbol("long",TYPE, "LONG" );
835             }
836           case 60: break;
837           case 24: 
838             { return symbol("char",TYPE, "CHAR" );
839             }
840           case 61: break;
841           case 25: 
842             { return symbol("void",TYPE, "VOID" );
843             }
844           case 62: break;
845           case 26: 
846             { return symbol("with",WITH);
847             }
848           case 63: break;
849           case 27: 
850             { return symbol("short",TYPE, "SHORT" );
851             }
852           case 64: break;
853           case 28: 
854             { return symbol("float",TYPE, "FLOAT" );
855             }
856           case 65: break;
857           case 29: 
858             { return symbol("string",TYPE, "STRING" );
859             }
860           case 66: break;
861           case 30: 
862             { return symbol("double",TYPE, "DOUBLE" );
863             }
864           case 67: break;
865           case 31: 
866             { return symbol("public",PUBLIC);
867             }
868           case 68: break;
869           case 32: 
870             { return symbol("method",METHOD);
871             }
872           case 69: break;
873           case 33: 
874             { return symbol("boolean",TYPE, "BOOL" );
875             }
876           case 70: break;
877           case 34: 
878             { return symbol("requires",REQUIRES);
879             }
880           case 71: break;
881           case 35: 
882             { return symbol("interface",INTERFACE);
883             }
884           case 72: break;
885           case 36: 
886             { return symbol("capability",CAPABILITY);
887             }
888           case 73: break;
889           case 37: 
890             { return symbol("description",DESCRIPTION);
891             }
892           case 74: break;
893           default:
894             zzScanError(ZZ_NO_MATCH);
895         }
896       }
897     }
898   }
899
900
901 }