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