##### Coverage Report - org.apache.commons.configuration.plist.PropertyListParser

Classes in this File | Line Coverage | Branch Coverage | Complexity
PropertyListParser |
69% | 221/322
70% | 64/92
| 4.733333333333333;4,733
PropertyListParser$1 |
N/A | N/A
N/A | N/A
| 4.733333333333333;4,733
PropertyListParser$JJCalls |
100% | 1/1
N/A | N/A
| 4.733333333333333;4,733
PropertyListParser$LookaheadSuccess |
100% | 1/1
N/A | N/A
| 4.733333333333333;4,733

1 |  |
     /* Generated By:JavaCC: Do not edit this line. PropertyListParser.java */
2 |  |
     package org.apache.commons.configuration.plist;
3 |  |
4 |  |
     import java.util.Date;
5 |  |
     import java.util.List;
6 |  |
     import java.util.ArrayList;
7 |  |
8 |  |
     import org.apache.commons.configuration.HierarchicalConfiguration;
9 |  |
     import org.apache.commons.configuration.HierarchicalConfiguration.Node;
10 |  |
11 |  |
     import org.apache.commons.lang.StringUtils;
12 |  |
     import org.apache.commons.codec.binary.Hex;
13 |  |
14 |  |
     /**
15 |  |
      * JavaCC based parser for the PropertyList format.
16 |  |
      *
17 |  |
      * @author Emmanuel Bourg
18 |  |
      * @version $Revision: 590474 $, $Date: 2007-10-30 22:35:11 +0100 (Di, 30 Okt 2007) $
19 |  |
      */
20 |  |
     class PropertyListParser implements PropertyListParserConstants {
21 |  |
22 |  |
         /**
23 |  |
          * Remove the quotes at the beginning and at the end of the specified String.
24 |  |
          */
25 |  |
         protected String removeQuotes(String s)
26 |  |
         {
27 | 295 |
             if (s == null)
28 |  |
             {
29 | 1 |
                 return null;
30 |  |
             }
31 |  |
32 | 294 |
             if (s.startsWith("\"") && s.endsWith("\"") && s.length() >= 2)
33 |  |
             {
34 | 292 |
                 s = s.substring(1, s.length() - 1);
35 |  |
             }
36 |  |
37 | 294 |
             return s;
38 |  |
         }
39 |  |
40 |  |
         protected String unescapeQuotes(String s)
41 |  |
         {
42 | 292 |
             return StringUtils.replace(s, "\\\"", "\"");
43 |  |
         }
44 |  |
45 |  |
         /**
46 |  |
          * Remove the white spaces and the data delimiters from the specified
47 |  |
          * string and parse it as a byte array.
48 |  |
          */
49 |  |
         protected byte[] filterData(String s) throws ParseException
50 |  |
         {
51 | 73 |
             if (s == null)
52 |  |
             {
53 | 1 |
                 return null;
54 |  |
             }
55 |  |
56 |  |
             // remove the delimiters
57 | 72 |
             if (s.startsWith("<") && s.endsWith(">") && s.length() >= 2)
58 |  |
             {
59 | 69 |
                 s = s.substring(1, s.length() - 1);
60 |  |
             }
61 |  |
62 |  |
             // remove the white spaces
63 | 72 |
             s = StringUtils.replaceChars(s, " \t\n\r", "");
64 |  |
65 |  |
             // add a leading 0 to ensure well formed bytes
66 | 72 |
             if (s.length() % 2 != 0)
67 |  |
             {
68 | 1 |
                 s = "0" + s;
69 |  |
             }
70 |  |
71 |  |
             // parse and return the bytes
72 |  |
             try
73 |  |
             {
74 | 72 |
                 return Hex.decodeHex(s.toCharArray());
75 |  |
             }
76 | 0 |
             catch (Exception e)
77 |  |
             {
78 | 0 |
                 throw (ParseException) new ParseException("Unable to parse the byte[] : " + e.getMessage());
79 |  |
             }
80 |  |
         }
81 |  |
82 |  |
         /**
83 |  |
          * Parse a date formatted as <*D2002-03-22 11:30:00 +0100>
84 |  |
          */
85 |  |
         protected Date parseDate(String s) throws ParseException
86 |  |
         {
87 | 34 |
             return PropertyListConfiguration.parseDate(s);
88 |  |
         }
89 |  |
90 |  |
       final public PropertyListConfiguration parse() throws ParseException {
91 | 36 |
         PropertyListConfiguration configuration = null;
92 | 36 |
         configuration = Dictionary();
93 | 35 |
         jj_consume_token(0);
94 | 35 |
           {if (true) return configuration;}
95 |  |
         throw new Error("Missing return statement in function");
96 |  |
       }
97 |  |
98 |  |
       final public PropertyListConfiguration Dictionary() throws ParseException {
99 | 266 |
         PropertyListConfiguration configuration = new PropertyListConfiguration();
100 | 266 |
         List children = new ArrayList();
101 | 266 |
         Node child = null;
102 | 266 |
         jj_consume_token(DICT_BEGIN);
103 |  |
         label_1:
104 |  |
         while (true) {
105 | 959 |
           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
106 |  |
           case STRING:
107 |  |
           case QUOTED_STRING:
108 |  |
             ;
109 | 694 |
             break;
110 |  |
           default:
111 | 265 |
             jj_la1[0] = jj_gen;
112 | 265 |
             break label_1;
113 |  |
           }
114 | 694 |
           child = Property();
115 | 694 |
                 if (child.getValue() instanceof HierarchicalConfiguration)
116 |  |
                 {
117 |  |
                     // prune & graft the nested configuration to the parent configuration
118 | 164 |
                     HierarchicalConfiguration conf = (HierarchicalConfiguration) child.getValue();
119 | 164 |
                     Node root = conf.getRoot();
120 | 164 |
                     root.setName(child.getName());
121 | 164 |
                     children.add(root);
122 | 164 |
                 }
123 |  |
                 else
124 |  |
                 {
125 | 530 |
                     children.add(child);
126 |  |
                 }
127 | 530 |
         }
128 | 265 |
         jj_consume_token(DICT_END);
129 | 959 |
             for (int i = 0; i < children.size(); i++)
130 |  |
             {
131 | 694 |
                 child = (Node) children.get(i);
132 | 694 |
                 configuration.getRoot().addChild(child);
133 |  |
             }
134 |  |
135 | 265 |
             {if (true) return configuration;}
136 |  |
         throw new Error("Missing return statement in function");
137 |  |
       }
138 |  |
139 |  |
       final public Node Property() throws ParseException {
140 | 694 |
         String key = null;
141 | 694 |
         Object value = null;
142 | 694 |
         Node node = new Node();
143 | 694 |
         key = String();
144 | 694 |
           node.setName(key);
145 | 694 |
         jj_consume_token(EQUAL);
146 | 694 |
         value = Element();
147 | 694 |
           node.setValue(value);
148 | 694 |
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
149 |  |
         case DICT_SEPARATOR:
150 | 466 |
           jj_consume_token(DICT_SEPARATOR);
151 | 466 |
           break;
152 |  |
         default:
153 | 228 |
           jj_la1[1] = jj_gen;
154 |  |
           ;
155 |  |
         }
156 | 694 |
           {if (true) return node;}
157 |  |
         throw new Error("Missing return statement in function");
158 |  |
       }
159 |  |
160 |  |
       final public Object Element() throws ParseException {
161 | 1057 |
         Object value = null;
162 | 1057 |
         if (jj_2_1(2)) {
163 | 198 |
           value = Array();
164 | 198 |
           {if (true) return value;}
165 |  |
         } else {
166 | 859 |
           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
167 |  |
           case DICT_BEGIN:
168 | 230 |
             value = Dictionary();
169 | 230 |
           {if (true) return value;}
170 |  |
             break;
171 |  |
           case STRING:
172 |  |
           case QUOTED_STRING:
173 | 528 |
             value = String();
174 | 528 |
           {if (true) return value;}
175 |  |
             break;
176 |  |
           case DATA:
177 | 68 |
             value = Data();
178 | 68 |
           {if (true) return value;}
179 |  |
             break;
180 |  |
           case DATE:
181 | 33 |
             value = Date();
182 | 33 |
           {if (true) return value;}
183 |  |
             break;
184 |  |
           default:
185 | 0 |
             jj_la1[2] = jj_gen;
186 | 0 |
             jj_consume_token(-1);
187 | 0 |
             throw new ParseException();
188 |  |
           }
189 |  |
         }
190 |  |
         throw new Error("Missing return statement in function");
191 |  |
       }
192 |  |
193 |  |
       final public List Array() throws ParseException {
194 | 198 |
         List list = new ArrayList();
195 | 198 |
         Object element = null;
196 | 198 |
         jj_consume_token(ARRAY_BEGIN);
197 | 198 |
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
198 |  |
         case ARRAY_BEGIN:
199 |  |
         case DICT_BEGIN:
200 |  |
         case DATA:
201 |  |
         case DATE:
202 |  |
         case STRING:
203 |  |
         case QUOTED_STRING:
204 | 165 |
           element = Element();
205 | 165 |
               list.add(element);
206 |  |
           label_2:
207 |  |
           while (true) {
208 | 363 |
             switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
209 |  |
             case ARRAY_SEPARATOR:
210 |  |
               ;
211 | 198 |
               break;
212 |  |
             default:
213 | 165 |
               jj_la1[3] = jj_gen;
214 | 165 |
               break label_2;
215 |  |
             }
216 | 198 |
             jj_consume_token(ARRAY_SEPARATOR);
217 | 198 |
             element = Element();
218 | 198 |
                   list.add(element);
219 | 198 |
           }
220 |  |
           break;
221 |  |
         default:
222 | 33 |
           jj_la1[4] = jj_gen;
223 |  |
           ;
224 |  |
         }
225 | 198 |
         jj_consume_token(ARRAY_END);
226 | 198 |
           {if (true) return list;}
227 |  |
         throw new Error("Missing return statement in function");
228 |  |
       }
229 |  |
230 |  |
       final public String String() throws ParseException {
231 | 1222 |
         Token token = null;
232 | 1222 |
         String value = null;
233 | 1222 |
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
234 |  |
         case QUOTED_STRING:
235 | 290 |
           token = jj_consume_token(QUOTED_STRING);
236 | 290 |
           {if (true) return unescapeQuotes(removeQuotes(token.image));}
237 |  |
           break;
238 |  |
         case STRING:
239 | 932 |
           token = jj_consume_token(STRING);
240 | 932 |
           {if (true) return token.image;}
241 |  |
           break;
242 |  |
         default:
243 | 0 |
           jj_la1[5] = jj_gen;
244 | 0 |
           jj_consume_token(-1);
245 | 0 |
           throw new ParseException();
246 |  |
         }
247 |  |
         throw new Error("Missing return statement in function");
248 |  |
       }
249 |  |
250 |  |
       final public byte[] Data() throws ParseException {
251 |  |
         Token token;
252 | 68 |
         token = jj_consume_token(DATA);
253 | 68 |
           {if (true) return filterData(token.image);}
254 |  |
         throw new Error("Missing return statement in function");
255 |  |
       }
256 |  |
257 |  |
       final public Date Date() throws ParseException {
258 |  |
         Token token;
259 | 33 |
         token = jj_consume_token(DATE);
260 | 33 |
           {if (true) return parseDate(token.image);}
261 |  |
         throw new Error("Missing return statement in function");
262 |  |
       }
263 |  |
264 |  |
       final private boolean jj_2_1(int xla) {
265 | 1057 |
         jj_la = xla; jj_lastpos = jj_scanpos = token;
266 | 1057 |
         try { return !jj_3_1(); }
267 | 198 |
         catch(LookaheadSuccess ls) { return true; }
268 | 1057 |
         finally { jj_save(0, xla); }
269 |  |
       }
270 |  |
271 |  |
       final private boolean jj_3R_14() {
272 | 132 |
         if (jj_scan_token(QUOTED_STRING)) return true;
273 | 0 |
         return false;
274 |  |
       }
275 |  |
276 |  |
       final private boolean jj_3R_11() {
277 |  |
         Token xsp;
278 | 132 |
         xsp = jj_scanpos;
279 | 132 |
         if (jj_3R_14()) {
280 | 100 |
         jj_scanpos = xsp;
281 | 100 |
         if (jj_3R_15()) return true;
282 |  |
         }
283 | 0 |
         return false;
284 |  |
       }
285 |  |
286 |  |
       final private boolean jj_3R_13() {
287 | 33 |
         if (jj_scan_token(DATE)) return true;
288 | 0 |
         return false;
289 |  |
       }
290 |  |
291 |  |
       final private boolean jj_3R_10() {
292 | 165 |
         if (jj_scan_token(DICT_BEGIN)) return true;
293 | 0 |
         return false;
294 |  |
       }
295 |  |
296 |  |
       final private boolean jj_3R_9() {
297 | 33 |
         if (jj_3R_13()) return true;
298 | 0 |
         return false;
299 |  |
       }
300 |  |
301 |  |
       final private boolean jj_3R_8() {
302 | 33 |
         if (jj_3R_12()) return true;
303 | 0 |
         return false;
304 |  |
       }
305 |  |
306 |  |
       final private boolean jj_3R_12() {
307 | 33 |
         if (jj_scan_token(DATA)) return true;
308 | 0 |
         return false;
309 |  |
       }
310 |  |
311 |  |
       final private boolean jj_3R_7() {
312 | 132 |
         if (jj_3R_11()) return true;
313 | 0 |
         return false;
314 |  |
       }
315 |  |
316 |  |
       final private boolean jj_3R_4() {
317 | 198 |
         if (jj_3R_5()) return true;
318 | 0 |
         return false;
319 |  |
       }
320 |  |
321 |  |
       final private boolean jj_3R_6() {
322 | 165 |
         if (jj_3R_10()) return true;
323 | 0 |
         return false;
324 |  |
       }
325 |  |
326 |  |
       final private boolean jj_3R_15() {
327 | 100 |
         if (jj_scan_token(STRING)) return true;
328 | 0 |
         return false;
329 |  |
       }
330 |  |
331 |  |
       final private boolean jj_3R_3() {
332 | 1255 |
         if (jj_scan_token(ARRAY_BEGIN)) return true;
333 |  |
         Token xsp;
334 | 198 |
         xsp = jj_scanpos;
335 | 198 |
         if (jj_3R_4()) jj_scanpos = xsp;
336 | 33 |
         if (jj_scan_token(ARRAY_END)) return true;
337 | 0 |
         return false;
338 |  |
       }
339 |  |
340 |  |
       final private boolean jj_3_1() {
341 | 1255 |
         if (jj_3R_3()) return true;
342 | 0 |
         return false;
343 |  |
       }
344 |  |
345 |  |
       final private boolean jj_3R_5() {
346 |  |
         Token xsp;
347 | 198 |
         xsp = jj_scanpos;
348 | 198 |
         if (jj_3_1()) {
349 | 165 |
         jj_scanpos = xsp;
350 | 165 |
         if (jj_3R_6()) {
351 | 132 |
         jj_scanpos = xsp;
352 | 132 |
         if (jj_3R_7()) {
353 | 33 |
         jj_scanpos = xsp;
354 | 33 |
         if (jj_3R_8()) {
355 | 33 |
         jj_scanpos = xsp;
356 | 33 |
         if (jj_3R_9()) return true;
357 |  |
         }
358 |  |
         }
359 |  |
         }
360 |  |
         }
361 | 0 |
         return false;
362 |  |
       }
363 |  |
364 |  |
       public PropertyListParserTokenManager token_source;
365 |  |
       SimpleCharStream jj_input_stream;
366 |  |
       public Token token, jj_nt;
367 |  |
       private int jj_ntk;
368 |  |
       private Token jj_scanpos, jj_lastpos;
369 |  |
       private int jj_la;
370 | 40 |
       public boolean lookingAhead = false;
371 |  |
       private boolean jj_semLA;
372 |  |
       private int jj_gen;
373 | 40 |
       final private int[] jj_la1 = new int[6];
374 |  |
       static private int[] jj_la1_0;
375 |  |
       static {
376 | 3 |
           jj_la1_0();
377 | 3 |
        }
378 |  |
        private static void jj_la1_0() {
379 | 3 |
           jj_la1_0 = new int[] {0x600000,0x400,0x780100,0x80,0x780120,0x600000,};
380 | 3 |
        }
381 | 40 |
       final private JJCalls[] jj_2_rtns = new JJCalls[1];
382 | 40 |
       private boolean jj_rescan = false;
383 | 40 |
       private int jj_gc = 0;
384 |  |
385 | 0 |
       public PropertyListParser(java.io.InputStream stream) {
386 | 0 |
         jj_input_stream = new SimpleCharStream(stream, 1, 1);
387 | 0 |
         token_source = new PropertyListParserTokenManager(jj_input_stream);
388 | 0 |
         token = new Token();
389 | 0 |
         jj_ntk = -1;
390 | 0 |
         jj_gen = 0;
391 | 0 |
         for (int i = 0; i < 6; i++) jj_la1[i] = -1;
392 | 0 |
         for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
393 | 0 |
       }
394 |  |
395 |  |
       public void ReInit(java.io.InputStream stream) {
396 | 0 |
         jj_input_stream.ReInit(stream, 1, 1);
397 | 0 |
         token_source.ReInit(jj_input_stream);
398 | 0 |
         token = new Token();
399 | 0 |
         jj_ntk = -1;
400 | 0 |
         jj_gen = 0;
401 | 0 |
         for (int i = 0; i < 6; i++) jj_la1[i] = -1;
402 | 0 |
         for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
403 | 0 |
       }
404 |  |
405 | 40 |
       public PropertyListParser(java.io.Reader stream) {
406 | 40 |
         jj_input_stream = new SimpleCharStream(stream, 1, 1);
407 | 40 |
         token_source = new PropertyListParserTokenManager(jj_input_stream);
408 | 40 |
         token = new Token();
409 | 40 |
         jj_ntk = -1;
410 | 40 |
         jj_gen = 0;
411 | 40 |
         for (int i = 0; i < 6; i++) jj_la1[i] = -1;
412 | 40 |
         for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
413 | 40 |
       }
414 |  |
415 |  |
       public void ReInit(java.io.Reader stream) {
416 | 0 |
         jj_input_stream.ReInit(stream, 1, 1);
417 | 0 |
         token_source.ReInit(jj_input_stream);
418 | 0 |
         token = new Token();
419 | 0 |
         jj_ntk = -1;
420 | 0 |
         jj_gen = 0;
421 | 0 |
         for (int i = 0; i < 6; i++) jj_la1[i] = -1;
422 | 0 |
         for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
423 | 0 |
       }
424 |  |
425 | 0 |
       public PropertyListParser(PropertyListParserTokenManager tm) {
426 | 0 |
         token_source = tm;
427 | 0 |
         token = new Token();
428 | 0 |
         jj_ntk = -1;
429 | 0 |
         jj_gen = 0;
430 | 0 |
         for (int i = 0; i < 6; i++) jj_la1[i] = -1;
431 | 0 |
         for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
432 | 0 |
       }
433 |  |
434 |  |
       public void ReInit(PropertyListParserTokenManager tm) {
435 | 0 |
         token_source = tm;
436 | 0 |
         token = new Token();
437 | 0 |
         jj_ntk = -1;
438 | 0 |
         jj_gen = 0;
439 | 0 |
         for (int i = 0; i < 6; i++) jj_la1[i] = -1;
440 | 0 |
         for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
441 | 0 |
       }
442 |  |
443 |  |
       final private Token jj_consume_token(int kind) throws ParseException {
444 |  |
         Token oldToken;
445 | 3643 |
         if ((oldToken = token).next != null) token = token.next;
446 | 765 |
         else token = token.next = token_source.getNextToken();
447 | 3643 |
         jj_ntk = -1;
448 | 3643 |
         if (token.kind == kind) {
449 | 3642 |
           jj_gen++;
450 | 3642 |
           if (++jj_gc > 100) {
451 | 33 |
             jj_gc = 0;
452 | 66 |
             for (int i = 0; i < jj_2_rtns.length; i++) {
453 | 33 |
               JJCalls c = jj_2_rtns[i];
454 | 99 |
               while (c != null) {
455 | 66 |
                 if (c.gen < jj_gen) c.first = null;
456 | 66 |
                 c = c.next;
457 | 66 |
               }
458 |  |
             }
459 |  |
           }
460 | 3642 |
           return token;
461 |  |
         }
462 | 1 |
         token = oldToken;
463 | 1 |
         jj_kind = kind;
464 | 1 |
         throw generateParseException();
465 |  |
       }
466 |  |
467 | 80 |
       static private final class LookaheadSuccess extends java.lang.Error { }
468 | 40 |
       final private LookaheadSuccess jj_ls = new LookaheadSuccess();
469 |  |
       final private boolean jj_scan_token(int kind) {
470 | 1751 |
         if (jj_scanpos == jj_lastpos) {
471 | 1255 |
           jj_la--;
472 | 1255 |
           if (jj_scanpos.next == null) {
473 | 1090 |
             jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
474 | 1090 |
           } else {
475 | 165 |
             jj_lastpos = jj_scanpos = jj_scanpos.next;
476 |  |
           }
477 | 165 |
         } else {
478 | 496 |
           jj_scanpos = jj_scanpos.next;
479 |  |
         }
480 | 1751 |
         if (jj_rescan) {
481 | 0 |
           int i = 0; Token tok = token;
482 | 0 |
           while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
483 | 0 |
           if (tok != null) jj_add_error_token(kind, i);
484 |  |
         }
485 | 1751 |
         if (jj_scanpos.kind != kind) return true;
486 | 396 |
         if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
487 | 198 |
         return false;
488 |  |
       }
489 |  |
490 |  |
       final public Token getNextToken() {
491 | 0 |
         if (token.next != null) token = token.next;
492 | 0 |
         else token = token.next = token_source.getNextToken();
493 | 0 |
         jj_ntk = -1;
494 | 0 |
         jj_gen++;
495 | 0 |
         return token;
496 |  |
       }
497 |  |
498 |  |
       final public Token getToken(int index) {
499 | 0 |
         Token t = lookingAhead ? jj_scanpos : token;
500 | 0 |
         for (int i = 0; i < index; i++) {
501 | 0 |
           if (t.next != null) t = t.next;
502 | 0 |
           else t = t.next = token_source.getNextToken();
503 |  |
         }
504 | 0 |
         return t;
505 |  |
       }
506 |  |
507 |  |
       final private int jj_ntk() {
508 | 2713 |
         if ((jj_nt=token.next) == null)
509 | 1788 |
           return (jj_ntk = (token.next=token_source.getNextToken()).kind);
510 |  |
         else
511 | 925 |
           return (jj_ntk = jj_nt.kind);
512 |  |
       }
513 |  |
514 | 40 |
       private java.util.Vector jj_expentries = new java.util.Vector();
515 |  |
       private int[] jj_expentry;
516 | 40 |
       private int jj_kind = -1;
517 | 40 |
       private int[] jj_lasttokens = new int[100];
518 |  |
       private int jj_endpos;
519 |  |
520 |  |
       private void jj_add_error_token(int kind, int pos) {
521 | 1 |
         if (pos >= 100) return;
522 | 1 |
         if (pos == jj_endpos + 1) {
523 | 0 |
           jj_lasttokens[jj_endpos++] = kind;
524 | 0 |
         } else if (jj_endpos != 0) {
525 | 0 |
           jj_expentry = new int[jj_endpos];
526 | 0 |
           for (int i = 0; i < jj_endpos; i++) {
527 | 0 |
             jj_expentry[i] = jj_lasttokens[i];
528 |  |
           }
529 | 0 |
           boolean exists = false;
530 | 0 |
           for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
531 | 0 |
             int[] oldentry = (int[])(e.nextElement());
532 | 0 |
             if (oldentry.length == jj_expentry.length) {
533 | 0 |
               exists = true;
534 | 0 |
               for (int i = 0; i < jj_expentry.length; i++) {
535 | 0 |
                 if (oldentry[i] != jj_expentry[i]) {
536 | 0 |
                   exists = false;
537 | 0 |
                   break;
538 |  |
                 }
539 |  |
               }
540 | 0 |
               if (exists) break;
541 |  |
             }
542 | 0 |
           }
543 | 0 |
           if (!exists) jj_expentries.addElement(jj_expentry);
544 | 0 |
           if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
545 |  |
         }
546 | 1 |
       }
547 |  |
548 |  |
       public ParseException generateParseException() {
549 | 1 |
         jj_expentries.removeAllElements();
550 | 1 |
         boolean[] la1tokens = new boolean[24];
551 | 25 |
         for (int i = 0; i < 24; i++) {
552 | 24 |
           la1tokens[i] = false;
553 |  |
         }
554 | 1 |
         if (jj_kind >= 0) {
555 | 1 |
           la1tokens[jj_kind] = true;
556 | 1 |
           jj_kind = -1;
557 |  |
         }
558 | 7 |
         for (int i = 0; i < 6; i++) {
559 | 6 |
           if (jj_la1[i] == jj_gen) {
560 | 0 |
             for (int j = 0; j < 32; j++) {
561 | 0 |
               if ((jj_la1_0[i] & (1<<j)) != 0) {
562 | 0 |
                 la1tokens[j] = true;
563 |  |
               }
564 |  |
             }
565 |  |
           }
566 |  |
         }
567 | 25 |
         for (int i = 0; i < 24; i++) {
568 | 24 |
           if (la1tokens[i]) {
569 | 1 |
             jj_expentry = new int[1];
570 | 1 |
             jj_expentry[0] = i;
571 | 1 |
             jj_expentries.addElement(jj_expentry);
572 |  |
           }
573 |  |
         }
574 | 1 |
         jj_endpos = 0;
575 | 1 |
         jj_rescan_token();
576 | 1 |
         jj_add_error_token(0, 0);
577 | 1 |
         int[][] exptokseq = new int[jj_expentries.size()][];
578 | 2 |
         for (int i = 0; i < jj_expentries.size(); i++) {
579 | 1 |
           exptokseq[i] = (int[])jj_expentries.elementAt(i);
580 |  |
         }
581 | 1 |
         return new ParseException(token, exptokseq, tokenImage);
582 |  |
       }
583 |  |
584 |  |
       final public void enable_tracing() {
585 | 0 |
       }
586 |  |
587 |  |
       final public void disable_tracing() {
588 | 0 |
       }
589 |  |
590 |  |
       final private void jj_rescan_token() {
591 | 1 |
         jj_rescan = true;
592 | 2 |
         for (int i = 0; i < 1; i++) {
593 | 1 |
           JJCalls p = jj_2_rtns[i];
594 |  |
           do {
595 | 1 |
             if (p.gen > jj_gen) {
596 | 0 |
               jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
597 | 0 |
               switch (i) {
598 | 0 |
                 case 0: jj_3_1(); break;
599 |  |
               }
600 |  |
             }
601 | 1 |
             p = p.next;
602 | 1 |
           } while (p != null);
603 |  |
         }
604 | 1 |
         jj_rescan = false;
605 | 1 |
       }
606 |  |
607 |  |
       final private void jj_save(int index, int xla) {
608 | 1057 |
         JJCalls p = jj_2_rtns[index];
609 | 1156 |
         while (p.gen > jj_gen) {
610 | 132 |
           if (p.next == null) { p = p.next = new JJCalls(); break; }
611 | 99 |
           p = p.next;
612 | 99 |
         }
613 | 1057 |
         p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
614 | 1057 |
       }
615 |  |
616 | 73 |
       static final class JJCalls {
617 |  |
         int gen;
618 |  |
         Token first;
619 |  |
         int arg;
620 |  |
         JJCalls next;
621 |  |
       }
622 |  |
623 |  |
     }