View Javadoc

    1   /* Generated By:JavaCC: Do not edit this line. SelectorParser.java */
    2   package org.codehaus.activemq.selector;
    3
    4   import java.io.*;
    5   import java.util.*;
    6
    7   import javax.jms.InvalidSelectorException;
    8
    9   import org.codehaus.activemq.filter.*;
    10
    11  /***
    12   * JMS Selector Parser generated by JavaCC
    13   *
    14   * Do not edit this .java file directly - it is autogenerated from SelectorParser.jj
    15   */
    16  public class SelectorParser implements SelectorParserConstants {
    17
    18      public SelectorParser() {
    19          this(new StringReader(""));
    20      }
    21
    22      public Filter parse(String sql) throws InvalidSelectorException {
    23          this.ReInit(new StringReader(sql));
    24
    25          try {
    26              return this.JmsSelector();
    27          }
    28          catch (TokenMgrError e) {
    29              throw new InvalidSelectorException(e.getMessage());
    30          }
    31          catch (ParseException e) {
    32              throw new InvalidSelectorException(e.getMessage());
    33          }
    34      }
    35
    36      private BooleanExpression asBooleanExpression(Expression value) throws ParseException  {
    37          if (value instanceof BooleanExpression) {
    38              return (BooleanExpression) value;
    39          }
    40          throw new ParseException("Expression will not result in a boolean value: " + value);
    41      }
    42
    43  // ----------------------------------------------------------------------------
    44  // Grammer
    45  // ----------------------------------------------------------------------------
    46    final public Filter JmsSelector() throws ParseException {
    47      Expression left=null;
    48      left = orExpression();
    49          if( left instanceof BooleanExpression )
    50                  {if (true) return new ExpressionFilter(left);}
    51          else
    52                  {if (true) throw new ParseException("Selector does not result in a boolean value: "+left);}
    53      throw new Error("Missing return statement in function");
    54    }
    55
    56    final public Expression orExpression() throws ParseException {
    57      Expression left;
    58      Expression right;
    59      left = andExpression();
    60      label_1:
    61      while (true) {
    62        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    63        case OR:
    64          ;
    65          break;
    66        default:
    67          break label_1;
    68        }
    69        jj_consume_token(OR);
    70        right = andExpression();
    71                  left = LogicExpression.createOR(asBooleanExpression(left), asBooleanExpression(right));
    72      }
    73          {if (true) return left;}
    74      throw new Error("Missing return statement in function");
    75    }
    76
    77    final public Expression andExpression() throws ParseException {
    78      Expression left;
    79      Expression right;
    80      left = equalityExpression();
    81      label_2:
    82      while (true) {
    83        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    84        case AND:
    85          ;
    86          break;
    87        default:
    88          break label_2;
    89        }
    90        jj_consume_token(AND);
    91        right = equalityExpression();
    92                  left = LogicExpression.createAND(asBooleanExpression(left), asBooleanExpression(right));
    93      }
    94          {if (true) return left;}
    95      throw new Error("Missing return statement in function");
    96    }
    97
    98    final public Expression equalityExpression() throws ParseException {
    99      Expression left;
    100     Expression right;
    101     left = comparisonExpression();
    102     label_3:
    103     while (true) {
    104       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    105       case IS:
    106       case 24:
    107       case 25:
    108         ;
    109         break;
    110       default:
    111         break label_3;
    112       }
    113       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    114       case 24:
    115         jj_consume_token(24);
    116         right = comparisonExpression();
    117                 left = ComparisonExpression.createEqual(left, right);
    118         break;
    119       case 25:
    120         jj_consume_token(25);
    121         right = comparisonExpression();
    122                 left = ComparisonExpression.createNotEqual(left, right);
    123         break;
    124       default:
    125         if (jj_2_1(2)) {
    126           jj_consume_token(IS);
    127           jj_consume_token(NULL);
    128                 left = ComparisonExpression.createIsNull(left);
    129         } else {
    130           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    131           case IS:
    132             jj_consume_token(IS);
    133             jj_consume_token(NOT);
    134             jj_consume_token(NULL);
    135                 left = ComparisonExpression.createIsNotNull(left);
    136             break;
    137           default:
    138             jj_consume_token(-1);
    139             throw new ParseException();
    140           }
    141         }
    142       }
    143     }
    144         {if (true) return left;}
    145     throw new Error("Missing return statement in function");
    146   }
    147
    148   final public Expression comparisonExpression() throws ParseException {
    149     Expression left;
    150     Expression right;
    151     Expression low;
    152     Expression high;
    153     String t, u;
    154         boolean not;
    155         ArrayList list;
    156     left = addExpression();
    157     label_4:
    158     while (true) {
    159       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    160       case NOT:
    161       case BETWEEN:
    162       case LIKE:
    163       case IN:
    164       case 26:
    165       case 27:
    166       case 28:
    167       case 29:
    168         ;
    169         break;
    170       default:
    171         break label_4;
    172       }
    173       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    174       case 26:
    175         jj_consume_token(26);
    176         right = addExpression();
    177                     left = ComparisonExpression.createGreaterThan(left, right);
    178         break;
    179       case 27:
    180         jj_consume_token(27);
    181         right = addExpression();
    182                     left = ComparisonExpression.createGreaterThanEqual(left, right);
    183         break;
    184       case 28:
    185         jj_consume_token(28);
    186         right = addExpression();
    187                     left = ComparisonExpression.createLessThan(left, right);
    188         break;
    189       case 29:
    190         jj_consume_token(29);
    191         right = addExpression();
    192                     left = ComparisonExpression.createLessThanEqual(left, right);
    193         break;
    194       case LIKE:
    195                                         u=null;
    196         jj_consume_token(LIKE);
    197         t = stringLitteral();
    198         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    199         case ESCAPE:
    200           jj_consume_token(ESCAPE);
    201           u = stringLitteral();
    202           break;
    203         default:
    204           ;
    205         }
    206                     left = ComparisonExpression.createLike(left, t, u);
    207         break;
    208       default:
    209         if (jj_2_2(2)) {
    210                                         u=null;
    211           jj_consume_token(NOT);
    212           jj_consume_token(LIKE);
    213           t = stringLitteral();
    214           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    215           case ESCAPE:
    216             jj_consume_token(ESCAPE);
    217             u = stringLitteral();
    218             break;
    219           default:
    220             ;
    221           }
    222                     left = ComparisonExpression.createNotLike(left, t, u);
    223         } else {
    224           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    225           case BETWEEN:
    226             jj_consume_token(BETWEEN);
    227             low = addExpression();
    228             jj_consume_token(AND);
    229             high = addExpression();
    230                                         left = ComparisonExpression.createBetween(left, low, high);
    231             break;
    232           default:
    233             if (jj_2_3(2)) {
    234               jj_consume_token(NOT);
    235               jj_consume_token(BETWEEN);
    236               low = addExpression();
    237               jj_consume_token(AND);
    238               high = addExpression();
    239                                         left = ComparisonExpression.createNotBetween(left, low, high);
    240             } else {
    241               switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    242               case IN:
    243                 jj_consume_token(IN);
    244                 jj_consume_token(30);
    245                 right = literal();
    246                                     list = new ArrayList();
    247                                     list.add( right );
    248                 label_5:
    249                 while (true) {
    250                   switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    251                   case 31:
    252                     ;
    253                     break;
    254                   default:
    255                     break label_5;
    256                   }
    257                   jj_consume_token(31);
    258                   right = literal();
    259                                             list.add( right );
    260                 }
    261                 jj_consume_token(32);
    262                            left = ComparisonExpression.createInFilter(left, list);
    263                 break;
    264               default:
    265                 if (jj_2_4(2)) {
    266                   jj_consume_token(NOT);
    267                   jj_consume_token(IN);
    268                   jj_consume_token(30);
    269                   right = literal();
    270                                     list = new ArrayList();
    271                                     list.add( right );
    272                   label_6:
    273                   while (true) {
    274                     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    275                     case 31:
    276                       ;
    277                       break;
    278                     default:
    279                       break label_6;
    280                     }
    281                     jj_consume_token(31);
    282                     right = literal();
    283                                             list.add( right );
    284                   }
    285                   jj_consume_token(32);
    286                            left = ComparisonExpression.createNotInFilter(left, list);
    287                 } else {
    288                   jj_consume_token(-1);
    289                   throw new ParseException();
    290                 }
    291               }
    292             }
    293           }
    294         }
    295       }
    296     }
    297         {if (true) return left;}
    298     throw new Error("Missing return statement in function");
    299   }
    300
    301   final public Expression addExpression() throws ParseException {
    302     Expression left;
    303     Expression right;
    304     left = multExpr();
    305     label_7:
    306     while (true) {
    307       if (jj_2_5(2147483647)) {
    308         ;
    309       } else {
    310         break label_7;
    311       }
    312       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    313       case 33:
    314         jj_consume_token(33);
    315         right = multExpr();
    316                     left = ArithmeticExpression.createPlus(left, right);
    317         break;
    318       case 34:
    319         jj_consume_token(34);
    320         right = multExpr();
    321                     left = ArithmeticExpression.createMinus(left, right);
    322         break;
    323       default:
    324         jj_consume_token(-1);
    325         throw new ParseException();
    326       }
    327     }
    328         {if (true) return left;}
    329     throw new Error("Missing return statement in function");
    330   }
    331
    332   final public Expression multExpr() throws ParseException {
    333     Expression left;
    334     Expression right;
    335     left = unaryExpr();
    336     label_8:
    337     while (true) {
    338       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    339       case 35:
    340       case 36:
    341       case 37:
    342         ;
    343         break;
    344       default:
    345         break label_8;
    346       }
    347       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    348       case 35:
    349         jj_consume_token(35);
    350         right = unaryExpr();
    351                 left = ArithmeticExpression.createMultiply(left, right);
    352         break;
    353       case 36:
    354         jj_consume_token(36);
    355         right = unaryExpr();
    356                 left = ArithmeticExpression.createDivide(left, right);
    357         break;
    358       case 37:
    359         jj_consume_token(37);
    360         right = unaryExpr();
    361                 left = ArithmeticExpression.createMod(left, right);
    362         break;
    363       default:
    364         jj_consume_token(-1);
    365         throw new ParseException();
    366       }
    367     }
    368         {if (true) return left;}
    369     throw new Error("Missing return statement in function");
    370   }
    371
    372   final public Expression unaryExpr() throws ParseException {
    373     Expression left=null;
    374     if (jj_2_6(2147483647)) {
    375       jj_consume_token(33);
    376       left = unaryExpr();
    377     } else {
    378       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    379       case 34:
    380         jj_consume_token(34);
    381         left = unaryExpr();
    382                 left = UnaryExpression.createNegate(left);
    383         break;
    384       case NOT:
    385         jj_consume_token(NOT);
    386         left = unaryExpr();
    387                     left = UnaryExpression.createNOT( asBooleanExpression(left) );
    388         break;
    389       case TRUE:
    390       case FALSE:
    391       case NULL:
    392       case INTEGER_LITERAL:
    393       case FLOATING_POINT_LITERAL:
    394       case STRING_LITERAL:
    395       case ID:
    396       case 30:
    397         left = primaryExpr();
    398         break;
    399       default:
    400         jj_consume_token(-1);
    401         throw new ParseException();
    402       }
    403     }
    404         {if (true) return left;}
    405     throw new Error("Missing return statement in function");
    406   }
    407
    408   final public Expression primaryExpr() throws ParseException {
    409     Expression left=null;
    410     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    411     case TRUE:
    412     case FALSE:
    413     case NULL:
    414     case INTEGER_LITERAL:
    415     case FLOATING_POINT_LITERAL:
    416     case STRING_LITERAL:
    417       left = literal();
    418       break;
    419     case ID:
    420       left = variable();
    421       break;
    422     case 30:
    423       jj_consume_token(30);
    424       left = orExpression();
    425       jj_consume_token(32);
    426       break;
    427     default:
    428       jj_consume_token(-1);
    429       throw new ParseException();
    430     }
    431         {if (true) return left;}
    432     throw new Error("Missing return statement in function");
    433   }
    434
    435   final public ConstantExpression literal() throws ParseException {
    436     Token t;
    437     String s;
    438     ConstantExpression left=null;
    439     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    440     case STRING_LITERAL:
    441       s = stringLitteral();
    442                 left = new ConstantExpression(s);
    443       break;
    444     case INTEGER_LITERAL:
    445       t = jj_consume_token(INTEGER_LITERAL);
    446                 left = ConstantExpression.createInteger(t.image);
    447       break;
    448     case FLOATING_POINT_LITERAL:
    449       t = jj_consume_token(FLOATING_POINT_LITERAL);
    450                 left = ConstantExpression.createFloat(t.image);
    451       break;
    452     case TRUE:
    453       jj_consume_token(TRUE);
    454                 left = ConstantExpression.TRUE;
    455       break;
    456     case FALSE:
    457       jj_consume_token(FALSE);
    458                 left = ConstantExpression.FALSE;
    459       break;
    460     case NULL:
    461       jj_consume_token(NULL);
    462                 left = ConstantExpression.NULL;
    463       break;
    464     default:
    465       jj_consume_token(-1);
    466       throw new ParseException();
    467     }
    468         {if (true) return left;}
    469     throw new Error("Missing return statement in function");
    470   }
    471
    472   final public String stringLitteral() throws ParseException {
    473     Token t;
    474     StringBuffer rc = new StringBuffer();
    475     boolean first=true;
    476     t = jj_consume_token(STRING_LITERAL);
    477         // Decode the sting value.
    478         String image = t.image;
    479         for( int i=1; i < image.length()-1; i++ ) {
    480                 char c = image.charAt(i);
    481                 if( c == '\'' )
    482                         i++;
    483                         rc.append(c);
    484         }
    485             {if (true) return rc.toString();}
    486     throw new Error("Missing return statement in function");
    487   }
    488
    489   final public PropertyExpression variable() throws ParseException {
    490     Token t;
    491     PropertyExpression left=null;
    492     t = jj_consume_token(ID);
    493             left = new PropertyExpression(t.image);
    494         {if (true) return left;}
    495     throw new Error("Missing return statement in function");
    496   }
    497
    498   final private boolean jj_2_1(int xla) {
    499     jj_la = xla; jj_lastpos = jj_scanpos = token;
    500     return !jj_3_1();
    501   }
    502
    503   final private boolean jj_2_2(int xla) {
    504     jj_la = xla; jj_lastpos = jj_scanpos = token;
    505     return !jj_3_2();
    506   }
    507
    508   final private boolean jj_2_3(int xla) {
    509     jj_la = xla; jj_lastpos = jj_scanpos = token;
    510     return !jj_3_3();
    511   }
    512
    513   final private boolean jj_2_4(int xla) {
    514     jj_la = xla; jj_lastpos = jj_scanpos = token;
    515     return !jj_3_4();
    516   }
    517
    518   final private boolean jj_2_5(int xla) {
    519     jj_la = xla; jj_lastpos = jj_scanpos = token;
    520     return !jj_3_5();
    521   }
    522
    523   final private boolean jj_2_6(int xla) {
    524     jj_la = xla; jj_lastpos = jj_scanpos = token;
    525     return !jj_3_6();
    526   }
    527
    528   final private boolean jj_3R_54() {
    529     if (jj_scan_token(33)) return true;
    530     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    531     if (jj_3R_11()) return true;
    532     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    533     return false;
    534   }
    535
    536   final private boolean jj_3R_49() {
    537     if (jj_scan_token(28)) return true;
    538     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    539     if (jj_3R_41()) return true;
    540     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    541     return false;
    542   }
    543
    544   final private boolean jj_3R_28() {
    545     if (jj_3R_36()) return true;
    546     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    547     return false;
    548   }
    549
    550   final private boolean jj_3R_59() {
    551     if (jj_scan_token(31)) return true;
    552     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    553     if (jj_3R_25()) return true;
    554     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    555     return false;
    556   }
    557
    558   final private boolean jj_3R_46() {
    559     Token xsp;
    560     xsp = jj_scanpos;
    561     if (jj_3R_54()) {
    562     jj_scanpos = xsp;
    563     if (jj_3R_55()) return true;
    564     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    565     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    566     return false;
    567   }
    568
    569   final private boolean jj_3R_35() {
    570     if (jj_scan_token(OR)) return true;
    571     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    572     if (jj_3R_34()) return true;
    573     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    574     return false;
    575   }
    576
    577   final private boolean jj_3R_48() {
    578     if (jj_scan_token(27)) return true;
    579     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    580     if (jj_3R_41()) return true;
    581     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    582     return false;
    583   }
    584
    585   final private boolean jj_3R_25() {
    586     Token xsp;
    587     xsp = jj_scanpos;
    588     if (jj_3R_28()) {
    589     jj_scanpos = xsp;
    590     if (jj_3R_29()) {
    591     jj_scanpos = xsp;
    592     if (jj_3R_30()) {
    593     jj_scanpos = xsp;
    594     if (jj_3R_31()) {
    595     jj_scanpos = xsp;
    596     if (jj_3R_32()) {
    597     jj_scanpos = xsp;
    598     if (jj_3R_33()) return true;
    599     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    600     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    601     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    602     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    603     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    604     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    605     return false;
    606   }
    607
    608   final private boolean jj_3R_47() {
    609     if (jj_scan_token(26)) return true;
    610     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    611     if (jj_3R_41()) return true;
    612     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    613     return false;
    614   }
    615
    616   final private boolean jj_3R_42() {
    617     Token xsp;
    618     xsp = jj_scanpos;
    619     if (jj_3R_47()) {
    620     jj_scanpos = xsp;
    621     if (jj_3R_48()) {
    622     jj_scanpos = xsp;
    623     if (jj_3R_49()) {
    624     jj_scanpos = xsp;
    625     if (jj_3R_50()) {
    626     jj_scanpos = xsp;
    627     if (jj_3R_51()) {
    628     jj_scanpos = xsp;
    629     if (jj_3_2()) {
    630     jj_scanpos = xsp;
    631     if (jj_3R_52()) {
    632     jj_scanpos = xsp;
    633     if (jj_3_3()) {
    634     jj_scanpos = xsp;
    635     if (jj_3R_53()) {
    636     jj_scanpos = xsp;
    637     if (jj_3_4()) return true;
    638     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    639     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    640     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    641     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    642     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    643     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    644     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    645     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    646     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    647     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    648     return false;
    649   }
    650
    651   final private boolean jj_3R_41() {
    652     if (jj_3R_11()) return true;
    653     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    654     Token xsp;
    655     while (true) {
    656       xsp = jj_scanpos;
    657       if (jj_3R_46()) { jj_scanpos = xsp; break; }
    658       if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    659     }
    660     return false;
    661   }
    662
    663   final private boolean jj_3R_27() {
    664     if (jj_3R_34()) return true;
    665     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    666     Token xsp;
    667     while (true) {
    668       xsp = jj_scanpos;
    669       if (jj_3R_35()) { jj_scanpos = xsp; break; }
    670       if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    671     }
    672     return false;
    673   }
    674
    675   final private boolean jj_3R_24() {
    676     if (jj_scan_token(30)) return true;
    677     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    678     if (jj_3R_27()) return true;
    679     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    680     if (jj_scan_token(32)) return true;
    681     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    682     return false;
    683   }
    684
    685   final private boolean jj_3R_23() {
    686     if (jj_3R_26()) return true;
    687     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    688     return false;
    689   }
    690
    691   final private boolean jj_3R_22() {
    692     if (jj_3R_25()) return true;
    693     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    694     return false;
    695   }
    696
    697   final private boolean jj_3R_58() {
    698     if (jj_scan_token(31)) return true;
    699     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    700     if (jj_3R_25()) return true;
    701     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    702     return false;
    703   }
    704
    705   final private boolean jj_3R_26() {
    706     if (jj_scan_token(ID)) return true;
    707     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    708     return false;
    709   }
    710
    711   final private boolean jj_3R_39() {
    712     if (jj_3R_41()) return true;
    713     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    714     Token xsp;
    715     while (true) {
    716       xsp = jj_scanpos;
    717       if (jj_3R_42()) { jj_scanpos = xsp; break; }
    718       if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    719     }
    720     return false;
    721   }
    722
    723   final private boolean jj_3R_21() {
    724     Token xsp;
    725     xsp = jj_scanpos;
    726     if (jj_3R_22()) {
    727     jj_scanpos = xsp;
    728     if (jj_3R_23()) {
    729     jj_scanpos = xsp;
    730     if (jj_3R_24()) return true;
    731     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    732     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    733     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    734     return false;
    735   }
    736
    737   final private boolean jj_3R_57() {
    738     if (jj_scan_token(ESCAPE)) return true;
    739     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    740     if (jj_3R_36()) return true;
    741     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    742     return false;
    743   }
    744
    745   final private boolean jj_3_4() {
    746     if (jj_scan_token(NOT)) return true;
    747     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    748     if (jj_scan_token(IN)) return true;
    749     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    750     if (jj_scan_token(30)) return true;
    751     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    752     if (jj_3R_25()) return true;
    753     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    754     Token xsp;
    755     while (true) {
    756       xsp = jj_scanpos;
    757       if (jj_3R_59()) { jj_scanpos = xsp; break; }
    758       if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    759     }
    760     if (jj_scan_token(32)) return true;
    761     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    762     return false;
    763   }
    764
    765   final private boolean jj_3_6() {
    766     if (jj_scan_token(33)) return true;
    767     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    768     if (jj_3R_12()) return true;
    769     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    770     return false;
    771   }
    772
    773   final private boolean jj_3R_17() {
    774     if (jj_3R_21()) return true;
    775     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    776     return false;
    777   }
    778
    779   final private boolean jj_3R_16() {
    780     if (jj_scan_token(NOT)) return true;
    781     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    782     if (jj_3R_12()) return true;
    783     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    784     return false;
    785   }
    786
    787   final private boolean jj_3R_53() {
    788     if (jj_scan_token(IN)) return true;
    789     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    790     if (jj_scan_token(30)) return true;
    791     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    792     if (jj_3R_25()) return true;
    793     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    794     Token xsp;
    795     while (true) {
    796       xsp = jj_scanpos;
    797       if (jj_3R_58()) { jj_scanpos = xsp; break; }
    798       if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    799     }
    800     if (jj_scan_token(32)) return true;
    801     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    802     return false;
    803   }
    804
    805   final private boolean jj_3R_45() {
    806     if (jj_scan_token(IS)) return true;
    807     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    808     if (jj_scan_token(NOT)) return true;
    809     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    810     if (jj_scan_token(NULL)) return true;
    811     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    812     return false;
    813   }
    814
    815   final private boolean jj_3R_14() {
    816     if (jj_scan_token(33)) return true;
    817     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    818     if (jj_3R_12()) return true;
    819     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    820     return false;
    821   }
    822
    823   final private boolean jj_3R_15() {
    824     if (jj_scan_token(34)) return true;
    825     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    826     if (jj_3R_12()) return true;
    827     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    828     return false;
    829   }
    830
    831   final private boolean jj_3R_36() {
    832     if (jj_scan_token(STRING_LITERAL)) return true;
    833     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    834     return false;
    835   }
    836
    837   final private boolean jj_3_1() {
    838     if (jj_scan_token(IS)) return true;
    839     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    840     if (jj_scan_token(NULL)) return true;
    841     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    842     return false;
    843   }
    844
    845   final private boolean jj_3R_12() {
    846     Token xsp;
    847     xsp = jj_scanpos;
    848     if (jj_3R_14()) {
    849     jj_scanpos = xsp;
    850     if (jj_3R_15()) {
    851     jj_scanpos = xsp;
    852     if (jj_3R_16()) {
    853     jj_scanpos = xsp;
    854     if (jj_3R_17()) return true;
    855     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    856     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    857     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    858     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    859     return false;
    860   }
    861
    862   final private boolean jj_3R_44() {
    863     if (jj_scan_token(25)) return true;
    864     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    865     if (jj_3R_39()) return true;
    866     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    867     return false;
    868   }
    869
    870   final private boolean jj_3_3() {
    871     if (jj_scan_token(NOT)) return true;
    872     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    873     if (jj_scan_token(BETWEEN)) return true;
    874     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    875     if (jj_3R_41()) return true;
    876     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    877     if (jj_scan_token(AND)) return true;
    878     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    879     if (jj_3R_41()) return true;
    880     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    881     return false;
    882   }
    883
    884   final private boolean jj_3R_43() {
    885     if (jj_scan_token(24)) return true;
    886     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    887     if (jj_3R_39()) return true;
    888     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    889     return false;
    890   }
    891
    892   final private boolean jj_3R_40() {
    893     Token xsp;
    894     xsp = jj_scanpos;
    895     if (jj_3R_43()) {
    896     jj_scanpos = xsp;
    897     if (jj_3R_44()) {
    898     jj_scanpos = xsp;
    899     if (jj_3_1()) {
    900     jj_scanpos = xsp;
    901     if (jj_3R_45()) return true;
    902     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    903     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    904     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    905     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    906     return false;
    907   }
    908
    909   final private boolean jj_3R_52() {
    910     if (jj_scan_token(BETWEEN)) return true;
    911     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    912     if (jj_3R_41()) return true;
    913     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    914     if (jj_scan_token(AND)) return true;
    915     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    916     if (jj_3R_41()) return true;
    917     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    918     return false;
    919   }
    920
    921   final private boolean jj_3R_33() {
    922     if (jj_scan_token(NULL)) return true;
    923     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    924     return false;
    925   }
    926
    927   final private boolean jj_3R_56() {
    928     if (jj_scan_token(ESCAPE)) return true;
    929     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    930     if (jj_3R_36()) return true;
    931     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    932     return false;
    933   }
    934
    935   final private boolean jj_3R_20() {
    936     if (jj_scan_token(37)) return true;
    937     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    938     if (jj_3R_12()) return true;
    939     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    940     return false;
    941   }
    942
    943   final private boolean jj_3R_32() {
    944     if (jj_scan_token(FALSE)) return true;
    945     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    946     return false;
    947   }
    948
    949   final private boolean jj_3R_37() {
    950     if (jj_3R_39()) return true;
    951     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    952     Token xsp;
    953     while (true) {
    954       xsp = jj_scanpos;
    955       if (jj_3R_40()) { jj_scanpos = xsp; break; }
    956       if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    957     }
    958     return false;
    959   }
    960
    961   final private boolean jj_3_2() {
    962     if (jj_scan_token(NOT)) return true;
    963     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    964     if (jj_scan_token(LIKE)) return true;
    965     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    966     if (jj_3R_36()) return true;
    967     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    968     Token xsp;
    969     xsp = jj_scanpos;
    970     if (jj_3R_57()) jj_scanpos = xsp;
    971     else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    972     return false;
    973   }
    974
    975   final private boolean jj_3R_51() {
    976     if (jj_scan_token(LIKE)) return true;
    977     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    978     if (jj_3R_36()) return true;
    979     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    980     Token xsp;
    981     xsp = jj_scanpos;
    982     if (jj_3R_56()) jj_scanpos = xsp;
    983     else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    984     return false;
    985   }
    986
    987   final private boolean jj_3R_19() {
    988     if (jj_scan_token(36)) return true;
    989     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    990     if (jj_3R_12()) return true;
    991     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    992     return false;
    993   }
    994
    995   final private boolean jj_3R_31() {
    996     if (jj_scan_token(TRUE)) return true;
    997     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    998     return false;
    999   }
    1000
    1001   final private boolean jj_3R_18() {
    1002     if (jj_scan_token(35)) return true;
    1003     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1004     if (jj_3R_12()) return true;
    1005     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1006     return false;
    1007   }
    1008
    1009   final private boolean jj_3R_13() {
    1010     Token xsp;
    1011     xsp = jj_scanpos;
    1012     if (jj_3R_18()) {
    1013     jj_scanpos = xsp;
    1014     if (jj_3R_19()) {
    1015     jj_scanpos = xsp;
    1016     if (jj_3R_20()) return true;
    1017     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1018     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1019     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1020     return false;
    1021   }
    1022
    1023   final private boolean jj_3R_38() {
    1024     if (jj_scan_token(AND)) return true;
    1025     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1026     if (jj_3R_37()) return true;
    1027     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1028     return false;
    1029   }
    1030
    1031   final private boolean jj_3R_30() {
    1032     if (jj_scan_token(FLOATING_POINT_LITERAL)) return true;
    1033     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1034     return false;
    1035   }
    1036
    1037   final private boolean jj_3R_11() {
    1038     if (jj_3R_12()) return true;
    1039     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1040     Token xsp;
    1041     while (true) {
    1042       xsp = jj_scanpos;
    1043       if (jj_3R_13()) { jj_scanpos = xsp; break; }
    1044       if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1045     }
    1046     return false;
    1047   }
    1048
    1049   final private boolean jj_3R_10() {
    1050     if (jj_scan_token(34)) return true;
    1051     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1052     return false;
    1053   }
    1054
    1055   final private boolean jj_3R_9() {
    1056     if (jj_scan_token(33)) return true;
    1057     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1058     return false;
    1059   }
    1060
    1061   final private boolean jj_3R_55() {
    1062     if (jj_scan_token(34)) return true;
    1063     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1064     if (jj_3R_11()) return true;
    1065     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1066     return false;
    1067   }
    1068
    1069   final private boolean jj_3R_34() {
    1070     if (jj_3R_37()) return true;
    1071     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1072     Token xsp;
    1073     while (true) {
    1074       xsp = jj_scanpos;
    1075       if (jj_3R_38()) { jj_scanpos = xsp; break; }
    1076       if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1077     }
    1078     return false;
    1079   }
    1080
    1081   final private boolean jj_3_5() {
    1082     Token xsp;
    1083     xsp = jj_scanpos;
    1084     if (jj_3R_9()) {
    1085     jj_scanpos = xsp;
    1086     if (jj_3R_10()) return true;
    1087     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1088     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1089     if (jj_3R_11()) return true;
    1090     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1091     return false;
    1092   }
    1093
    1094   final private boolean jj_3R_29() {
    1095     if (jj_scan_token(INTEGER_LITERAL)) return true;
    1096     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1097     return false;
    1098   }
    1099
    1100   final private boolean jj_3R_50() {
    1101     if (jj_scan_token(29)) return true;
    1102     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1103     if (jj_3R_41()) return true;
    1104     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
    1105     return false;
    1106   }
    1107
    1108   public SelectorParserTokenManager token_source;
    1109   SimpleCharStream jj_input_stream;
    1110   public Token token, jj_nt;
    1111   private int jj_ntk;
    1112   private Token jj_scanpos, jj_lastpos;
    1113   private int jj_la;
    1114   public boolean lookingAhead = false;
    1115   private boolean jj_semLA;
    1116
    1117   public SelectorParser(java.io.InputStream stream) {
    1118     jj_input_stream = new SimpleCharStream(stream, 1, 1);
    1119     token_source = new SelectorParserTokenManager(jj_input_stream);
    1120     token = new Token();
    1121     jj_ntk = -1;
    1122   }
    1123
    1124   public void ReInit(java.io.InputStream stream) {
    1125     jj_input_stream.ReInit(stream, 1, 1);
    1126     token_source.ReInit(jj_input_stream);
    1127     token = new Token();
    1128     jj_ntk = -1;
    1129   }
    1130
    1131   public SelectorParser(java.io.Reader stream) {
    1132     jj_input_stream = new SimpleCharStream(stream, 1, 1);
    1133     token_source = new SelectorParserTokenManager(jj_input_stream);
    1134     token = new Token();
    1135     jj_ntk = -1;
    1136   }
    1137
    1138   public void ReInit(java.io.Reader stream) {
    1139     jj_input_stream.ReInit(stream, 1, 1);
    1140     token_source.ReInit(jj_input_stream);
    1141     token = new Token();
    1142     jj_ntk = -1;
    1143   }
    1144
    1145   public SelectorParser(SelectorParserTokenManager tm) {
    1146     token_source = tm;
    1147     token = new Token();
    1148     jj_ntk = -1;
    1149   }
    1150
    1151   public void ReInit(SelectorParserTokenManager tm) {
    1152     token_source = tm;
    1153     token = new Token();
    1154     jj_ntk = -1;
    1155   }
    1156
    1157   final private Token jj_consume_token(int kind) throws ParseException {
    1158     Token oldToken;
    1159     if ((oldToken = token).next != null) token = token.next;
    1160     else token = token.next = token_source.getNextToken();
    1161     jj_ntk = -1;
    1162     if (token.kind == kind) {
    1163       return token;
    1164     }
    1165     token = oldToken;
    1166     throw generateParseException();
    1167   }
    1168
    1169   final private boolean jj_scan_token(int kind) {
    1170     if (jj_scanpos == jj_lastpos) {
    1171       jj_la--;
    1172       if (jj_scanpos.next == null) {
    1173         jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
    1174       } else {
    1175         jj_lastpos = jj_scanpos = jj_scanpos.next;
    1176       }
    1177     } else {
    1178       jj_scanpos = jj_scanpos.next;
    1179     }
    1180     return (jj_scanpos.kind != kind);
    1181   }
    1182
    1183   final public Token getNextToken() {
    1184     if (token.next != null) token = token.next;
    1185     else token = token.next = token_source.getNextToken();
    1186     jj_ntk = -1;
    1187     return token;
    1188   }
    1189
    1190   final public Token getToken(int index) {
    1191     Token t = lookingAhead ? jj_scanpos : token;
    1192     for (int i = 0; i < index; i++) {
    1193       if (t.next != null) t = t.next;
    1194       else t = t.next = token_source.getNextToken();
    1195     }
    1196     return t;
    1197   }
    1198
    1199   final private int jj_ntk() {
    1200     if ((jj_nt=token.next) == null)
    1201       return (jj_ntk = (token.next=token_source.getNextToken()).kind);
    1202     else
    1203       return (jj_ntk = jj_nt.kind);
    1204   }
    1205
    1206   final public ParseException generateParseException() {
    1207     Token errortok = token.next;
    1208     int line = errortok.beginLine, column = errortok.beginColumn;
    1209     String mess = (errortok.kind == 0) ? tokenImage[0] : errortok.image;
    1210     return new ParseException("Parse error at line " + line + ", column " + column + ".  Encountered: " + mess);
    1211   }
    1212
    1213   final public void enable_tracing() {
    1214   }
    1215
    1216   final public void disable_tracing() {
    1217   }
    1218
    1219 }