Statistics
| Revision:

svn-gvsig-desktop / trunk / extensions / extSymbology / src / org / gvsig / symbology / fmap / labeling / parse / LabelExpressionParser.java @ 36624

History | View | Annotate | Download (41.3 KB)

1
/* Generated By:JavaCC: Do not edit this line. LabelExpressionParser.java */
2
/* gvSIG. Sistema de Información Geográfica de la Generalitat Valenciana
3
 *
4
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 *  Generalitat Valenciana
23
 *   Conselleria d'Infraestructures i Transport
24
 *   Av. Blasco Ibáñez, 50
25
 *   46010 VALENCIA
26
 *   SPAIN
27
 *
28
 *      +34 963862235
29
 *   gvsig@gva.es
30
 *      www.gvsig.gva.es
31
 *
32
 *    or
33
 *
34
 *   IVER T.I. S.A
35
 *   Salamanca 50
36
 *   46005 Valencia
37
 *   Spain
38
 *
39
 *   +34 963163400
40
 *   dac@iver.es
41
 */
42
package org.gvsig.symbology.fmap.labeling.parse;
43
import java.util.*;
44
import java.io.*;
45

    
46

    
47
import com.hardcode.gdbms.engine.values.*;
48
import org.gvsig.symbology.fmap.rendering.filter.operations.*;
49
import org.gvsig.symbology.fmap.labeling.parse.*;
50
import org.gvsig.symbology.fmap.labeling.lang.functions.*;
51
/**
52
 * @author Pepe Vidal Salvador - jose.vidal.salvador@iver.es
53
 * @author Jaume Dominguez Faus - jaume.dominguez@gmail.com
54
 *
55
 */
56
public class LabelExpressionParser implements LabelExpressionParserConstants {
57
        private Stack stack = new Stack();
58
        private static OperatorsFactory operators = OperatorsFactory.getInstance();
59
        private Hashtable<String, Value> symbols = new Hashtable<String, Value>();
60
        private ArrayList<String> classNames = new ArrayList<String>();
61

    
62
        public ArrayList<String> getClassNames (){
63
                return classNames;
64
        }
65

    
66
        public void addClassName(String name){
67

    
68
                for (int i = 0; i < classNames.size(); i++) {
69
                        if(classNames.get(i).compareTo(name)==0)
70
                                return;
71
                }
72
                classNames.add(name);
73

    
74
        }
75

    
76
        public Hashtable<String,Value> getSymbols(){
77

    
78
                return symbols;
79

    
80
        }
81

    
82
        public Object pop() throws ExpressionException {
83

    
84
                Object popObject = stack.pop();
85
                Object result = ((Expression)popObject).evaluate();
86

    
87
                if(result instanceof String) {
88
                        return new String (result.toString());
89
                }
90
                else if (result instanceof Boolean) {
91
                        return new Boolean (result.toString());
92
                }
93
                else if (result instanceof Double) {
94
                        return Double.valueOf(result.toString());
95
                }
96
                else if (result instanceof Integer) {
97
                        return Integer.valueOf(result.toString());
98
                }
99
                return null;
100

    
101
        }
102

    
103
        public Stack getStack(){
104

    
105
                return this.stack;
106

    
107
        }
108

    
109
        public LabelExpressionParser(StringReader reader, Hashtable<String, Value> symbolsTable) {
110

    
111
                this(reader);
112
                this.symbols = symbolsTable;
113

    
114
        }
115

    
116
        /**
117
         * it is default because it is used in the unit tests
118
         * but this method is not part of the public API, so
119
         * don't use it!
120
         */
121
        void putSymbol(String string, Value value){
122

    
123
                this.symbols.put(string,value);
124

    
125
        }
126

    
127
        public static String tokenFor(int tokenCode) {
128

    
129
                return tokenImage[tokenCode].replaceAll("\"", "");
130

    
131
        }
132

    
133
        public void setOperatorsFactory (OperatorsFactory opFac) {
134

    
135
                this.operators = opFac;
136

    
137
        }
138

    
139
        public static void main(String[]args)throws ParseException,ExpressionException{
140

    
141
                LabelExpressionParser parser = new LabelExpressionParser(new StringReader("([RD_6]+3)*5;"));
142
                parser.symbols.put("RD_6",ValueFactory.createValue(2));
143
                operators.addOperator(IndexOfFunction.class);
144
                operators.addOperator(SubstringFunction.class);
145
                parser.setOperatorsFactory(operators);
146
                parser.LabelExpression();
147
                System.out.print(((Expression)(parser.getStack().pop())).evaluate().toString());
148

    
149

    
150
        }
151

    
152
/* LABEL EXPRESSION */
153
//We have to use this function if we want to evaluate an String which contains different Expressions
154
//inside
155
  final public void LabelExpression() throws ParseException {
156
    Expression();
157
    label_1:
158
    while (true) {
159
      if (jj_2_1(2)) {
160
        ;
161
      } else {
162
        break label_1;
163
      }
164
      if (jj_2_2(2)) {
165
        jj_consume_token(EOFIELD);
166
        Expression();
167
                         Expression leftExpression = (Expression)stack.pop();
168
                 Expression rightExpression = (Expression)stack.pop();
169

    
170
                         Expression labelExpr = new LabelExpressionOperator(symbols);
171
                         labelExpr.addArgument(0, rightExpression);
172
                         labelExpr.addArgument(0, leftExpression);
173

    
174
                stack.push(labelExpr);
175
      } else if (jj_2_3(2)) {
176
        Expression();
177
            Expression leftExpression2 = (Expression)stack.pop();
178
                Expression rightExpression2 = (Expression)stack.pop();
179

    
180
                        Expression fieldExpr = new FieldExpressionOperator(symbols);
181
                        fieldExpr.addArgument(0, rightExpression2);
182
                        fieldExpr.addArgument(0, leftExpression2);
183

    
184
                stack.push(fieldExpr);
185
      } else {
186
        jj_consume_token(-1);
187
        throw new ParseException();
188
      }
189
    }
190
  }
191

    
192
  final public void Expression() throws ParseException {
193
    AndExpression();
194
    label_2:
195
    while (true) {
196
      if (jj_2_4(2)) {
197
        ;
198
      } else {
199
        break label_2;
200
      }
201
      jj_consume_token(OR);
202
      AndExpression();
203
    Expression leftExpression = (Expression)stack.pop();
204
    Expression rightExpression = (Expression)stack.pop();
205

    
206
        Expression orExpr = new OrOperator(symbols);
207
        orExpr.addArgument(0, rightExpression);
208
        orExpr.addArgument(0, leftExpression);
209

    
210
    stack.push(orExpr);
211
    }
212
  }
213

    
214
  final public void AndExpression() throws ParseException {
215
  Token x;
216
    EqCompExpression();
217
    label_3:
218
    while (true) {
219
      if (jj_2_5(2)) {
220
        ;
221
      } else {
222
        break label_3;
223
      }
224
      x = jj_consume_token(AND);
225
      EqCompExpression();
226
    Expression rightExpression = (Expression)stack.pop();
227
    Expression leftExpression = (Expression)stack.pop();
228

    
229
    Expression func = new AndOperator(symbols);
230

    
231
    func.addArgument(0, rightExpression);
232
    func.addArgument(0, leftExpression);
233

    
234
    stack.push(func);
235
    }
236
  }
237

    
238
  final public void EqCompExpression() throws ParseException {
239
  Token x;
240
    ComparisonExpression();
241
    label_4:
242
    while (true) {
243
      if (jj_2_6(2)) {
244
        ;
245
      } else {
246
        break label_4;
247
      }
248
      if (jj_2_7(2)) {
249
        x = jj_consume_token(EQ);
250
      } else if (jj_2_8(2)) {
251
        x = jj_consume_token(NE);
252
      } else {
253
        jj_consume_token(-1);
254
        throw new ParseException();
255
      }
256
      ComparisonExpression();
257
    Expression rightExpression = (Expression)stack.pop();
258
    Expression leftExpression = (Expression)stack.pop();
259
    Expression func = null;
260

    
261
    if (x.kind == EQ)func = new EqOperator(symbols);
262
    else if (x.kind == NE)func = new NeOperator(symbols);
263

    
264
    func.addArgument(0, rightExpression);
265
    func.addArgument(0, leftExpression);
266

    
267
    stack.push(func);
268
    }
269
  }
270

    
271
  final public void ComparisonExpression() throws ParseException {
272
  Token x;
273
    AdditiveExpression();
274
    label_5:
275
    while (true) {
276
      if (jj_2_9(2)) {
277
        ;
278
      } else {
279
        break label_5;
280
      }
281
      if (jj_2_10(2)) {
282
        x = jj_consume_token(LT);
283
      } else if (jj_2_11(2)) {
284
        x = jj_consume_token(LE);
285
      } else if (jj_2_12(2)) {
286
        x = jj_consume_token(GT);
287
      } else if (jj_2_13(2)) {
288
        x = jj_consume_token(GE);
289
      } else {
290
        jj_consume_token(-1);
291
        throw new ParseException();
292
      }
293
      AdditiveExpression();
294
    Expression rightExpression = (Expression)stack.pop();
295
    Expression leftExpression = (Expression)stack.pop();
296
    Expression func = null;
297

    
298

    
299
    if (x.kind == LT)func = new LessThanOperator(symbols);
300
    else if (x.kind == LE)func = new LessThanOrEqualsOperator(symbols);
301
    else if (x.kind == GT)func = new GreaterThanOperator(symbols);
302
    else if (x.kind == GE)func = new GreaterThanOrEqualsOperator(symbols);
303

    
304
    func.addArgument(0, rightExpression);
305
    func.addArgument(0, leftExpression);
306

    
307
    stack.push(func);
308
    }
309
  }
310

    
311
  final public void AdditiveExpression() throws ParseException {
312
  Token x;
313
    MultiplicativeExpression();
314
    label_6:
315
    while (true) {
316
      if (jj_2_14(2)) {
317
        ;
318
      } else {
319
        break label_6;
320
      }
321
      if (jj_2_15(2)) {
322
        x = jj_consume_token(PLUS);
323
      } else if (jj_2_16(2)) {
324
        x = jj_consume_token(MINUS);
325
      } else {
326
        jj_consume_token(-1);
327
        throw new ParseException();
328
      }
329
      MultiplicativeExpression();
330
    Expression rightExpression = (Expression)stack.pop();
331
    Expression leftExpression = (Expression)stack.pop();
332
    Expression func = null;
333

    
334
    if (x.kind == PLUS)func = new AddOperator(symbols);
335
    else func = new MinusOperator(symbols);
336

    
337
    func.addArgument(0, rightExpression);
338
    func.addArgument(0, leftExpression);
339

    
340
    stack.push(func);
341
    }
342
  }
343

    
344
//void MultiplicativeExpression():{
345
//  Token x;
346
//}
347
//{
348
//  UnaryElement()((x = <MULTIPLY>
349
//  | x = <DIVIDE>)UnaryElement(){
350
//          try{
351
//                          Expression A = (Expression) stack.pop();
352
//                        Expression B = (Expression) stack.pop();
353
//                         boolean aInt = (((Expression) A).evaluate() instanceof Integer);
354
//                         boolean bInt = (((Expression) B).evaluate() instanceof Integer);
355
//                        if (aInt &&        bInt) {
356
//                                int a = (Integer) A.evaluate();
357
//                                int b = (Integer) B.evaluate();
358
//                                if (x.kind == MULTIPLY)
359
//                                        stack.push(new NumericalConstant(new Integer(b * a),symbols));
360
//                                else
361
//                                        stack.push(new NumericalConstant(new Integer(b / a),symbols));
362
//                        } else {
363
//
364
//                                double a = new Double(((Expression)A).evaluate().toString());
365
//                double b = new Double(((Expression)B).evaluate().toString());
366
//                                if (x.kind == MULTIPLY)
367
//                                        stack.push(new NumericalConstant(new Double(b * a),symbols));
368
//                                else
369
//                                        stack.push(new NumericalConstant(new Double(b / a),symbols));
370
//                        }}catch (ClassCastException ex) {
371
//                  ex.printStackTrace();
372
//            } catch (ExpressionException e) {
373
//                                  e.printStackTrace();
374
//                        }
375
//
376
//        })*
377
//}
378
  final public void MultiplicativeExpression() throws ParseException {
379
  Token x;
380
    UnaryElement();
381
    label_7:
382
    while (true) {
383
      if (jj_2_17(2)) {
384
        ;
385
      } else {
386
        break label_7;
387
      }
388
      if (jj_2_18(2)) {
389
        x = jj_consume_token(MULTIPLY);
390
      } else if (jj_2_19(2)) {
391
        x = jj_consume_token(DIVIDE);
392
      } else {
393
        jj_consume_token(-1);
394
        throw new ParseException();
395
      }
396
      UnaryElement();
397
    Expression rightExpression = (Expression)stack.pop();
398
    Expression leftExpression = (Expression)stack.pop();
399
    Expression func = null;
400

    
401
    if (x.kind == MULTIPLY)func = new MultOperator(symbols);
402
    else func = new DivOperator(symbols);
403

    
404
    func.addArgument(0, rightExpression);
405
    func.addArgument(0, leftExpression);
406

    
407
    stack.push(func);
408
    }
409
  }
410

    
411
  final public void UnaryElement() throws ParseException {
412
  Token x = null;
413
    if (jj_2_22(2)) {
414
      if (jj_2_20(2)) {
415
        x = jj_consume_token(PLUS);
416
      } else if (jj_2_21(2)) {
417
        x = jj_consume_token(MINUS);
418
      } else {
419
        jj_consume_token(-1);
420
        throw new ParseException();
421
      }
422
      UnaryElement();
423
              try{
424
                 Object A = stack.pop();
425
                         if ((((Expression) A).evaluate() instanceof Integer)) {
426
                                int a = (Integer) ((Expression) A).evaluate();
427
                                if (x.kind == PLUS)
428
                                        stack.push(new NumericalConstant(new Integer(a),symbols));
429
                                else
430
                                        stack.push(new NumericalConstant(new Integer(-a),symbols));
431
                        } else {
432
                                double a = (Double) ((Expression) A).evaluate();
433
                                if (x.kind == PLUS)
434
                                        stack.push(new NumericalConstant(new Double(a),symbols));
435
                                else
436
                                        stack.push(new NumericalConstant(new Double(-a),symbols));
437
                        }
438
                         } catch (ClassCastException ex) {
439
               ex.printStackTrace();
440
             }catch (ExpressionException ex) {
441
                 ex.printStackTrace();
442
             }
443
    } else if (jj_2_23(2)) {
444
      BooleanUnaryElement();
445
    } else {
446
      jj_consume_token(-1);
447
      throw new ParseException();
448
    }
449
  }
450

    
451
  final public void BooleanUnaryElement() throws ParseException {
452
        Token t;
453
    if (jj_2_24(2)) {
454
      t = jj_consume_token(NOT);
455
      UnaryElement();
456
                Expression rightExpression = (Expression)stack.pop();
457
                Expression func = new NotOperator(symbols);
458
                func.addArgument(0, rightExpression);
459
                stack.push(func);
460
    } else if (jj_2_25(2)) {
461
      Element();
462
    } else {
463
      jj_consume_token(-1);
464
      throw new ParseException();
465
    }
466
  }
467

    
468
  final public void Element() throws ParseException {
469
  Token x;
470
  String y =  "[$,A-Z,_,a-z]([$,A-Z,_,a-z]|[0-9])*";
471
    if (jj_2_26(2)) {
472
      jj_consume_token(OPEN_SQ_BRACKETS);
473
      x = jj_consume_token(IDENTIFIER);
474
      jj_consume_token(CLOSE_SQ_BRACKETS);
475
    ReplaceOperator func = new ReplaceOperator(symbols);
476
     func.addArgument(x.image);
477
        stack.push(func);
478
        addClassName(x.image);
479
    } else if (jj_2_27(2)) {
480
      x = jj_consume_token(INTEGER);
481
        NumericalConstant intC = new NumericalConstant(Integer.valueOf(x.image),symbols);
482
        stack.push(intC);
483
    } else if (jj_2_28(2)) {
484
      x = jj_consume_token(FLOATING_POINT);
485
        NumericalConstant doubleC = new NumericalConstant(Double.valueOf(x.image),symbols);
486
        stack.push(doubleC);
487
    } else if (jj_2_29(2)) {
488
      x = jj_consume_token(STRING);
489
    StringConstant stringValue = new StringConstant(x.image.substring(1, x.image.length()-1),symbols);
490
    stack.push(stringValue);
491
    } else if (jj_2_30(2)) {
492
      x = jj_consume_token(BOOLEAN);
493
    BooleanConstant boolValue = new BooleanConstant(x.image,symbols);
494
    stack.push(boolValue);
495
    } else if (jj_2_31(2)) {
496
      x = jj_consume_token(NULL);
497
        NullConstant nullValue = new NullConstant(symbols);
498
    stack.push(nullValue);
499
    } else if (jj_2_32(2)) {
500
      function();
501
    } else if (jj_2_33(2)) {
502
      jj_consume_token(OPEN_PARENTHESIS);
503
      Expression();
504
      jj_consume_token(CLOSE_PARENTHESIS);
505
    } else {
506
      jj_consume_token(-1);
507
      throw new ParseException();
508
    }
509
  }
510

    
511
  final public void function() throws ParseException {
512
  String functionName;
513
  int argCount = 0;
514
  Expression function;
515
  Token x;
516
    if (jj_2_34(2)) {
517
      jj_consume_token(IDENTIFIER);
518
    functionName = token.image;
519
      argCount = Arguments();
520
    try {
521
        function = (Expression) operators.functions.get(functionName).getConstructor(new Class[] { Hashtable.class }).newInstance( new Hashtable<String, Value>());
522
    }
523
    catch (Exception e){
524
      {if (true) throw new ParseException("Problem with function '"+functionName+"': "+e.toString());}
525
    }
526
    if (function == null){if (true) throw new ParseException("Nonexisting function name '"+functionName+"'");}
527
    for (int i = 0;
528
    i<argCount;
529
    i++){
530
      Expression arg = (Expression)stack.pop();
531
      function.addArgument(0, arg);
532
    }
533
    stack.push(function);
534
    } else if (jj_2_35(2)) {
535
      x = jj_consume_token(IDENTIFIER);
536
    StringConstant stringValue = new StringConstant(x.image,symbols);
537
    stack.push(stringValue);
538
    } else {
539
      jj_consume_token(-1);
540
      throw new ParseException();
541
    }
542
  }
543

    
544
  final public int Arguments() throws ParseException {
545
  int argCount = 0;
546
    jj_consume_token(OPEN_PARENTHESIS);
547
    if (jj_2_36(2)) {
548
      argCount = ArgumentList();
549
    } else {
550
      ;
551
    }
552
    jj_consume_token(CLOSE_PARENTHESIS);
553
    {if (true) return argCount;}
554
    throw new Error("Missing return statement in function");
555
  }
556

    
557
  final public int ArgumentList() throws ParseException {
558
  int argCount = 0;
559
    Expression();
560
    argCount++;
561
    label_8:
562
    while (true) {
563
      if (jj_2_37(2)) {
564
        ;
565
      } else {
566
        break label_8;
567
      }
568
      jj_consume_token(COMMA);
569
      Expression();
570
    argCount++;
571
    }
572
    {if (true) return argCount;}
573
    throw new Error("Missing return statement in function");
574
  }
575

    
576
  final private boolean jj_2_1(int xla) {
577
    jj_la = xla; jj_lastpos = jj_scanpos = token;
578
    try { return !jj_3_1(); }
579
    catch(LookaheadSuccess ls) { return true; }
580
    finally { jj_save(0, xla); }
581
  }
582

    
583
  final private boolean jj_2_2(int xla) {
584
    jj_la = xla; jj_lastpos = jj_scanpos = token;
585
    try { return !jj_3_2(); }
586
    catch(LookaheadSuccess ls) { return true; }
587
    finally { jj_save(1, xla); }
588
  }
589

    
590
  final private boolean jj_2_3(int xla) {
591
    jj_la = xla; jj_lastpos = jj_scanpos = token;
592
    try { return !jj_3_3(); }
593
    catch(LookaheadSuccess ls) { return true; }
594
    finally { jj_save(2, xla); }
595
  }
596

    
597
  final private boolean jj_2_4(int xla) {
598
    jj_la = xla; jj_lastpos = jj_scanpos = token;
599
    try { return !jj_3_4(); }
600
    catch(LookaheadSuccess ls) { return true; }
601
    finally { jj_save(3, xla); }
602
  }
603

    
604
  final private boolean jj_2_5(int xla) {
605
    jj_la = xla; jj_lastpos = jj_scanpos = token;
606
    try { return !jj_3_5(); }
607
    catch(LookaheadSuccess ls) { return true; }
608
    finally { jj_save(4, xla); }
609
  }
610

    
611
  final private boolean jj_2_6(int xla) {
612
    jj_la = xla; jj_lastpos = jj_scanpos = token;
613
    try { return !jj_3_6(); }
614
    catch(LookaheadSuccess ls) { return true; }
615
    finally { jj_save(5, xla); }
616
  }
617

    
618
  final private boolean jj_2_7(int xla) {
619
    jj_la = xla; jj_lastpos = jj_scanpos = token;
620
    try { return !jj_3_7(); }
621
    catch(LookaheadSuccess ls) { return true; }
622
    finally { jj_save(6, xla); }
623
  }
624

    
625
  final private boolean jj_2_8(int xla) {
626
    jj_la = xla; jj_lastpos = jj_scanpos = token;
627
    try { return !jj_3_8(); }
628
    catch(LookaheadSuccess ls) { return true; }
629
    finally { jj_save(7, xla); }
630
  }
631

    
632
  final private boolean jj_2_9(int xla) {
633
    jj_la = xla; jj_lastpos = jj_scanpos = token;
634
    try { return !jj_3_9(); }
635
    catch(LookaheadSuccess ls) { return true; }
636
    finally { jj_save(8, xla); }
637
  }
638

    
639
  final private boolean jj_2_10(int xla) {
640
    jj_la = xla; jj_lastpos = jj_scanpos = token;
641
    try { return !jj_3_10(); }
642
    catch(LookaheadSuccess ls) { return true; }
643
    finally { jj_save(9, xla); }
644
  }
645

    
646
  final private boolean jj_2_11(int xla) {
647
    jj_la = xla; jj_lastpos = jj_scanpos = token;
648
    try { return !jj_3_11(); }
649
    catch(LookaheadSuccess ls) { return true; }
650
    finally { jj_save(10, xla); }
651
  }
652

    
653
  final private boolean jj_2_12(int xla) {
654
    jj_la = xla; jj_lastpos = jj_scanpos = token;
655
    try { return !jj_3_12(); }
656
    catch(LookaheadSuccess ls) { return true; }
657
    finally { jj_save(11, xla); }
658
  }
659

    
660
  final private boolean jj_2_13(int xla) {
661
    jj_la = xla; jj_lastpos = jj_scanpos = token;
662
    try { return !jj_3_13(); }
663
    catch(LookaheadSuccess ls) { return true; }
664
    finally { jj_save(12, xla); }
665
  }
666

    
667
  final private boolean jj_2_14(int xla) {
668
    jj_la = xla; jj_lastpos = jj_scanpos = token;
669
    try { return !jj_3_14(); }
670
    catch(LookaheadSuccess ls) { return true; }
671
    finally { jj_save(13, xla); }
672
  }
673

    
674
  final private boolean jj_2_15(int xla) {
675
    jj_la = xla; jj_lastpos = jj_scanpos = token;
676
    try { return !jj_3_15(); }
677
    catch(LookaheadSuccess ls) { return true; }
678
    finally { jj_save(14, xla); }
679
  }
680

    
681
  final private boolean jj_2_16(int xla) {
682
    jj_la = xla; jj_lastpos = jj_scanpos = token;
683
    try { return !jj_3_16(); }
684
    catch(LookaheadSuccess ls) { return true; }
685
    finally { jj_save(15, xla); }
686
  }
687

    
688
  final private boolean jj_2_17(int xla) {
689
    jj_la = xla; jj_lastpos = jj_scanpos = token;
690
    try { return !jj_3_17(); }
691
    catch(LookaheadSuccess ls) { return true; }
692
    finally { jj_save(16, xla); }
693
  }
694

    
695
  final private boolean jj_2_18(int xla) {
696
    jj_la = xla; jj_lastpos = jj_scanpos = token;
697
    try { return !jj_3_18(); }
698
    catch(LookaheadSuccess ls) { return true; }
699
    finally { jj_save(17, xla); }
700
  }
701

    
702
  final private boolean jj_2_19(int xla) {
703
    jj_la = xla; jj_lastpos = jj_scanpos = token;
704
    try { return !jj_3_19(); }
705
    catch(LookaheadSuccess ls) { return true; }
706
    finally { jj_save(18, xla); }
707
  }
708

    
709
  final private boolean jj_2_20(int xla) {
710
    jj_la = xla; jj_lastpos = jj_scanpos = token;
711
    try { return !jj_3_20(); }
712
    catch(LookaheadSuccess ls) { return true; }
713
    finally { jj_save(19, xla); }
714
  }
715

    
716
  final private boolean jj_2_21(int xla) {
717
    jj_la = xla; jj_lastpos = jj_scanpos = token;
718
    try { return !jj_3_21(); }
719
    catch(LookaheadSuccess ls) { return true; }
720
    finally { jj_save(20, xla); }
721
  }
722

    
723
  final private boolean jj_2_22(int xla) {
724
    jj_la = xla; jj_lastpos = jj_scanpos = token;
725
    try { return !jj_3_22(); }
726
    catch(LookaheadSuccess ls) { return true; }
727
    finally { jj_save(21, xla); }
728
  }
729

    
730
  final private boolean jj_2_23(int xla) {
731
    jj_la = xla; jj_lastpos = jj_scanpos = token;
732
    try { return !jj_3_23(); }
733
    catch(LookaheadSuccess ls) { return true; }
734
    finally { jj_save(22, xla); }
735
  }
736

    
737
  final private boolean jj_2_24(int xla) {
738
    jj_la = xla; jj_lastpos = jj_scanpos = token;
739
    try { return !jj_3_24(); }
740
    catch(LookaheadSuccess ls) { return true; }
741
    finally { jj_save(23, xla); }
742
  }
743

    
744
  final private boolean jj_2_25(int xla) {
745
    jj_la = xla; jj_lastpos = jj_scanpos = token;
746
    try { return !jj_3_25(); }
747
    catch(LookaheadSuccess ls) { return true; }
748
    finally { jj_save(24, xla); }
749
  }
750

    
751
  final private boolean jj_2_26(int xla) {
752
    jj_la = xla; jj_lastpos = jj_scanpos = token;
753
    try { return !jj_3_26(); }
754
    catch(LookaheadSuccess ls) { return true; }
755
    finally { jj_save(25, xla); }
756
  }
757

    
758
  final private boolean jj_2_27(int xla) {
759
    jj_la = xla; jj_lastpos = jj_scanpos = token;
760
    try { return !jj_3_27(); }
761
    catch(LookaheadSuccess ls) { return true; }
762
    finally { jj_save(26, xla); }
763
  }
764

    
765
  final private boolean jj_2_28(int xla) {
766
    jj_la = xla; jj_lastpos = jj_scanpos = token;
767
    try { return !jj_3_28(); }
768
    catch(LookaheadSuccess ls) { return true; }
769
    finally { jj_save(27, xla); }
770
  }
771

    
772
  final private boolean jj_2_29(int xla) {
773
    jj_la = xla; jj_lastpos = jj_scanpos = token;
774
    try { return !jj_3_29(); }
775
    catch(LookaheadSuccess ls) { return true; }
776
    finally { jj_save(28, xla); }
777
  }
778

    
779
  final private boolean jj_2_30(int xla) {
780
    jj_la = xla; jj_lastpos = jj_scanpos = token;
781
    try { return !jj_3_30(); }
782
    catch(LookaheadSuccess ls) { return true; }
783
    finally { jj_save(29, xla); }
784
  }
785

    
786
  final private boolean jj_2_31(int xla) {
787
    jj_la = xla; jj_lastpos = jj_scanpos = token;
788
    try { return !jj_3_31(); }
789
    catch(LookaheadSuccess ls) { return true; }
790
    finally { jj_save(30, xla); }
791
  }
792

    
793
  final private boolean jj_2_32(int xla) {
794
    jj_la = xla; jj_lastpos = jj_scanpos = token;
795
    try { return !jj_3_32(); }
796
    catch(LookaheadSuccess ls) { return true; }
797
    finally { jj_save(31, xla); }
798
  }
799

    
800
  final private boolean jj_2_33(int xla) {
801
    jj_la = xla; jj_lastpos = jj_scanpos = token;
802
    try { return !jj_3_33(); }
803
    catch(LookaheadSuccess ls) { return true; }
804
    finally { jj_save(32, xla); }
805
  }
806

    
807
  final private boolean jj_2_34(int xla) {
808
    jj_la = xla; jj_lastpos = jj_scanpos = token;
809
    try { return !jj_3_34(); }
810
    catch(LookaheadSuccess ls) { return true; }
811
    finally { jj_save(33, xla); }
812
  }
813

    
814
  final private boolean jj_2_35(int xla) {
815
    jj_la = xla; jj_lastpos = jj_scanpos = token;
816
    try { return !jj_3_35(); }
817
    catch(LookaheadSuccess ls) { return true; }
818
    finally { jj_save(34, xla); }
819
  }
820

    
821
  final private boolean jj_2_36(int xla) {
822
    jj_la = xla; jj_lastpos = jj_scanpos = token;
823
    try { return !jj_3_36(); }
824
    catch(LookaheadSuccess ls) { return true; }
825
    finally { jj_save(35, xla); }
826
  }
827

    
828
  final private boolean jj_2_37(int xla) {
829
    jj_la = xla; jj_lastpos = jj_scanpos = token;
830
    try { return !jj_3_37(); }
831
    catch(LookaheadSuccess ls) { return true; }
832
    finally { jj_save(36, xla); }
833
  }
834

    
835
  final private boolean jj_3R_17() {
836
    Token xsp;
837
    xsp = jj_scanpos;
838
    if (jj_3_26()) {
839
    jj_scanpos = xsp;
840
    if (jj_3_27()) {
841
    jj_scanpos = xsp;
842
    if (jj_3_28()) {
843
    jj_scanpos = xsp;
844
    if (jj_3_29()) {
845
    jj_scanpos = xsp;
846
    if (jj_3_30()) {
847
    jj_scanpos = xsp;
848
    if (jj_3_31()) {
849
    jj_scanpos = xsp;
850
    if (jj_3_32()) {
851
    jj_scanpos = xsp;
852
    if (jj_3_33()) return true;
853
    }
854
    }
855
    }
856
    }
857
    }
858
    }
859
    }
860
    return false;
861
  }
862

    
863
  final private boolean jj_3R_10() {
864
    if (jj_3R_11()) return true;
865
    Token xsp;
866
    while (true) {
867
      xsp = jj_scanpos;
868
      if (jj_3_5()) { jj_scanpos = xsp; break; }
869
    }
870
    return false;
871
  }
872

    
873
  final private boolean jj_3_26() {
874
    if (jj_scan_token(OPEN_SQ_BRACKETS)) return true;
875
    if (jj_scan_token(IDENTIFIER)) return true;
876
    return false;
877
  }
878

    
879
  final private boolean jj_3_4() {
880
    if (jj_scan_token(OR)) return true;
881
    if (jj_3R_10()) return true;
882
    return false;
883
  }
884

    
885
  final private boolean jj_3_15() {
886
    if (jj_scan_token(PLUS)) return true;
887
    return false;
888
  }
889

    
890
  final private boolean jj_3_14() {
891
    Token xsp;
892
    xsp = jj_scanpos;
893
    if (jj_3_15()) {
894
    jj_scanpos = xsp;
895
    if (jj_3_16()) return true;
896
    }
897
    if (jj_3R_14()) return true;
898
    return false;
899
  }
900

    
901
  final private boolean jj_3R_16() {
902
    Token xsp;
903
    xsp = jj_scanpos;
904
    if (jj_3_24()) {
905
    jj_scanpos = xsp;
906
    if (jj_3_25()) return true;
907
    }
908
    return false;
909
  }
910

    
911
  final private boolean jj_3_36() {
912
    if (jj_3R_20()) return true;
913
    return false;
914
  }
915

    
916
  final private boolean jj_3_24() {
917
    if (jj_scan_token(NOT)) return true;
918
    if (jj_3R_15()) return true;
919
    return false;
920
  }
921

    
922
  final private boolean jj_3_25() {
923
    if (jj_3R_17()) return true;
924
    return false;
925
  }
926

    
927
  final private boolean jj_3_37() {
928
    if (jj_scan_token(COMMA)) return true;
929
    if (jj_3R_9()) return true;
930
    return false;
931
  }
932

    
933
  final private boolean jj_3R_9() {
934
    if (jj_3R_10()) return true;
935
    Token xsp;
936
    while (true) {
937
      xsp = jj_scanpos;
938
      if (jj_3_4()) { jj_scanpos = xsp; break; }
939
    }
940
    return false;
941
  }
942

    
943
  final private boolean jj_3R_20() {
944
    if (jj_3R_9()) return true;
945
    Token xsp;
946
    while (true) {
947
      xsp = jj_scanpos;
948
      if (jj_3_37()) { jj_scanpos = xsp; break; }
949
    }
950
    return false;
951
  }
952

    
953
  final private boolean jj_3_23() {
954
    if (jj_3R_16()) return true;
955
    return false;
956
  }
957

    
958
  final private boolean jj_3_3() {
959
    if (jj_3R_9()) return true;
960
    return false;
961
  }
962

    
963
  final private boolean jj_3R_19() {
964
    if (jj_scan_token(OPEN_PARENTHESIS)) return true;
965
    return false;
966
  }
967

    
968
  final private boolean jj_3_16() {
969
    if (jj_scan_token(MINUS)) return true;
970
    return false;
971
  }
972

    
973
  final private boolean jj_3R_13() {
974
    if (jj_3R_14()) return true;
975
    Token xsp;
976
    while (true) {
977
      xsp = jj_scanpos;
978
      if (jj_3_14()) { jj_scanpos = xsp; break; }
979
    }
980
    return false;
981
  }
982

    
983
  final private boolean jj_3_10() {
984
    if (jj_scan_token(LT)) return true;
985
    return false;
986
  }
987

    
988
  final private boolean jj_3_35() {
989
    if (jj_scan_token(IDENTIFIER)) return true;
990
    return false;
991
  }
992

    
993
  final private boolean jj_3_9() {
994
    Token xsp;
995
    xsp = jj_scanpos;
996
    if (jj_3_10()) {
997
    jj_scanpos = xsp;
998
    if (jj_3_11()) {
999
    jj_scanpos = xsp;
1000
    if (jj_3_12()) {
1001
    jj_scanpos = xsp;
1002
    if (jj_3_13()) return true;
1003
    }
1004
    }
1005
    }
1006
    if (jj_3R_13()) return true;
1007
    return false;
1008
  }
1009

    
1010
  final private boolean jj_3_1() {
1011
    Token xsp;
1012
    xsp = jj_scanpos;
1013
    if (jj_3_2()) {
1014
    jj_scanpos = xsp;
1015
    if (jj_3_3()) return true;
1016
    }
1017
    return false;
1018
  }
1019

    
1020
  final private boolean jj_3_2() {
1021
    if (jj_scan_token(EOFIELD)) return true;
1022
    if (jj_3R_9()) return true;
1023
    return false;
1024
  }
1025

    
1026
  final private boolean jj_3_21() {
1027
    if (jj_scan_token(MINUS)) return true;
1028
    return false;
1029
  }
1030

    
1031
  final private boolean jj_3_20() {
1032
    if (jj_scan_token(PLUS)) return true;
1033
    return false;
1034
  }
1035

    
1036
  final private boolean jj_3R_15() {
1037
    Token xsp;
1038
    xsp = jj_scanpos;
1039
    if (jj_3_22()) {
1040
    jj_scanpos = xsp;
1041
    if (jj_3_23()) return true;
1042
    }
1043
    return false;
1044
  }
1045

    
1046
  final private boolean jj_3_22() {
1047
    Token xsp;
1048
    xsp = jj_scanpos;
1049
    if (jj_3_20()) {
1050
    jj_scanpos = xsp;
1051
    if (jj_3_21()) return true;
1052
    }
1053
    if (jj_3R_15()) return true;
1054
    return false;
1055
  }
1056

    
1057
  final private boolean jj_3_18() {
1058
    if (jj_scan_token(MULTIPLY)) return true;
1059
    return false;
1060
  }
1061

    
1062
  final private boolean jj_3_17() {
1063
    Token xsp;
1064
    xsp = jj_scanpos;
1065
    if (jj_3_18()) {
1066
    jj_scanpos = xsp;
1067
    if (jj_3_19()) return true;
1068
    }
1069
    if (jj_3R_15()) return true;
1070
    return false;
1071
  }
1072

    
1073
  final private boolean jj_3_13() {
1074
    if (jj_scan_token(GE)) return true;
1075
    return false;
1076
  }
1077

    
1078
  final private boolean jj_3_12() {
1079
    if (jj_scan_token(GT)) return true;
1080
    return false;
1081
  }
1082

    
1083
  final private boolean jj_3_7() {
1084
    if (jj_scan_token(EQ)) return true;
1085
    return false;
1086
  }
1087

    
1088
  final private boolean jj_3_11() {
1089
    if (jj_scan_token(LE)) return true;
1090
    return false;
1091
  }
1092

    
1093
  final private boolean jj_3_6() {
1094
    Token xsp;
1095
    xsp = jj_scanpos;
1096
    if (jj_3_7()) {
1097
    jj_scanpos = xsp;
1098
    if (jj_3_8()) return true;
1099
    }
1100
    if (jj_3R_12()) return true;
1101
    return false;
1102
  }
1103

    
1104
  final private boolean jj_3R_18() {
1105
    Token xsp;
1106
    xsp = jj_scanpos;
1107
    if (jj_3_34()) {
1108
    jj_scanpos = xsp;
1109
    if (jj_3_35()) return true;
1110
    }
1111
    return false;
1112
  }
1113

    
1114
  final private boolean jj_3R_12() {
1115
    if (jj_3R_13()) return true;
1116
    Token xsp;
1117
    while (true) {
1118
      xsp = jj_scanpos;
1119
      if (jj_3_9()) { jj_scanpos = xsp; break; }
1120
    }
1121
    return false;
1122
  }
1123

    
1124
  final private boolean jj_3_34() {
1125
    if (jj_scan_token(IDENTIFIER)) return true;
1126
    if (jj_3R_19()) return true;
1127
    return false;
1128
  }
1129

    
1130
  final private boolean jj_3_19() {
1131
    if (jj_scan_token(DIVIDE)) return true;
1132
    return false;
1133
  }
1134

    
1135
  final private boolean jj_3_33() {
1136
    if (jj_scan_token(OPEN_PARENTHESIS)) return true;
1137
    if (jj_3R_9()) return true;
1138
    return false;
1139
  }
1140

    
1141
  final private boolean jj_3R_14() {
1142
    if (jj_3R_15()) return true;
1143
    Token xsp;
1144
    while (true) {
1145
      xsp = jj_scanpos;
1146
      if (jj_3_17()) { jj_scanpos = xsp; break; }
1147
    }
1148
    return false;
1149
  }
1150

    
1151
  final private boolean jj_3_32() {
1152
    if (jj_3R_18()) return true;
1153
    return false;
1154
  }
1155

    
1156
  final private boolean jj_3_31() {
1157
    if (jj_scan_token(NULL)) return true;
1158
    return false;
1159
  }
1160

    
1161
  final private boolean jj_3_30() {
1162
    if (jj_scan_token(BOOLEAN)) return true;
1163
    return false;
1164
  }
1165

    
1166
  final private boolean jj_3_8() {
1167
    if (jj_scan_token(NE)) return true;
1168
    return false;
1169
  }
1170

    
1171
  final private boolean jj_3_5() {
1172
    if (jj_scan_token(AND)) return true;
1173
    if (jj_3R_11()) return true;
1174
    return false;
1175
  }
1176

    
1177
  final private boolean jj_3R_11() {
1178
    if (jj_3R_12()) return true;
1179
    Token xsp;
1180
    while (true) {
1181
      xsp = jj_scanpos;
1182
      if (jj_3_6()) { jj_scanpos = xsp; break; }
1183
    }
1184
    return false;
1185
  }
1186

    
1187
  final private boolean jj_3_29() {
1188
    if (jj_scan_token(STRING)) return true;
1189
    return false;
1190
  }
1191

    
1192
  final private boolean jj_3_28() {
1193
    if (jj_scan_token(FLOATING_POINT)) return true;
1194
    return false;
1195
  }
1196

    
1197
  final private boolean jj_3_27() {
1198
    if (jj_scan_token(INTEGER)) return true;
1199
    return false;
1200
  }
1201

    
1202
  public LabelExpressionParserTokenManager token_source;
1203
  SimpleCharStream jj_input_stream;
1204
  public Token token, jj_nt;
1205
  private int jj_ntk;
1206
  private Token jj_scanpos, jj_lastpos;
1207
  private int jj_la;
1208
  public boolean lookingAhead = false;
1209
  private boolean jj_semLA;
1210
  private int jj_gen;
1211
  final private int[] jj_la1 = new int[0];
1212
  static private int[] jj_la1_0;
1213
  static private int[] jj_la1_1;
1214
  static {
1215
      jj_la1_0();
1216
      jj_la1_1();
1217
   }
1218
   private static void jj_la1_0() {
1219
      jj_la1_0 = new int[] {};
1220
   }
1221
   private static void jj_la1_1() {
1222
      jj_la1_1 = new int[] {};
1223
   }
1224
  final private JJCalls[] jj_2_rtns = new JJCalls[37];
1225
  private boolean jj_rescan = false;
1226
  private int jj_gc = 0;
1227

    
1228
  public LabelExpressionParser(java.io.InputStream stream) {
1229
     this(stream, null);
1230
  }
1231
  public LabelExpressionParser(java.io.InputStream stream, String encoding) {
1232
    try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
1233
    token_source = new LabelExpressionParserTokenManager(jj_input_stream);
1234
    token = new Token();
1235
    jj_ntk = -1;
1236
    jj_gen = 0;
1237
    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
1238
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
1239
  }
1240

    
1241
  public void ReInit(java.io.InputStream stream) {
1242
     ReInit(stream, null);
1243
  }
1244
  public void ReInit(java.io.InputStream stream, String encoding) {
1245
    try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
1246
    token_source.ReInit(jj_input_stream);
1247
    token = new Token();
1248
    jj_ntk = -1;
1249
    jj_gen = 0;
1250
    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
1251
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
1252
  }
1253

    
1254
  public LabelExpressionParser(java.io.Reader stream) {
1255
    jj_input_stream = new SimpleCharStream(stream, 1, 1);
1256
    token_source = new LabelExpressionParserTokenManager(jj_input_stream);
1257
    token = new Token();
1258
    jj_ntk = -1;
1259
    jj_gen = 0;
1260
    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
1261
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
1262
  }
1263

    
1264
  public void ReInit(java.io.Reader stream) {
1265
    jj_input_stream.ReInit(stream, 1, 1);
1266
    token_source.ReInit(jj_input_stream);
1267
    token = new Token();
1268
    jj_ntk = -1;
1269
    jj_gen = 0;
1270
    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
1271
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
1272
  }
1273

    
1274
  public LabelExpressionParser(LabelExpressionParserTokenManager tm) {
1275
    token_source = tm;
1276
    token = new Token();
1277
    jj_ntk = -1;
1278
    jj_gen = 0;
1279
    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
1280
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
1281
  }
1282

    
1283
  public void ReInit(LabelExpressionParserTokenManager tm) {
1284
    token_source = tm;
1285
    token = new Token();
1286
    jj_ntk = -1;
1287
    jj_gen = 0;
1288
    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
1289
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
1290
  }
1291

    
1292
  final private Token jj_consume_token(int kind) throws ParseException {
1293
    Token oldToken;
1294
    if ((oldToken = token).next != null) token = token.next;
1295
    else token = token.next = token_source.getNextToken();
1296
    jj_ntk = -1;
1297
    if (token.kind == kind) {
1298
      jj_gen++;
1299
      if (++jj_gc > 100) {
1300
        jj_gc = 0;
1301
        for (int i = 0; i < jj_2_rtns.length; i++) {
1302
          JJCalls c = jj_2_rtns[i];
1303
          while (c != null) {
1304
            if (c.gen < jj_gen) c.first = null;
1305
            c = c.next;
1306
          }
1307
        }
1308
      }
1309
      return token;
1310
    }
1311
    token = oldToken;
1312
    jj_kind = kind;
1313
    throw generateParseException();
1314
  }
1315

    
1316
  static private final class LookaheadSuccess extends java.lang.Error { }
1317
  final private LookaheadSuccess jj_ls = new LookaheadSuccess();
1318
  final private boolean jj_scan_token(int kind) {
1319
    if (jj_scanpos == jj_lastpos) {
1320
      jj_la--;
1321
      if (jj_scanpos.next == null) {
1322
        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
1323
      } else {
1324
        jj_lastpos = jj_scanpos = jj_scanpos.next;
1325
      }
1326
    } else {
1327
      jj_scanpos = jj_scanpos.next;
1328
    }
1329
    if (jj_rescan) {
1330
      int i = 0; Token tok = token;
1331
      while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
1332
      if (tok != null) jj_add_error_token(kind, i);
1333
    }
1334
    if (jj_scanpos.kind != kind) return true;
1335
    if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
1336
    return false;
1337
  }
1338

    
1339
  final public Token getNextToken() {
1340
    if (token.next != null) token = token.next;
1341
    else token = token.next = token_source.getNextToken();
1342
    jj_ntk = -1;
1343
    jj_gen++;
1344
    return token;
1345
  }
1346

    
1347
  final public Token getToken(int index) {
1348
    Token t = lookingAhead ? jj_scanpos : token;
1349
    for (int i = 0; i < index; i++) {
1350
      if (t.next != null) t = t.next;
1351
      else t = t.next = token_source.getNextToken();
1352
    }
1353
    return t;
1354
  }
1355

    
1356
  final private int jj_ntk() {
1357
    if ((jj_nt=token.next) == null)
1358
      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
1359
    else
1360
      return (jj_ntk = jj_nt.kind);
1361
  }
1362

    
1363
  private java.util.Vector jj_expentries = new java.util.Vector();
1364
  private int[] jj_expentry;
1365
  private int jj_kind = -1;
1366
  private int[] jj_lasttokens = new int[100];
1367
  private int jj_endpos;
1368

    
1369
  private void jj_add_error_token(int kind, int pos) {
1370
    if (pos >= 100) return;
1371
    if (pos == jj_endpos + 1) {
1372
      jj_lasttokens[jj_endpos++] = kind;
1373
    } else if (jj_endpos != 0) {
1374
      jj_expentry = new int[jj_endpos];
1375
      for (int i = 0; i < jj_endpos; i++) {
1376
        jj_expentry[i] = jj_lasttokens[i];
1377
      }
1378
      boolean exists = false;
1379
      for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
1380
        int[] oldentry = (int[])(e.nextElement());
1381
        if (oldentry.length == jj_expentry.length) {
1382
          exists = true;
1383
          for (int i = 0; i < jj_expentry.length; i++) {
1384
            if (oldentry[i] != jj_expentry[i]) {
1385
              exists = false;
1386
              break;
1387
            }
1388
          }
1389
          if (exists) break;
1390
        }
1391
      }
1392
      if (!exists) jj_expentries.addElement(jj_expentry);
1393
      if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
1394
    }
1395
  }
1396

    
1397
  public ParseException generateParseException() {
1398
    jj_expentries.removeAllElements();
1399
    boolean[] la1tokens = new boolean[37];
1400
    for (int i = 0; i < 37; i++) {
1401
      la1tokens[i] = false;
1402
    }
1403
    if (jj_kind >= 0) {
1404
      la1tokens[jj_kind] = true;
1405
      jj_kind = -1;
1406
    }
1407
    for (int i = 0; i < 0; i++) {
1408
      if (jj_la1[i] == jj_gen) {
1409
        for (int j = 0; j < 32; j++) {
1410
          if ((jj_la1_0[i] & (1<<j)) != 0) {
1411
            la1tokens[j] = true;
1412
          }
1413
          if ((jj_la1_1[i] & (1<<j)) != 0) {
1414
            la1tokens[32+j] = true;
1415
          }
1416
        }
1417
      }
1418
    }
1419
    for (int i = 0; i < 37; i++) {
1420
      if (la1tokens[i]) {
1421
        jj_expentry = new int[1];
1422
        jj_expentry[0] = i;
1423
        jj_expentries.addElement(jj_expentry);
1424
      }
1425
    }
1426
    jj_endpos = 0;
1427
    jj_rescan_token();
1428
    jj_add_error_token(0, 0);
1429
    int[][] exptokseq = new int[jj_expentries.size()][];
1430
    for (int i = 0; i < jj_expentries.size(); i++) {
1431
      exptokseq[i] = (int[])jj_expentries.elementAt(i);
1432
    }
1433
    return new ParseException(token, exptokseq, tokenImage);
1434
  }
1435

    
1436
  final public void enable_tracing() {
1437
  }
1438

    
1439
  final public void disable_tracing() {
1440
  }
1441

    
1442
  final private void jj_rescan_token() {
1443
    jj_rescan = true;
1444
    for (int i = 0; i < 37; i++) {
1445
    try {
1446
      JJCalls p = jj_2_rtns[i];
1447
      do {
1448
        if (p.gen > jj_gen) {
1449
          jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
1450
          switch (i) {
1451
            case 0: jj_3_1(); break;
1452
            case 1: jj_3_2(); break;
1453
            case 2: jj_3_3(); break;
1454
            case 3: jj_3_4(); break;
1455
            case 4: jj_3_5(); break;
1456
            case 5: jj_3_6(); break;
1457
            case 6: jj_3_7(); break;
1458
            case 7: jj_3_8(); break;
1459
            case 8: jj_3_9(); break;
1460
            case 9: jj_3_10(); break;
1461
            case 10: jj_3_11(); break;
1462
            case 11: jj_3_12(); break;
1463
            case 12: jj_3_13(); break;
1464
            case 13: jj_3_14(); break;
1465
            case 14: jj_3_15(); break;
1466
            case 15: jj_3_16(); break;
1467
            case 16: jj_3_17(); break;
1468
            case 17: jj_3_18(); break;
1469
            case 18: jj_3_19(); break;
1470
            case 19: jj_3_20(); break;
1471
            case 20: jj_3_21(); break;
1472
            case 21: jj_3_22(); break;
1473
            case 22: jj_3_23(); break;
1474
            case 23: jj_3_24(); break;
1475
            case 24: jj_3_25(); break;
1476
            case 25: jj_3_26(); break;
1477
            case 26: jj_3_27(); break;
1478
            case 27: jj_3_28(); break;
1479
            case 28: jj_3_29(); break;
1480
            case 29: jj_3_30(); break;
1481
            case 30: jj_3_31(); break;
1482
            case 31: jj_3_32(); break;
1483
            case 32: jj_3_33(); break;
1484
            case 33: jj_3_34(); break;
1485
            case 34: jj_3_35(); break;
1486
            case 35: jj_3_36(); break;
1487
            case 36: jj_3_37(); break;
1488
          }
1489
        }
1490
        p = p.next;
1491
      } while (p != null);
1492
      } catch(LookaheadSuccess ls) { }
1493
    }
1494
    jj_rescan = false;
1495
  }
1496

    
1497
  final private void jj_save(int index, int xla) {
1498
    JJCalls p = jj_2_rtns[index];
1499
    while (p.gen > jj_gen) {
1500
      if (p.next == null) { p = p.next = new JJCalls(); break; }
1501
      p = p.next;
1502
    }
1503
    p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
1504
  }
1505

    
1506
  static final class JJCalls {
1507
    int gen;
1508
    Token first;
1509
    int arg;
1510
    JJCalls next;
1511
  }
1512

    
1513
}