001    /* Generated By:JavaCC: Do not edit this line. SelectorParserTokenManager.java */
002    /**
003     * Licensed to the Apache Software Foundation (ASF) under one or more
004     * contributor license agreements.  See the NOTICE file distributed with
005     * this work for additional information regarding copyright ownership.
006     * The ASF licenses this file to You under the Apache License, Version 2.0
007     * (the "License"); you may not use this file except in compliance with
008     * the License.  You may obtain a copy of the License at
009     *
010     *      http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing, software
013     * distributed under the License is distributed on an "AS IS" BASIS,
014     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015     * See the License for the specific language governing permissions and
016     * limitations under the License.
017     */
018    
019    package org.apache.activemq.selector;
020    import java.io.*;
021    import java.util.*;
022    import javax.jms.InvalidSelectorException;
023    import org.apache.activemq.filter.*;
024    import org.apache.activemq.filter.FunctionCallExpression.invalidFunctionExpressionException;
025    import org.apache.activemq.util.LRUCache;
026    
027    /** Token Manager. */
028    public class SelectorParserTokenManager implements SelectorParserConstants
029    {
030    
031      /** Debug output. */
032      public  java.io.PrintStream debugStream = System.out;
033      /** Set debug output. */
034      public  void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
035    private int jjStopAtPos(int pos, int kind)
036    {
037       jjmatchedKind = kind;
038       jjmatchedPos = pos;
039       return pos + 1;
040    }
041    private int jjMoveStringLiteralDfa0_0()
042    {
043       switch(curChar)
044       {
045          case 9:
046             jjmatchedKind = 2;
047             return jjMoveNfa_0(5, 0);
048          case 10:
049             jjmatchedKind = 3;
050             return jjMoveNfa_0(5, 0);
051          case 12:
052             jjmatchedKind = 5;
053             return jjMoveNfa_0(5, 0);
054          case 13:
055             jjmatchedKind = 4;
056             return jjMoveNfa_0(5, 0);
057          case 32:
058             jjmatchedKind = 1;
059             return jjMoveNfa_0(5, 0);
060          case 37:
061             jjmatchedKind = 41;
062             return jjMoveNfa_0(5, 0);
063          case 40:
064             jjmatchedKind = 34;
065             return jjMoveNfa_0(5, 0);
066          case 41:
067             jjmatchedKind = 36;
068             return jjMoveNfa_0(5, 0);
069          case 42:
070             jjmatchedKind = 39;
071             return jjMoveNfa_0(5, 0);
072          case 43:
073             jjmatchedKind = 37;
074             return jjMoveNfa_0(5, 0);
075          case 44:
076             jjmatchedKind = 35;
077             return jjMoveNfa_0(5, 0);
078          case 45:
079             jjmatchedKind = 38;
080             return jjMoveNfa_0(5, 0);
081          case 47:
082             jjmatchedKind = 40;
083             return jjMoveNfa_0(5, 0);
084          case 60:
085             jjmatchedKind = 32;
086             return jjMoveStringLiteralDfa1_0(0x220000000L);
087          case 61:
088             jjmatchedKind = 28;
089             return jjMoveNfa_0(5, 0);
090          case 62:
091             jjmatchedKind = 30;
092             return jjMoveStringLiteralDfa1_0(0x80000000L);
093          case 65:
094             return jjMoveStringLiteralDfa1_0(0x200L);
095          case 66:
096             return jjMoveStringLiteralDfa1_0(0x800L);
097          case 69:
098             return jjMoveStringLiteralDfa1_0(0x2000L);
099          case 70:
100             return jjMoveStringLiteralDfa1_0(0x20000L);
101          case 73:
102             return jjMoveStringLiteralDfa1_0(0xc000L);
103          case 76:
104             return jjMoveStringLiteralDfa1_0(0x1000L);
105          case 78:
106             return jjMoveStringLiteralDfa1_0(0x40100L);
107          case 79:
108             return jjMoveStringLiteralDfa1_0(0x400L);
109          case 84:
110             return jjMoveStringLiteralDfa1_0(0x10000L);
111          case 88:
112             return jjMoveStringLiteralDfa1_0(0x180000L);
113          case 97:
114             return jjMoveStringLiteralDfa1_0(0x200L);
115          case 98:
116             return jjMoveStringLiteralDfa1_0(0x800L);
117          case 101:
118             return jjMoveStringLiteralDfa1_0(0x2000L);
119          case 102:
120             return jjMoveStringLiteralDfa1_0(0x20000L);
121          case 105:
122             return jjMoveStringLiteralDfa1_0(0xc000L);
123          case 108:
124             return jjMoveStringLiteralDfa1_0(0x1000L);
125          case 110:
126             return jjMoveStringLiteralDfa1_0(0x40100L);
127          case 111:
128             return jjMoveStringLiteralDfa1_0(0x400L);
129          case 116:
130             return jjMoveStringLiteralDfa1_0(0x10000L);
131          case 120:
132             return jjMoveStringLiteralDfa1_0(0x180000L);
133          default :
134             return jjMoveNfa_0(5, 0);
135       }
136    }
137    private int jjMoveStringLiteralDfa1_0(long active0)
138    {
139       try { curChar = input_stream.readChar(); }
140       catch(java.io.IOException e) {
141       return jjMoveNfa_0(5, 0);
142       }
143       switch(curChar)
144       {
145          case 61:
146             if ((active0 & 0x80000000L) != 0L)
147             {
148                jjmatchedKind = 31;
149                jjmatchedPos = 1;
150             }
151             else if ((active0 & 0x200000000L) != 0L)
152             {
153                jjmatchedKind = 33;
154                jjmatchedPos = 1;
155             }
156             break;
157          case 62:
158             if ((active0 & 0x20000000L) != 0L)
159             {
160                jjmatchedKind = 29;
161                jjmatchedPos = 1;
162             }
163             break;
164          case 65:
165             return jjMoveStringLiteralDfa2_0(active0, 0x20000L);
166          case 69:
167             return jjMoveStringLiteralDfa2_0(active0, 0x800L);
168          case 73:
169             return jjMoveStringLiteralDfa2_0(active0, 0x1000L);
170          case 78:
171             if ((active0 & 0x4000L) != 0L)
172             {
173                jjmatchedKind = 14;
174                jjmatchedPos = 1;
175             }
176             return jjMoveStringLiteralDfa2_0(active0, 0x200L);
177          case 79:
178             return jjMoveStringLiteralDfa2_0(active0, 0x100L);
179          case 80:
180             return jjMoveStringLiteralDfa2_0(active0, 0x80000L);
181          case 81:
182             return jjMoveStringLiteralDfa2_0(active0, 0x100000L);
183          case 82:
184             if ((active0 & 0x400L) != 0L)
185             {
186                jjmatchedKind = 10;
187                jjmatchedPos = 1;
188             }
189             return jjMoveStringLiteralDfa2_0(active0, 0x10000L);
190          case 83:
191             if ((active0 & 0x8000L) != 0L)
192             {
193                jjmatchedKind = 15;
194                jjmatchedPos = 1;
195             }
196             return jjMoveStringLiteralDfa2_0(active0, 0x2000L);
197          case 85:
198             return jjMoveStringLiteralDfa2_0(active0, 0x40000L);
199          case 97:
200             return jjMoveStringLiteralDfa2_0(active0, 0x20000L);
201          case 101:
202             return jjMoveStringLiteralDfa2_0(active0, 0x800L);
203          case 105:
204             return jjMoveStringLiteralDfa2_0(active0, 0x1000L);
205          case 110:
206             if ((active0 & 0x4000L) != 0L)
207             {
208                jjmatchedKind = 14;
209                jjmatchedPos = 1;
210             }
211             return jjMoveStringLiteralDfa2_0(active0, 0x200L);
212          case 111:
213             return jjMoveStringLiteralDfa2_0(active0, 0x100L);
214          case 112:
215             return jjMoveStringLiteralDfa2_0(active0, 0x80000L);
216          case 113:
217             return jjMoveStringLiteralDfa2_0(active0, 0x100000L);
218          case 114:
219             if ((active0 & 0x400L) != 0L)
220             {
221                jjmatchedKind = 10;
222                jjmatchedPos = 1;
223             }
224             return jjMoveStringLiteralDfa2_0(active0, 0x10000L);
225          case 115:
226             if ((active0 & 0x8000L) != 0L)
227             {
228                jjmatchedKind = 15;
229                jjmatchedPos = 1;
230             }
231             return jjMoveStringLiteralDfa2_0(active0, 0x2000L);
232          case 117:
233             return jjMoveStringLiteralDfa2_0(active0, 0x40000L);
234          default :
235             break;
236       }
237       return jjMoveNfa_0(5, 1);
238    }
239    private int jjMoveStringLiteralDfa2_0(long old0, long active0)
240    {
241       if (((active0 &= old0)) == 0L)
242          return jjMoveNfa_0(5, 1);
243       try { curChar = input_stream.readChar(); }
244       catch(java.io.IOException e) {
245       return jjMoveNfa_0(5, 1);
246       }
247       switch(curChar)
248       {
249          case 65:
250             return jjMoveStringLiteralDfa3_0(active0, 0x80000L);
251          case 67:
252             return jjMoveStringLiteralDfa3_0(active0, 0x2000L);
253          case 68:
254             if ((active0 & 0x200L) != 0L)
255             {
256                jjmatchedKind = 9;
257                jjmatchedPos = 2;
258             }
259             break;
260          case 75:
261             return jjMoveStringLiteralDfa3_0(active0, 0x1000L);
262          case 76:
263             return jjMoveStringLiteralDfa3_0(active0, 0x60000L);
264          case 84:
265             if ((active0 & 0x100L) != 0L)
266             {
267                jjmatchedKind = 8;
268                jjmatchedPos = 2;
269             }
270             return jjMoveStringLiteralDfa3_0(active0, 0x800L);
271          case 85:
272             return jjMoveStringLiteralDfa3_0(active0, 0x110000L);
273          case 97:
274             return jjMoveStringLiteralDfa3_0(active0, 0x80000L);
275          case 99:
276             return jjMoveStringLiteralDfa3_0(active0, 0x2000L);
277          case 100:
278             if ((active0 & 0x200L) != 0L)
279             {
280                jjmatchedKind = 9;
281                jjmatchedPos = 2;
282             }
283             break;
284          case 107:
285             return jjMoveStringLiteralDfa3_0(active0, 0x1000L);
286          case 108:
287             return jjMoveStringLiteralDfa3_0(active0, 0x60000L);
288          case 116:
289             if ((active0 & 0x100L) != 0L)
290             {
291                jjmatchedKind = 8;
292                jjmatchedPos = 2;
293             }
294             return jjMoveStringLiteralDfa3_0(active0, 0x800L);
295          case 117:
296             return jjMoveStringLiteralDfa3_0(active0, 0x110000L);
297          default :
298             break;
299       }
300       return jjMoveNfa_0(5, 2);
301    }
302    private int jjMoveStringLiteralDfa3_0(long old0, long active0)
303    {
304       if (((active0 &= old0)) == 0L)
305          return jjMoveNfa_0(5, 2);
306       try { curChar = input_stream.readChar(); }
307       catch(java.io.IOException e) {
308       return jjMoveNfa_0(5, 2);
309       }
310       switch(curChar)
311       {
312          case 65:
313             return jjMoveStringLiteralDfa4_0(active0, 0x2000L);
314          case 69:
315             if ((active0 & 0x1000L) != 0L)
316             {
317                jjmatchedKind = 12;
318                jjmatchedPos = 3;
319             }
320             else if ((active0 & 0x10000L) != 0L)
321             {
322                jjmatchedKind = 16;
323                jjmatchedPos = 3;
324             }
325             return jjMoveStringLiteralDfa4_0(active0, 0x100000L);
326          case 76:
327             if ((active0 & 0x40000L) != 0L)
328             {
329                jjmatchedKind = 18;
330                jjmatchedPos = 3;
331             }
332             break;
333          case 83:
334             return jjMoveStringLiteralDfa4_0(active0, 0x20000L);
335          case 84:
336             return jjMoveStringLiteralDfa4_0(active0, 0x80000L);
337          case 87:
338             return jjMoveStringLiteralDfa4_0(active0, 0x800L);
339          case 97:
340             return jjMoveStringLiteralDfa4_0(active0, 0x2000L);
341          case 101:
342             if ((active0 & 0x1000L) != 0L)
343             {
344                jjmatchedKind = 12;
345                jjmatchedPos = 3;
346             }
347             else if ((active0 & 0x10000L) != 0L)
348             {
349                jjmatchedKind = 16;
350                jjmatchedPos = 3;
351             }
352             return jjMoveStringLiteralDfa4_0(active0, 0x100000L);
353          case 108:
354             if ((active0 & 0x40000L) != 0L)
355             {
356                jjmatchedKind = 18;
357                jjmatchedPos = 3;
358             }
359             break;
360          case 115:
361             return jjMoveStringLiteralDfa4_0(active0, 0x20000L);
362          case 116:
363             return jjMoveStringLiteralDfa4_0(active0, 0x80000L);
364          case 119:
365             return jjMoveStringLiteralDfa4_0(active0, 0x800L);
366          default :
367             break;
368       }
369       return jjMoveNfa_0(5, 3);
370    }
371    private int jjMoveStringLiteralDfa4_0(long old0, long active0)
372    {
373       if (((active0 &= old0)) == 0L)
374          return jjMoveNfa_0(5, 3);
375       try { curChar = input_stream.readChar(); }
376       catch(java.io.IOException e) {
377       return jjMoveNfa_0(5, 3);
378       }
379       switch(curChar)
380       {
381          case 69:
382             if ((active0 & 0x20000L) != 0L)
383             {
384                jjmatchedKind = 17;
385                jjmatchedPos = 4;
386             }
387             return jjMoveStringLiteralDfa5_0(active0, 0x800L);
388          case 72:
389             if ((active0 & 0x80000L) != 0L)
390             {
391                jjmatchedKind = 19;
392                jjmatchedPos = 4;
393             }
394             break;
395          case 80:
396             return jjMoveStringLiteralDfa5_0(active0, 0x2000L);
397          case 82:
398             return jjMoveStringLiteralDfa5_0(active0, 0x100000L);
399          case 101:
400             if ((active0 & 0x20000L) != 0L)
401             {
402                jjmatchedKind = 17;
403                jjmatchedPos = 4;
404             }
405             return jjMoveStringLiteralDfa5_0(active0, 0x800L);
406          case 104:
407             if ((active0 & 0x80000L) != 0L)
408             {
409                jjmatchedKind = 19;
410                jjmatchedPos = 4;
411             }
412             break;
413          case 112:
414             return jjMoveStringLiteralDfa5_0(active0, 0x2000L);
415          case 114:
416             return jjMoveStringLiteralDfa5_0(active0, 0x100000L);
417          default :
418             break;
419       }
420       return jjMoveNfa_0(5, 4);
421    }
422    private int jjMoveStringLiteralDfa5_0(long old0, long active0)
423    {
424       if (((active0 &= old0)) == 0L)
425          return jjMoveNfa_0(5, 4);
426       try { curChar = input_stream.readChar(); }
427       catch(java.io.IOException e) {
428       return jjMoveNfa_0(5, 4);
429       }
430       switch(curChar)
431       {
432          case 69:
433             if ((active0 & 0x2000L) != 0L)
434             {
435                jjmatchedKind = 13;
436                jjmatchedPos = 5;
437             }
438             return jjMoveStringLiteralDfa6_0(active0, 0x800L);
439          case 89:
440             if ((active0 & 0x100000L) != 0L)
441             {
442                jjmatchedKind = 20;
443                jjmatchedPos = 5;
444             }
445             break;
446          case 101:
447             if ((active0 & 0x2000L) != 0L)
448             {
449                jjmatchedKind = 13;
450                jjmatchedPos = 5;
451             }
452             return jjMoveStringLiteralDfa6_0(active0, 0x800L);
453          case 121:
454             if ((active0 & 0x100000L) != 0L)
455             {
456                jjmatchedKind = 20;
457                jjmatchedPos = 5;
458             }
459             break;
460          default :
461             break;
462       }
463       return jjMoveNfa_0(5, 5);
464    }
465    private int jjMoveStringLiteralDfa6_0(long old0, long active0)
466    {
467       if (((active0 &= old0)) == 0L)
468          return jjMoveNfa_0(5, 5);
469       try { curChar = input_stream.readChar(); }
470       catch(java.io.IOException e) {
471       return jjMoveNfa_0(5, 5);
472       }
473       switch(curChar)
474       {
475          case 78:
476             if ((active0 & 0x800L) != 0L)
477             {
478                jjmatchedKind = 11;
479                jjmatchedPos = 6;
480             }
481             break;
482          case 110:
483             if ((active0 & 0x800L) != 0L)
484             {
485                jjmatchedKind = 11;
486                jjmatchedPos = 6;
487             }
488             break;
489          default :
490             break;
491       }
492       return jjMoveNfa_0(5, 6);
493    }
494    static final long[] jjbitVec0 = {
495       0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
496    };
497    static final long[] jjbitVec2 = {
498       0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
499    };
500    private int jjMoveNfa_0(int startState, int curPos)
501    {
502       int strKind = jjmatchedKind;
503       int strPos = jjmatchedPos;
504       int seenUpto;
505       input_stream.backup(seenUpto = curPos + 1);
506       try { curChar = input_stream.readChar(); }
507       catch(java.io.IOException e) { throw new Error("Internal Error"); }
508       curPos = 0;
509       int startsAt = 0;
510       jjnewStateCnt = 43;
511       int i = 1;
512       jjstateSet[0] = startState;
513       int kind = 0x7fffffff;
514       for (;;)
515       {
516          if (++jjround == 0x7fffffff)
517             ReInitRounds();
518          if (curChar < 64)
519          {
520             long l = 1L << curChar;
521             do
522             {
523                switch(jjstateSet[--i])
524                {
525                   case 5:
526                      if ((0x3ff000000000000L & l) != 0L)
527                         jjCheckNAddStates(0, 3);
528                      else if (curChar == 36)
529                      {
530                         if (kind > 27)
531                            kind = 27;
532                         jjCheckNAdd(27);
533                      }
534                      else if (curChar == 39)
535                         jjCheckNAddStates(4, 6);
536                      else if (curChar == 46)
537                         jjCheckNAdd(17);
538                      else if (curChar == 47)
539                         jjstateSet[jjnewStateCnt++] = 6;
540                      else if (curChar == 45)
541                         jjstateSet[jjnewStateCnt++] = 0;
542                      if ((0x3fe000000000000L & l) != 0L)
543                      {
544                         if (kind > 21)
545                            kind = 21;
546                         jjCheckNAddTwoStates(14, 15);
547                      }
548                      else if (curChar == 48)
549                      {
550                         if (kind > 23)
551                            kind = 23;
552                         jjCheckNAddTwoStates(40, 42);
553                      }
554                      break;
555                   case 0:
556                      if (curChar == 45)
557                         jjCheckNAddStates(7, 9);
558                      break;
559                   case 1:
560                      if ((0xffffffffffffdbffL & l) != 0L)
561                         jjCheckNAddStates(7, 9);
562                      break;
563                   case 2:
564                      if ((0x2400L & l) != 0L && kind > 6)
565                         kind = 6;
566                      break;
567                   case 3:
568                      if (curChar == 10 && kind > 6)
569                         kind = 6;
570                      break;
571                   case 4:
572                      if (curChar == 13)
573                         jjstateSet[jjnewStateCnt++] = 3;
574                      break;
575                   case 6:
576                      if (curChar == 42)
577                         jjCheckNAddTwoStates(7, 8);
578                      break;
579                   case 7:
580                      if ((0xfffffbffffffffffL & l) != 0L)
581                         jjCheckNAddTwoStates(7, 8);
582                      break;
583                   case 8:
584                      if (curChar == 42)
585                         jjCheckNAddStates(10, 12);
586                      break;
587                   case 9:
588                      if ((0xffff7bffffffffffL & l) != 0L)
589                         jjCheckNAddTwoStates(10, 8);
590                      break;
591                   case 10:
592                      if ((0xfffffbffffffffffL & l) != 0L)
593                         jjCheckNAddTwoStates(10, 8);
594                      break;
595                   case 11:
596                      if (curChar == 47 && kind > 7)
597                         kind = 7;
598                      break;
599                   case 12:
600                      if (curChar == 47)
601                         jjstateSet[jjnewStateCnt++] = 6;
602                      break;
603                   case 13:
604                      if ((0x3fe000000000000L & l) == 0L)
605                         break;
606                      if (kind > 21)
607                         kind = 21;
608                      jjCheckNAddTwoStates(14, 15);
609                      break;
610                   case 14:
611                      if ((0x3ff000000000000L & l) == 0L)
612                         break;
613                      if (kind > 21)
614                         kind = 21;
615                      jjCheckNAddTwoStates(14, 15);
616                      break;
617                   case 16:
618                      if (curChar == 46)
619                         jjCheckNAdd(17);
620                      break;
621                   case 17:
622                      if ((0x3ff000000000000L & l) == 0L)
623                         break;
624                      if (kind > 24)
625                         kind = 24;
626                      jjCheckNAddTwoStates(17, 18);
627                      break;
628                   case 19:
629                      if ((0x280000000000L & l) != 0L)
630                         jjCheckNAdd(20);
631                      break;
632                   case 20:
633                      if ((0x3ff000000000000L & l) == 0L)
634                         break;
635                      if (kind > 24)
636                         kind = 24;
637                      jjCheckNAdd(20);
638                      break;
639                   case 21:
640                   case 22:
641                      if (curChar == 39)
642                         jjCheckNAddStates(4, 6);
643                      break;
644                   case 23:
645                      if (curChar == 39)
646                         jjstateSet[jjnewStateCnt++] = 22;
647                      break;
648                   case 24:
649                      if ((0xffffff7fffffffffL & l) != 0L)
650                         jjCheckNAddStates(4, 6);
651                      break;
652                   case 25:
653                      if (curChar == 39 && kind > 26)
654                         kind = 26;
655                      break;
656                   case 26:
657                      if (curChar != 36)
658                         break;
659                      if (kind > 27)
660                         kind = 27;
661                      jjCheckNAdd(27);
662                      break;
663                   case 27:
664                      if ((0x3ff001000000000L & l) == 0L)
665                         break;
666                      if (kind > 27)
667                         kind = 27;
668                      jjCheckNAdd(27);
669                      break;
670                   case 28:
671                      if ((0x3ff000000000000L & l) != 0L)
672                         jjCheckNAddStates(0, 3);
673                      break;
674                   case 29:
675                      if ((0x3ff000000000000L & l) != 0L)
676                         jjCheckNAddTwoStates(29, 30);
677                      break;
678                   case 30:
679                      if (curChar != 46)
680                         break;
681                      if (kind > 24)
682                         kind = 24;
683                      jjCheckNAddTwoStates(31, 32);
684                      break;
685                   case 31:
686                      if ((0x3ff000000000000L & l) == 0L)
687                         break;
688                      if (kind > 24)
689                         kind = 24;
690                      jjCheckNAddTwoStates(31, 32);
691                      break;
692                   case 33:
693                      if ((0x280000000000L & l) != 0L)
694                         jjCheckNAdd(34);
695                      break;
696                   case 34:
697                      if ((0x3ff000000000000L & l) == 0L)
698                         break;
699                      if (kind > 24)
700                         kind = 24;
701                      jjCheckNAdd(34);
702                      break;
703                   case 35:
704                      if ((0x3ff000000000000L & l) != 0L)
705                         jjCheckNAddTwoStates(35, 36);
706                      break;
707                   case 37:
708                      if ((0x280000000000L & l) != 0L)
709                         jjCheckNAdd(38);
710                      break;
711                   case 38:
712                      if ((0x3ff000000000000L & l) == 0L)
713                         break;
714                      if (kind > 24)
715                         kind = 24;
716                      jjCheckNAdd(38);
717                      break;
718                   case 39:
719                      if (curChar != 48)
720                         break;
721                      if (kind > 23)
722                         kind = 23;
723                      jjCheckNAddTwoStates(40, 42);
724                      break;
725                   case 41:
726                      if ((0x3ff000000000000L & l) == 0L)
727                         break;
728                      if (kind > 22)
729                         kind = 22;
730                      jjstateSet[jjnewStateCnt++] = 41;
731                      break;
732                   case 42:
733                      if ((0xff000000000000L & l) == 0L)
734                         break;
735                      if (kind > 23)
736                         kind = 23;
737                      jjCheckNAdd(42);
738                      break;
739                   default : break;
740                }
741             } while(i != startsAt);
742          }
743          else if (curChar < 128)
744          {
745             long l = 1L << (curChar & 077);
746             do
747             {
748                switch(jjstateSet[--i])
749                {
750                   case 5:
751                   case 27:
752                      if ((0x7fffffe87fffffeL & l) == 0L)
753                         break;
754                      if (kind > 27)
755                         kind = 27;
756                      jjCheckNAdd(27);
757                      break;
758                   case 1:
759                      jjAddStates(7, 9);
760                      break;
761                   case 7:
762                      jjCheckNAddTwoStates(7, 8);
763                      break;
764                   case 9:
765                   case 10:
766                      jjCheckNAddTwoStates(10, 8);
767                      break;
768                   case 15:
769                      if ((0x100000001000L & l) != 0L && kind > 21)
770                         kind = 21;
771                      break;
772                   case 18:
773                      if ((0x2000000020L & l) != 0L)
774                         jjAddStates(13, 14);
775                      break;
776                   case 24:
777                      jjAddStates(4, 6);
778                      break;
779                   case 32:
780                      if ((0x2000000020L & l) != 0L)
781                         jjAddStates(15, 16);
782                      break;
783                   case 36:
784                      if ((0x2000000020L & l) != 0L)
785                         jjAddStates(17, 18);
786                      break;
787                   case 40:
788                      if ((0x100000001000000L & l) != 0L)
789                         jjCheckNAdd(41);
790                      break;
791                   case 41:
792                      if ((0x7e0000007eL & l) == 0L)
793                         break;
794                      if (kind > 22)
795                         kind = 22;
796                      jjCheckNAdd(41);
797                      break;
798                   default : break;
799                }
800             } while(i != startsAt);
801          }
802          else
803          {
804             int hiByte = (int)(curChar >> 8);
805             int i1 = hiByte >> 6;
806             long l1 = 1L << (hiByte & 077);
807             int i2 = (curChar & 0xff) >> 6;
808             long l2 = 1L << (curChar & 077);
809             do
810             {
811                switch(jjstateSet[--i])
812                {
813                   case 1:
814                      if (jjCanMove_0(hiByte, i1, i2, l1, l2))
815                         jjAddStates(7, 9);
816                      break;
817                   case 7:
818                      if (jjCanMove_0(hiByte, i1, i2, l1, l2))
819                         jjCheckNAddTwoStates(7, 8);
820                      break;
821                   case 9:
822                   case 10:
823                      if (jjCanMove_0(hiByte, i1, i2, l1, l2))
824                         jjCheckNAddTwoStates(10, 8);
825                      break;
826                   case 24:
827                      if (jjCanMove_0(hiByte, i1, i2, l1, l2))
828                         jjAddStates(4, 6);
829                      break;
830                   default : break;
831                }
832             } while(i != startsAt);
833          }
834          if (kind != 0x7fffffff)
835          {
836             jjmatchedKind = kind;
837             jjmatchedPos = curPos;
838             kind = 0x7fffffff;
839          }
840          ++curPos;
841          if ((i = jjnewStateCnt) == (startsAt = 43 - (jjnewStateCnt = startsAt)))
842             break;
843          try { curChar = input_stream.readChar(); }
844          catch(java.io.IOException e) { break; }
845       }
846       if (jjmatchedPos > strPos)
847          return curPos;
848    
849       int toRet = Math.max(curPos, seenUpto);
850    
851       if (curPos < toRet)
852          for (i = toRet - Math.min(curPos, seenUpto); i-- > 0; )
853             try { curChar = input_stream.readChar(); }
854             catch(java.io.IOException e) { throw new Error("Internal Error : Please send a bug report."); }
855    
856       if (jjmatchedPos < strPos)
857       {
858          jjmatchedKind = strKind;
859          jjmatchedPos = strPos;
860       }
861       else if (jjmatchedPos == strPos && jjmatchedKind > strKind)
862          jjmatchedKind = strKind;
863    
864       return toRet;
865    }
866    static final int[] jjnextStates = {
867       29, 30, 35, 36, 23, 24, 25, 1, 2, 4, 8, 9, 11, 19, 20, 33, 
868       34, 37, 38, 
869    };
870    private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
871    {
872       switch(hiByte)
873       {
874          case 0:
875             return ((jjbitVec2[i2] & l2) != 0L);
876          default :
877             if ((jjbitVec0[i1] & l1) != 0L)
878                return true;
879             return false;
880       }
881    }
882    
883    /** Token literal values. */
884    public static final String[] jjstrLiteralImages = {
885    "", null, null, null, null, null, null, null, null, null, null, null, null, 
886    null, null, null, null, null, null, null, null, null, null, null, null, null, null, 
887    null, "\75", "\74\76", "\76", "\76\75", "\74", "\74\75", "\50", "\54", "\51", "\53", 
888    "\55", "\52", "\57", "\45", };
889    
890    /** Lexer state names. */
891    public static final String[] lexStateNames = {
892       "DEFAULT",
893    };
894    static final long[] jjtoToken = {
895       0x3fffdffff01L, 
896    };
897    static final long[] jjtoSkip = {
898       0xfeL, 
899    };
900    static final long[] jjtoSpecial = {
901       0x3eL, 
902    };
903    protected SimpleCharStream input_stream;
904    private final int[] jjrounds = new int[43];
905    private final int[] jjstateSet = new int[86];
906    protected char curChar;
907    /** Constructor. */
908    public SelectorParserTokenManager(SimpleCharStream stream){
909       if (SimpleCharStream.staticFlag)
910          throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
911       input_stream = stream;
912    }
913    
914    /** Constructor. */
915    public SelectorParserTokenManager(SimpleCharStream stream, int lexState){
916       this(stream);
917       SwitchTo(lexState);
918    }
919    
920    /** Reinitialise parser. */
921    public void ReInit(SimpleCharStream stream)
922    {
923       jjmatchedPos = jjnewStateCnt = 0;
924       curLexState = defaultLexState;
925       input_stream = stream;
926       ReInitRounds();
927    }
928    private void ReInitRounds()
929    {
930       int i;
931       jjround = 0x80000001;
932       for (i = 43; i-- > 0;)
933          jjrounds[i] = 0x80000000;
934    }
935    
936    /** Reinitialise parser. */
937    public void ReInit(SimpleCharStream stream, int lexState)
938    {
939       ReInit(stream);
940       SwitchTo(lexState);
941    }
942    
943    /** Switch to specified lex state. */
944    public void SwitchTo(int lexState)
945    {
946       if (lexState >= 1 || lexState < 0)
947          throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
948       else
949          curLexState = lexState;
950    }
951    
952    protected Token jjFillToken()
953    {
954       final Token t;
955       final String curTokenImage;
956       final int beginLine;
957       final int endLine;
958       final int beginColumn;
959       final int endColumn;
960       String im = jjstrLiteralImages[jjmatchedKind];
961       curTokenImage = (im == null) ? input_stream.GetImage() : im;
962       beginLine = input_stream.getBeginLine();
963       beginColumn = input_stream.getBeginColumn();
964       endLine = input_stream.getEndLine();
965       endColumn = input_stream.getEndColumn();
966       t = Token.newToken(jjmatchedKind, curTokenImage);
967    
968       t.beginLine = beginLine;
969       t.endLine = endLine;
970       t.beginColumn = beginColumn;
971       t.endColumn = endColumn;
972    
973       return t;
974    }
975    
976    int curLexState = 0;
977    int defaultLexState = 0;
978    int jjnewStateCnt;
979    int jjround;
980    int jjmatchedPos;
981    int jjmatchedKind;
982    
983    /** Get the next Token. */
984    public Token getNextToken() 
985    {
986      Token specialToken = null;
987      Token matchedToken;
988      int curPos = 0;
989    
990      EOFLoop :
991      for (;;)
992      {
993       try
994       {
995          curChar = input_stream.BeginToken();
996       }
997       catch(java.io.IOException e)
998       {
999          jjmatchedKind = 0;
1000          matchedToken = jjFillToken();
1001          matchedToken.specialToken = specialToken;
1002          return matchedToken;
1003       }
1004    
1005       jjmatchedKind = 0x7fffffff;
1006       jjmatchedPos = 0;
1007       curPos = jjMoveStringLiteralDfa0_0();
1008       if (jjmatchedKind != 0x7fffffff)
1009       {
1010          if (jjmatchedPos + 1 < curPos)
1011             input_stream.backup(curPos - jjmatchedPos - 1);
1012          if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
1013          {
1014             matchedToken = jjFillToken();
1015             matchedToken.specialToken = specialToken;
1016             return matchedToken;
1017          }
1018          else
1019          {
1020             if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
1021             {
1022                matchedToken = jjFillToken();
1023                if (specialToken == null)
1024                   specialToken = matchedToken;
1025                else
1026                {
1027                   matchedToken.specialToken = specialToken;
1028                   specialToken = (specialToken.next = matchedToken);
1029                }
1030             }
1031             continue EOFLoop;
1032          }
1033       }
1034       int error_line = input_stream.getEndLine();
1035       int error_column = input_stream.getEndColumn();
1036       String error_after = null;
1037       boolean EOFSeen = false;
1038       try { input_stream.readChar(); input_stream.backup(1); }
1039       catch (java.io.IOException e1) {
1040          EOFSeen = true;
1041          error_after = curPos <= 1 ? "" : input_stream.GetImage();
1042          if (curChar == '\n' || curChar == '\r') {
1043             error_line++;
1044             error_column = 0;
1045          }
1046          else
1047             error_column++;
1048       }
1049       if (!EOFSeen) {
1050          input_stream.backup(1);
1051          error_after = curPos <= 1 ? "" : input_stream.GetImage();
1052       }
1053       throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
1054      }
1055    }
1056    
1057    private void jjCheckNAdd(int state)
1058    {
1059       if (jjrounds[state] != jjround)
1060       {
1061          jjstateSet[jjnewStateCnt++] = state;
1062          jjrounds[state] = jjround;
1063       }
1064    }
1065    private void jjAddStates(int start, int end)
1066    {
1067       do {
1068          jjstateSet[jjnewStateCnt++] = jjnextStates[start];
1069       } while (start++ != end);
1070    }
1071    private void jjCheckNAddTwoStates(int state1, int state2)
1072    {
1073       jjCheckNAdd(state1);
1074       jjCheckNAdd(state2);
1075    }
1076    
1077    private void jjCheckNAddStates(int start, int end)
1078    {
1079       do {
1080          jjCheckNAdd(jjnextStates[start]);
1081       } while (start++ != end);
1082    }
1083    
1084    }