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