Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
QueryParserTokenManager.cs
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 /* Generated By:JavaCC: Do not edit this line. QueryParserTokenManager.java */
19 
20 namespace Lucene.Net.QueryParsers
21 {
22 
25  {
26  private void InitBlock()
27  {
28  System.IO.StreamWriter temp_writer;
29  temp_writer = new System.IO.StreamWriter(System.Console.OpenStandardOutput(), System.Console.Out.Encoding);
30  temp_writer.AutoFlush = true;
31  debugStream = temp_writer;
32  }
33 
35  public System.IO.StreamWriter debugStream;
37  public virtual void SetDebugStream(System.IO.StreamWriter ds)
38  {
39  debugStream = ds;
40  }
41  private int JjStopStringLiteralDfa_3(int pos, long active0)
42  {
43  switch (pos)
44  {
45 
46  default:
47  return - 1;
48 
49  }
50  }
51  private int JjStartNfa_3(int pos, long active0)
52  {
53  return JjMoveNfa_3(JjStopStringLiteralDfa_3(pos, active0), pos + 1);
54  }
55  private int JjStopAtPos(int pos, int kind)
56  {
57  jjmatchedKind = kind;
58  jjmatchedPos = pos;
59  return pos + 1;
60  }
61  private int JjMoveStringLiteralDfa0_3()
62  {
63  switch (curChar)
64  {
65 
66  case (char) (40):
67  return JjStopAtPos(0, 13);
68 
69  case (char) (41):
70  return JjStopAtPos(0, 14);
71 
72  case (char) (42):
73  return JjStartNfaWithStates_3(0, 16, 36);
74 
75  case (char) (43):
76  return JjStopAtPos(0, 11);
77 
78  case (char) (45):
79  return JjStopAtPos(0, 12);
80 
81  case (char) (58):
82  return JjStopAtPos(0, 15);
83 
84  case (char) (91):
85  return JjStopAtPos(0, 23);
86 
87  case (char) (94):
88  return JjStopAtPos(0, 17);
89 
90  case (char) (123):
91  return JjStopAtPos(0, 24);
92 
93  default:
94  return JjMoveNfa_3(0, 0);
95 
96  }
97  }
98  private int JjStartNfaWithStates_3(int pos, int kind, int state)
99  {
100  jjmatchedKind = kind;
101  jjmatchedPos = pos;
102  try
103  {
104  curChar = input_stream.ReadChar();
105  }
106  catch (System.IO.IOException)
107  {
108  return pos + 1;
109  }
110  return JjMoveNfa_3(state, pos + 1);
111  }
112  internal static readonly ulong[] jjbitVec0 = new ulong[]{0x1L, 0x0L, 0x0L, 0x0L};
113  internal static readonly ulong[] jjbitVec1 = new ulong[]{0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL};
114  internal static readonly ulong[] jjbitVec3 = new ulong[]{0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL};
115  internal static readonly ulong[] jjbitVec4 = new ulong[]{0xfffefffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL};
116  private int JjMoveNfa_3(int startState, int curPos)
117  {
118  int startsAt = 0;
119  jjnewStateCnt = 36;
120  int i = 1;
121  jjstateSet[0] = startState;
122  int kind = 0x7fffffff;
123  for (; ; )
124  {
125  if (++jjround == 0x7fffffff)
126  ReInitRounds();
127  if (curChar < 64)
128  {
129  ulong l = (ulong) (1L << (int) curChar);
130  do
131  {
132  switch (jjstateSet[--i])
133  {
134 
135  case 36:
136  case 25:
137  if ((0xfbfffcf8ffffd9ffL & l) == (ulong) 0L)
138  break;
139  if (kind > 22)
140  kind = 22;
141  JjCheckNAddTwoStates(25, 26);
142  break;
143 
144  case 0:
145  if ((0xfbffd4f8ffffd9ffL & l) != (ulong) 0L)
146  {
147  if (kind > 22)
148  kind = 22;
149  JjCheckNAddTwoStates(25, 26);
150  }
151  else if ((0x100002600L & l) != 0L)
152  {
153  if (kind > 7)
154  kind = 7;
155  }
156  else if (curChar == 34)
157  JjCheckNAddStates(0, 2);
158  else if (curChar == 33)
159  {
160  if (kind > 10)
161  kind = 10;
162  }
163  if ((0x7bffd0f8ffffd9ffL & l) != 0L)
164  {
165  if (kind > 19)
166  kind = 19;
167  JjCheckNAddStates(3, 7);
168  }
169  else if (curChar == 42)
170  {
171  if (kind > 21)
172  kind = 21;
173  }
174  if (curChar == 38)
175  jjstateSet[jjnewStateCnt++] = 4;
176  break;
177 
178  case 4:
179  if (curChar == 38 && kind > 8)
180  kind = 8;
181  break;
182 
183  case 5:
184  if (curChar == 38)
185  jjstateSet[jjnewStateCnt++] = 4;
186  break;
187 
188  case 13:
189  if (curChar == 33 && kind > 10)
190  kind = 10;
191  break;
192 
193  case 14:
194  if (curChar == 34)
195  JjCheckNAddStates(0, 2);
196  break;
197 
198  case 15:
199  if ((0xfffffffbffffffffL & l) != (ulong) 0L)
200  JjCheckNAddStates(0, 2);
201  break;
202 
203  case 17:
204  JjCheckNAddStates(0, 2);
205  break;
206 
207  case 18:
208  if (curChar == 34 && kind > 18)
209  kind = 18;
210  break;
211 
212  case 20:
213  if ((0x3ff000000000000L & l) == 0L)
214  break;
215  if (kind > 20)
216  kind = 20;
217  JjAddStates(8, 9);
218  break;
219 
220  case 21:
221  if (curChar == 46)
222  JjCheckNAdd(22);
223  break;
224 
225  case 22:
226  if ((0x3ff000000000000L & l) == 0L)
227  break;
228  if (kind > 20)
229  kind = 20;
230  JjCheckNAdd(22);
231  break;
232 
233  case 23:
234  if (curChar == 42 && kind > 21)
235  kind = 21;
236  break;
237 
238  case 24:
239  if ((0xfbffd4f8ffffd9ffL & l) == (ulong) 0L)
240  break;
241  if (kind > 22)
242  kind = 22;
243  JjCheckNAddTwoStates(25, 26);
244  break;
245 
246  case 27:
247  if (kind > 22)
248  kind = 22;
249  JjCheckNAddTwoStates(25, 26);
250  break;
251 
252  case 28:
253  if ((0x7bffd0f8ffffd9ffL & l) == 0L)
254  break;
255  if (kind > 19)
256  kind = 19;
257  JjCheckNAddStates(3, 7);
258  break;
259 
260  case 29:
261  if ((0x7bfff8f8ffffd9ffL & l) == 0L)
262  break;
263  if (kind > 19)
264  kind = 19;
265  JjCheckNAddTwoStates(29, 30);
266  break;
267 
268  case 31:
269  if (kind > 19)
270  kind = 19;
271  JjCheckNAddTwoStates(29, 30);
272  break;
273 
274  case 32:
275  if ((0x7bfff8f8ffffd9ffL & l) != 0L)
276  JjCheckNAddStates(10, 12);
277  break;
278 
279  case 34:
280  JjCheckNAddStates(10, 12);
281  break;
282 
283  default: break;
284 
285  }
286  }
287  while (i != startsAt);
288  }
289  else if (curChar < 128)
290  {
291  ulong l = (ulong) (1L << (curChar & 63));
292  do
293  {
294  switch (jjstateSet[--i])
295  {
296 
297  case 36:
298  if ((0x97ffffff87ffffffL & l) != (ulong) 0L)
299  {
300  if (kind > 22)
301  kind = 22;
302  JjCheckNAddTwoStates(25, 26);
303  }
304  else if (curChar == 92)
305  JjCheckNAddTwoStates(27, 27);
306  break;
307 
308  case 0:
309  if ((0x97ffffff87ffffffL & l) != (ulong) 0L)
310  {
311  if (kind > 19)
312  kind = 19;
313  JjCheckNAddStates(3, 7);
314  }
315  else if (curChar == 92)
316  JjCheckNAddStates(13, 15);
317  else if (curChar == 126)
318  {
319  if (kind > 20)
320  kind = 20;
321  jjstateSet[jjnewStateCnt++] = 20;
322  }
323  if ((0x97ffffff87ffffffL & l) != (ulong) 0L)
324  {
325  if (kind > 22)
326  kind = 22;
327  JjCheckNAddTwoStates(25, 26);
328  }
329  if (curChar == 78)
330  jjstateSet[jjnewStateCnt++] = 11;
331  else if (curChar == 124)
332  jjstateSet[jjnewStateCnt++] = 8;
333  else if (curChar == 79)
334  jjstateSet[jjnewStateCnt++] = 6;
335  else if (curChar == 65)
336  jjstateSet[jjnewStateCnt++] = 2;
337  break;
338 
339  case 1:
340  if (curChar == 68 && kind > 8)
341  kind = 8;
342  break;
343 
344  case 2:
345  if (curChar == 78)
346  jjstateSet[jjnewStateCnt++] = 1;
347  break;
348 
349  case 3:
350  if (curChar == 65)
351  jjstateSet[jjnewStateCnt++] = 2;
352  break;
353 
354  case 6:
355  if (curChar == 82 && kind > 9)
356  kind = 9;
357  break;
358 
359  case 7:
360  if (curChar == 79)
361  jjstateSet[jjnewStateCnt++] = 6;
362  break;
363 
364  case 8:
365  if (curChar == 124 && kind > 9)
366  kind = 9;
367  break;
368 
369  case 9:
370  if (curChar == 124)
371  jjstateSet[jjnewStateCnt++] = 8;
372  break;
373 
374  case 10:
375  if (curChar == 84 && kind > 10)
376  kind = 10;
377  break;
378 
379  case 11:
380  if (curChar == 79)
381  jjstateSet[jjnewStateCnt++] = 10;
382  break;
383 
384  case 12:
385  if (curChar == 78)
386  jjstateSet[jjnewStateCnt++] = 11;
387  break;
388 
389  case 15:
390  if ((0xffffffffefffffffL & l) != (ulong) 0L)
391  JjCheckNAddStates(0, 2);
392  break;
393 
394  case 16:
395  if (curChar == 92)
396  jjstateSet[jjnewStateCnt++] = 17;
397  break;
398 
399  case 17:
400  JjCheckNAddStates(0, 2);
401  break;
402 
403  case 19:
404  if (curChar != 126)
405  break;
406  if (kind > 20)
407  kind = 20;
408  jjstateSet[jjnewStateCnt++] = 20;
409  break;
410 
411  case 24:
412  if ((0x97ffffff87ffffffL & l) == (ulong) 0L)
413  break;
414  if (kind > 22)
415  kind = 22;
416  JjCheckNAddTwoStates(25, 26);
417  break;
418 
419  case 25:
420  if ((0x97ffffff87ffffffL & l) == (ulong) 0L)
421  break;
422  if (kind > 22)
423  kind = 22;
424  JjCheckNAddTwoStates(25, 26);
425  break;
426 
427  case 26:
428  if (curChar == 92)
429  JjCheckNAddTwoStates(27, 27);
430  break;
431 
432  case 27:
433  if (kind > 22)
434  kind = 22;
435  JjCheckNAddTwoStates(25, 26);
436  break;
437 
438  case 28:
439  if ((0x97ffffff87ffffffL & l) == (ulong) 0L)
440  break;
441  if (kind > 19)
442  kind = 19;
443  JjCheckNAddStates(3, 7);
444  break;
445 
446  case 29:
447  if ((0x97ffffff87ffffffL & l) == (ulong) 0L)
448  break;
449  if (kind > 19)
450  kind = 19;
451  JjCheckNAddTwoStates(29, 30);
452  break;
453 
454  case 30:
455  if (curChar == 92)
456  JjCheckNAddTwoStates(31, 31);
457  break;
458 
459  case 31:
460  if (kind > 19)
461  kind = 19;
462  JjCheckNAddTwoStates(29, 30);
463  break;
464 
465  case 32:
466  if ((0x97ffffff87ffffffL & l) != (ulong) 0L)
467  JjCheckNAddStates(10, 12);
468  break;
469 
470  case 33:
471  if (curChar == 92)
472  JjCheckNAddTwoStates(34, 34);
473  break;
474 
475  case 34:
476  JjCheckNAddStates(10, 12);
477  break;
478 
479  case 35:
480  if (curChar == 92)
481  JjCheckNAddStates(13, 15);
482  break;
483 
484  default: break;
485 
486  }
487  }
488  while (i != startsAt);
489  }
490  else
491  {
492  int hiByte = (int) (curChar >> 8);
493  int i1 = hiByte >> 6;
494  ulong l1 = (ulong) (1L << (hiByte & 63));
495  int i2 = (curChar & 0xff) >> 6;
496  ulong l2 = (ulong) (1L << (curChar & 63));
497  do
498  {
499  switch (jjstateSet[--i])
500  {
501 
502  case 36:
503  case 25:
504  if (!JjCanMove_2(hiByte, i1, i2, l1, l2))
505  break;
506  if (kind > 22)
507  kind = 22;
508  JjCheckNAddTwoStates(25, 26);
509  break;
510 
511  case 0:
512  if (JjCanMove_0(hiByte, i1, i2, l1, l2))
513  {
514  if (kind > 7)
515  kind = 7;
516  }
517  if (JjCanMove_2(hiByte, i1, i2, l1, l2))
518  {
519  if (kind > 22)
520  kind = 22;
521  JjCheckNAddTwoStates(25, 26);
522  }
523  if (JjCanMove_2(hiByte, i1, i2, l1, l2))
524  {
525  if (kind > 19)
526  kind = 19;
527  JjCheckNAddStates(3, 7);
528  }
529  break;
530 
531  case 15:
532  case 17:
533  if (JjCanMove_1(hiByte, i1, i2, l1, l2))
534  JjCheckNAddStates(0, 2);
535  break;
536 
537  case 24:
538  if (!JjCanMove_2(hiByte, i1, i2, l1, l2))
539  break;
540  if (kind > 22)
541  kind = 22;
542  JjCheckNAddTwoStates(25, 26);
543  break;
544 
545  case 27:
546  if (!JjCanMove_1(hiByte, i1, i2, l1, l2))
547  break;
548  if (kind > 22)
549  kind = 22;
550  JjCheckNAddTwoStates(25, 26);
551  break;
552 
553  case 28:
554  if (!JjCanMove_2(hiByte, i1, i2, l1, l2))
555  break;
556  if (kind > 19)
557  kind = 19;
558  JjCheckNAddStates(3, 7);
559  break;
560 
561  case 29:
562  if (!JjCanMove_2(hiByte, i1, i2, l1, l2))
563  break;
564  if (kind > 19)
565  kind = 19;
566  JjCheckNAddTwoStates(29, 30);
567  break;
568 
569  case 31:
570  if (!JjCanMove_1(hiByte, i1, i2, l1, l2))
571  break;
572  if (kind > 19)
573  kind = 19;
574  JjCheckNAddTwoStates(29, 30);
575  break;
576 
577  case 32:
578  if (JjCanMove_2(hiByte, i1, i2, l1, l2))
579  JjCheckNAddStates(10, 12);
580  break;
581 
582  case 34:
583  if (JjCanMove_1(hiByte, i1, i2, l1, l2))
584  JjCheckNAddStates(10, 12);
585  break;
586 
587  default: break;
588 
589  }
590  }
591  while (i != startsAt);
592  }
593  if (kind != 0x7fffffff)
594  {
595  jjmatchedKind = kind;
596  jjmatchedPos = curPos;
597  kind = 0x7fffffff;
598  }
599  ++curPos;
600  if ((i = jjnewStateCnt) == (startsAt = 36 - (jjnewStateCnt = startsAt)))
601  return curPos;
602  try
603  {
604  curChar = input_stream.ReadChar();
605  }
606  catch (System.IO.IOException)
607  {
608  return curPos;
609  }
610  }
611  }
612  private int JjStopStringLiteralDfa_1(int pos, long active0)
613  {
614  switch (pos)
615  {
616 
617  case 0:
618  if ((active0 & 0x40000000L) != 0L)
619  {
620  jjmatchedKind = 33;
621  return 6;
622  }
623  return - 1;
624 
625  default:
626  return - 1;
627 
628  }
629  }
630  private int JjStartNfa_1(int pos, long active0)
631  {
632  return JjMoveNfa_1(JjStopStringLiteralDfa_1(pos, active0), pos + 1);
633  }
634  private int JjMoveStringLiteralDfa0_1()
635  {
636  switch (curChar)
637  {
638 
639  case (char) (84):
640  return JjMoveStringLiteralDfa1_1(0x40000000L);
641 
642  case (char) (125):
643  return JjStopAtPos(0, 31);
644 
645  default:
646  return JjMoveNfa_1(0, 0);
647 
648  }
649  }
650  private int JjMoveStringLiteralDfa1_1(long active0)
651  {
652  try
653  {
654  curChar = input_stream.ReadChar();
655  }
656  catch (System.IO.IOException)
657  {
658  JjStopStringLiteralDfa_1(0, active0);
659  return 1;
660  }
661  switch (curChar)
662  {
663 
664  case (char) (79):
665  if ((active0 & 0x40000000L) != 0L)
666  return JjStartNfaWithStates_1(1, 30, 6);
667  break;
668 
669  default:
670  break;
671 
672  }
673  return JjStartNfa_1(0, active0);
674  }
675  private int JjStartNfaWithStates_1(int pos, int kind, int state)
676  {
677  jjmatchedKind = kind;
678  jjmatchedPos = pos;
679  try
680  {
681  curChar = input_stream.ReadChar();
682  }
683  catch (System.IO.IOException)
684  {
685  return pos + 1;
686  }
687  return JjMoveNfa_1(state, pos + 1);
688  }
689  private int JjMoveNfa_1(int startState, int curPos)
690  {
691  int startsAt = 0;
692  jjnewStateCnt = 7;
693  int i = 1;
694  jjstateSet[0] = startState;
695  int kind = 0x7fffffff;
696  for (; ; )
697  {
698  if (++jjround == 0x7fffffff)
699  ReInitRounds();
700  if (curChar < 64)
701  {
702  ulong l = (ulong) (1L << (int) curChar);
703  do
704  {
705  switch (jjstateSet[--i])
706  {
707 
708  case 0:
709  if ((0xfffffffeffffffffL & l) != (ulong) 0L)
710  {
711  if (kind > 33)
712  kind = 33;
713  JjCheckNAdd(6);
714  }
715  if ((0x100002600L & l) != 0L)
716  {
717  if (kind > 7)
718  kind = 7;
719  }
720  else if (curChar == 34)
721  JjCheckNAddTwoStates(2, 4);
722  break;
723 
724  case 1:
725  if (curChar == 34)
726  JjCheckNAddTwoStates(2, 4);
727  break;
728 
729  case 2:
730  if ((0xfffffffbffffffffL & l) != (ulong) 0L)
731  JjCheckNAddStates(16, 18);
732  break;
733 
734  case 3:
735  if (curChar == 34)
736  JjCheckNAddStates(16, 18);
737  break;
738 
739  case 5:
740  if (curChar == 34 && kind > 32)
741  kind = 32;
742  break;
743 
744  case 6:
745  if ((0xfffffffeffffffffL & l) == (ulong) 0L)
746  break;
747  if (kind > 33)
748  kind = 33;
749  JjCheckNAdd(6);
750  break;
751 
752  default: break;
753 
754  }
755  }
756  while (i != startsAt);
757  }
758  else if (curChar < 128)
759  {
760  ulong l = (ulong) (1L << (curChar & 63));
761  do
762  {
763  switch (jjstateSet[--i])
764  {
765 
766  case 0:
767  case 6:
768  if ((0xdfffffffffffffffL & l) == (ulong) 0L)
769  break;
770  if (kind > 33)
771  kind = 33;
772  JjCheckNAdd(6);
773  break;
774 
775  case 2:
776  JjAddStates(16, 18);
777  break;
778 
779  case 4:
780  if (curChar == 92)
781  jjstateSet[jjnewStateCnt++] = 3;
782  break;
783 
784  default: break;
785 
786  }
787  }
788  while (i != startsAt);
789  }
790  else
791  {
792  int hiByte = (int) (curChar >> 8);
793  int i1 = hiByte >> 6;
794  ulong l1 = (ulong) (1L << (hiByte & 63));
795  int i2 = (curChar & 0xff) >> 6;
796  ulong l2 = (ulong) (1L << (curChar & 63));
797  do
798  {
799  switch (jjstateSet[--i])
800  {
801 
802  case 0:
803  if (JjCanMove_0(hiByte, i1, i2, l1, l2))
804  {
805  if (kind > 7)
806  kind = 7;
807  }
808  if (JjCanMove_1(hiByte, i1, i2, l1, l2))
809  {
810  if (kind > 33)
811  kind = 33;
812  JjCheckNAdd(6);
813  }
814  break;
815 
816  case 2:
817  if (JjCanMove_1(hiByte, i1, i2, l1, l2))
818  JjAddStates(16, 18);
819  break;
820 
821  case 6:
822  if (!JjCanMove_1(hiByte, i1, i2, l1, l2))
823  break;
824  if (kind > 33)
825  kind = 33;
826  JjCheckNAdd(6);
827  break;
828 
829  default: break;
830 
831  }
832  }
833  while (i != startsAt);
834  }
835  if (kind != 0x7fffffff)
836  {
837  jjmatchedKind = kind;
838  jjmatchedPos = curPos;
839  kind = 0x7fffffff;
840  }
841  ++curPos;
842  if ((i = jjnewStateCnt) == (startsAt = 7 - (jjnewStateCnt = startsAt)))
843  return curPos;
844  try
845  {
846  curChar = input_stream.ReadChar();
847  }
848  catch (System.IO.IOException)
849  {
850  return curPos;
851  }
852  }
853  }
854  private int JjMoveStringLiteralDfa0_0()
855  {
856  return JjMoveNfa_0(0, 0);
857  }
858  private int JjMoveNfa_0(int startState, int curPos)
859  {
860  int startsAt = 0;
861  jjnewStateCnt = 3;
862  int i = 1;
863  jjstateSet[0] = startState;
864  int kind = 0x7fffffff;
865  for (; ; )
866  {
867  if (++jjround == 0x7fffffff)
868  ReInitRounds();
869  if (curChar < 64)
870  {
871  ulong l = (ulong) (1L << (int) curChar);
872  do
873  {
874  switch (jjstateSet[--i])
875  {
876 
877  case 0:
878  if ((0x3ff000000000000L & l) == 0L)
879  break;
880  if (kind > 25)
881  kind = 25;
882  JjAddStates(19, 20);
883  break;
884 
885  case 1:
886  if (curChar == 46)
887  JjCheckNAdd(2);
888  break;
889 
890  case 2:
891  if ((0x3ff000000000000L & l) == 0L)
892  break;
893  if (kind > 25)
894  kind = 25;
895  JjCheckNAdd(2);
896  break;
897 
898  default: break;
899 
900  }
901  }
902  while (i != startsAt);
903  }
904  else if (curChar < 128)
905  {
906  ulong l = (ulong) (1L << (curChar & 63));
907  do
908  {
909  switch (jjstateSet[--i])
910  {
911 
912  default: break;
913 
914  }
915  }
916  while (i != startsAt);
917  }
918  else
919  {
920  int hiByte = (int) (curChar >> 8);
921  int i1 = hiByte >> 6;
922  long l1 = 1L << (hiByte & 63);
923  int i2 = (curChar & 0xff) >> 6;
924  long l2 = 1L << (curChar & 63);
925  do
926  {
927  switch (jjstateSet[--i])
928  {
929 
930  default: break;
931 
932  }
933  }
934  while (i != startsAt);
935  }
936  if (kind != 0x7fffffff)
937  {
938  jjmatchedKind = kind;
939  jjmatchedPos = curPos;
940  kind = 0x7fffffff;
941  }
942  ++curPos;
943  if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt)))
944  return curPos;
945  try
946  {
947  curChar = input_stream.ReadChar();
948  }
949  catch (System.IO.IOException)
950  {
951  return curPos;
952  }
953  }
954  }
955  private int JjStopStringLiteralDfa_2(int pos, long active0)
956  {
957  switch (pos)
958  {
959 
960  case 0:
961  if ((active0 & 0x4000000L) != 0L)
962  {
963  jjmatchedKind = 29;
964  return 6;
965  }
966  return - 1;
967 
968  default:
969  return - 1;
970 
971  }
972  }
973  private int JjStartNfa_2(int pos, long active0)
974  {
975  return JjMoveNfa_2(JjStopStringLiteralDfa_2(pos, active0), pos + 1);
976  }
977  private int JjMoveStringLiteralDfa0_2()
978  {
979  switch (curChar)
980  {
981 
982  case (char) (84):
983  return JjMoveStringLiteralDfa1_2(0x4000000L);
984 
985  case (char) (93):
986  return JjStopAtPos(0, 27);
987 
988  default:
989  return JjMoveNfa_2(0, 0);
990 
991  }
992  }
993  private int JjMoveStringLiteralDfa1_2(long active0)
994  {
995  try
996  {
997  curChar = input_stream.ReadChar();
998  }
999  catch (System.IO.IOException)
1000  {
1001  JjStopStringLiteralDfa_2(0, active0);
1002  return 1;
1003  }
1004  switch (curChar)
1005  {
1006 
1007  case (char) (79):
1008  if ((active0 & 0x4000000L) != 0L)
1009  return JjStartNfaWithStates_2(1, 26, 6);
1010  break;
1011 
1012  default:
1013  break;
1014 
1015  }
1016  return JjStartNfa_2(0, active0);
1017  }
1018  private int JjStartNfaWithStates_2(int pos, int kind, int state)
1019  {
1020  jjmatchedKind = kind;
1021  jjmatchedPos = pos;
1022  try
1023  {
1024  curChar = input_stream.ReadChar();
1025  }
1026  catch (System.IO.IOException)
1027  {
1028  return pos + 1;
1029  }
1030  return JjMoveNfa_2(state, pos + 1);
1031  }
1032  private int JjMoveNfa_2(int startState, int curPos)
1033  {
1034  int startsAt = 0;
1035  jjnewStateCnt = 7;
1036  int i = 1;
1037  jjstateSet[0] = startState;
1038  int kind = 0x7fffffff;
1039  for (; ; )
1040  {
1041  if (++jjround == 0x7fffffff)
1042  ReInitRounds();
1043  if (curChar < 64)
1044  {
1045  ulong l = (ulong) (1L << (int) curChar);
1046  do
1047  {
1048  switch (jjstateSet[--i])
1049  {
1050 
1051  case 0:
1052  if ((0xfffffffeffffffffL & l) != (ulong) 0L)
1053  {
1054  if (kind > 29)
1055  kind = 29;
1056  JjCheckNAdd(6);
1057  }
1058  if ((0x100002600L & l) != 0L)
1059  {
1060  if (kind > 7)
1061  kind = 7;
1062  }
1063  else if (curChar == 34)
1064  JjCheckNAddTwoStates(2, 4);
1065  break;
1066 
1067  case 1:
1068  if (curChar == 34)
1069  JjCheckNAddTwoStates(2, 4);
1070  break;
1071 
1072  case 2:
1073  if ((0xfffffffbffffffffL & l) != (ulong) 0L)
1074  JjCheckNAddStates(16, 18);
1075  break;
1076 
1077  case 3:
1078  if (curChar == 34)
1079  JjCheckNAddStates(16, 18);
1080  break;
1081 
1082  case 5:
1083  if (curChar == 34 && kind > 28)
1084  kind = 28;
1085  break;
1086 
1087  case 6:
1088  if ((0xfffffffeffffffffL & l) == (ulong) 0L)
1089  break;
1090  if (kind > 29)
1091  kind = 29;
1092  JjCheckNAdd(6);
1093  break;
1094 
1095  default: break;
1096 
1097  }
1098  }
1099  while (i != startsAt);
1100  }
1101  else if (curChar < 128)
1102  {
1103  ulong l = (ulong) (1L << (curChar & 63));
1104  do
1105  {
1106  switch (jjstateSet[--i])
1107  {
1108 
1109  case 0:
1110  case 6:
1111  if ((0xffffffffdfffffffL & l) == (ulong) 0L)
1112  break;
1113  if (kind > 29)
1114  kind = 29;
1115  JjCheckNAdd(6);
1116  break;
1117 
1118  case 2:
1119  JjAddStates(16, 18);
1120  break;
1121 
1122  case 4:
1123  if (curChar == 92)
1124  jjstateSet[jjnewStateCnt++] = 3;
1125  break;
1126 
1127  default: break;
1128 
1129  }
1130  }
1131  while (i != startsAt);
1132  }
1133  else
1134  {
1135  int hiByte = (int) (curChar >> 8);
1136  int i1 = hiByte >> 6;
1137  ulong l1 = (ulong) (1L << (hiByte & 63));
1138  int i2 = (curChar & 0xff) >> 6;
1139  ulong l2 = (ulong) (1L << (curChar & 63));
1140  do
1141  {
1142  switch (jjstateSet[--i])
1143  {
1144 
1145  case 0:
1146  if (JjCanMove_0(hiByte, i1, i2, l1, l2))
1147  {
1148  if (kind > 7)
1149  kind = 7;
1150  }
1151  if (JjCanMove_1(hiByte, i1, i2, l1, l2))
1152  {
1153  if (kind > 29)
1154  kind = 29;
1155  JjCheckNAdd(6);
1156  }
1157  break;
1158 
1159  case 2:
1160  if (JjCanMove_1(hiByte, i1, i2, l1, l2))
1161  JjAddStates(16, 18);
1162  break;
1163 
1164  case 6:
1165  if (!JjCanMove_1(hiByte, i1, i2, l1, l2))
1166  break;
1167  if (kind > 29)
1168  kind = 29;
1169  JjCheckNAdd(6);
1170  break;
1171 
1172  default: break;
1173 
1174  }
1175  }
1176  while (i != startsAt);
1177  }
1178  if (kind != 0x7fffffff)
1179  {
1180  jjmatchedKind = kind;
1181  jjmatchedPos = curPos;
1182  kind = 0x7fffffff;
1183  }
1184  ++curPos;
1185  if ((i = jjnewStateCnt) == (startsAt = 7 - (jjnewStateCnt = startsAt)))
1186  return curPos;
1187  try
1188  {
1189  curChar = input_stream.ReadChar();
1190  }
1191  catch (System.IO.IOException)
1192  {
1193  return curPos;
1194  }
1195  }
1196  }
1197  internal static readonly int[] jjnextStates = new int[]{15, 16, 18, 29, 32, 23, 33, 30, 20, 21, 32, 23, 33, 31, 34, 27, 2, 4, 5, 0, 1};
1198  private static bool JjCanMove_0(int hiByte, int i1, int i2, ulong l1, ulong l2)
1199  {
1200  switch (hiByte)
1201  {
1202 
1203  case 48:
1204  return ((jjbitVec0[i2] & l2) != (ulong) 0L);
1205 
1206  default:
1207  return false;
1208 
1209  }
1210  }
1211  private static bool JjCanMove_1(int hiByte, int i1, int i2, ulong l1, ulong l2)
1212  {
1213  switch (hiByte)
1214  {
1215 
1216  case 0:
1217  return ((jjbitVec3[i2] & l2) != (ulong) 0L);
1218 
1219  default:
1220  if ((jjbitVec1[i1] & l1) != (ulong) 0L)
1221  return true;
1222  return false;
1223 
1224  }
1225  }
1226  private static bool JjCanMove_2(int hiByte, int i1, int i2, ulong l1, ulong l2)
1227  {
1228  switch (hiByte)
1229  {
1230 
1231  case 0:
1232  return ((jjbitVec3[i2] & l2) != (ulong) 0L);
1233 
1234  case 48:
1235  return ((jjbitVec1[i2] & l2) != (ulong) 0L);
1236 
1237  default:
1238  if ((jjbitVec4[i1] & l1) != (ulong) 0L)
1239  return true;
1240  return false;
1241 
1242  }
1243  }
1244 
1246  public static readonly System.String[] jjstrLiteralImages = new System.String[]{"", null, null, null, null, null, null, null, null, null, null, "\x002B", "\x002D", "\x0028", "\x0029", "\x003A", "\x002A", "\x005E", null, null, null, null, null, "\x005B", "\x007B", null, "\x0054\x004F", "\x005D", null, null, "\x0054\x004F", "\x007D", null, null};
1247 
1249  public static readonly System.String[] lexStateNames = new System.String[]{"Boost", "RangeEx", "RangeIn", "DEFAULT"};
1250 
1252  public static readonly int[] jjnewLexState = new int[]{- 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, 0, - 1, - 1, - 1, - 1, - 1, 2, 1, 3, - 1, 3, - 1, - 1, - 1, 3, - 1, - 1};
1253  internal static readonly ulong[] jjtoToken = new ulong[]{0x3ffffff01L};
1254  internal static readonly long[] jjtoSkip = new long[]{0x80L};
1255  protected internal ICharStream input_stream;
1256  private uint[] jjrounds = new uint[36];
1257  private int[] jjstateSet = new int[72];
1258  protected internal char curChar;
1261  {
1262  InitBlock();
1263  input_stream = stream;
1264  }
1265 
1267  public QueryParserTokenManager(ICharStream stream, int lexState):this(stream)
1268  {
1269  SwitchTo(lexState);
1270  }
1271 
1273  public virtual void ReInit(ICharStream stream)
1274  {
1275  jjmatchedPos = jjnewStateCnt = 0;
1276  curLexState = defaultLexState;
1277  input_stream = stream;
1278  ReInitRounds();
1279  }
1280  private void ReInitRounds()
1281  {
1282  int i;
1283  jjround = 0x80000001;
1284  for (i = 36; i-- > 0; )
1285  jjrounds[i] = 0x80000000;
1286  }
1287 
1289  public virtual void ReInit(ICharStream stream, int lexState)
1290  {
1291  ReInit(stream);
1292  SwitchTo(lexState);
1293  }
1294 
1296  public virtual void SwitchTo(int lexState)
1297  {
1298  if (lexState >= 4 || lexState < 0)
1299  throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
1300  else
1301  curLexState = lexState;
1302  }
1303 
1304  protected internal virtual Token JjFillToken()
1305  {
1306  Token t;
1307  System.String curTokenImage;
1308  int beginLine;
1309  int endLine;
1310  int beginColumn;
1311  int endColumn;
1312  System.String im = jjstrLiteralImages[jjmatchedKind];
1313  curTokenImage = (im == null)?input_stream.Image:im;
1314  beginLine = input_stream.BeginLine;
1315  beginColumn = input_stream.BeginColumn;
1316  endLine = input_stream.EndLine;
1317  endColumn = input_stream.EndColumn;
1318  t = Token.NewToken(jjmatchedKind, curTokenImage);
1319 
1320  t.beginLine = beginLine;
1321  t.endLine = endLine;
1322  t.beginColumn = beginColumn;
1323  t.endColumn = endColumn;
1324 
1325  return t;
1326  }
1327 
1328  internal int curLexState = 3;
1329  internal int defaultLexState = 3;
1330  internal int jjnewStateCnt;
1331  internal uint jjround;
1332  internal int jjmatchedPos;
1333  internal int jjmatchedKind;
1334 
1336  [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
1337  public virtual Token GetNextToken()
1338  {
1339  Token matchedToken;
1340  int curPos = 0;
1341 
1342  for (; ; )
1343  {
1344  try
1345  {
1346  curChar = input_stream.BeginToken();
1347  }
1348  catch (System.IO.IOException)
1349  {
1350  jjmatchedKind = 0;
1351  matchedToken = JjFillToken();
1352  return matchedToken;
1353  }
1354 
1355  switch (curLexState)
1356  {
1357 
1358  case 0:
1359  jjmatchedKind = 0x7fffffff;
1360  jjmatchedPos = 0;
1361  curPos = JjMoveStringLiteralDfa0_0();
1362  break;
1363 
1364  case 1:
1365  jjmatchedKind = 0x7fffffff;
1366  jjmatchedPos = 0;
1367  curPos = JjMoveStringLiteralDfa0_1();
1368  break;
1369 
1370  case 2:
1371  jjmatchedKind = 0x7fffffff;
1372  jjmatchedPos = 0;
1373  curPos = JjMoveStringLiteralDfa0_2();
1374  break;
1375 
1376  case 3:
1377  jjmatchedKind = 0x7fffffff;
1378  jjmatchedPos = 0;
1379  curPos = JjMoveStringLiteralDfa0_3();
1380  break;
1381  }
1382  if (jjmatchedKind != 0x7fffffff)
1383  {
1384  if (jjmatchedPos + 1 < curPos)
1385  input_stream.Backup(curPos - jjmatchedPos - 1);
1386  if ((jjtoToken[jjmatchedKind >> 6] & ((ulong) 1L << (jjmatchedKind & 63))) != (ulong) 0L)
1387  {
1388  matchedToken = JjFillToken();
1389  if (jjnewLexState[jjmatchedKind] != - 1)
1390  curLexState = jjnewLexState[jjmatchedKind];
1391  return matchedToken;
1392  }
1393  else
1394  {
1395  if (jjnewLexState[jjmatchedKind] != - 1)
1396  curLexState = jjnewLexState[jjmatchedKind];
1397  goto EOFLoop;
1398  }
1399  }
1400  int error_line = input_stream.EndLine;
1401  int error_column = input_stream.EndColumn;
1402  System.String error_after = null;
1403  bool EOFSeen = false;
1404  try
1405  {
1406  input_stream.ReadChar(); input_stream.Backup(1);
1407  }
1408  catch (System.IO.IOException)
1409  {
1410  EOFSeen = true;
1411  error_after = curPos <= 1?"":input_stream.Image;
1412  if (curChar == '\n' || curChar == '\r')
1413  {
1414  error_line++;
1415  error_column = 0;
1416  }
1417  else
1418  error_column++;
1419  }
1420  if (!EOFSeen)
1421  {
1422  input_stream.Backup(1);
1423  error_after = curPos <= 1?"":input_stream.Image;
1424  }
1425  throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
1426 
1427 EOFLoop: ;
1428  }
1429  }
1430 
1431  private void JjCheckNAdd(int state)
1432  {
1433  if (jjrounds[state] != jjround)
1434  {
1435  jjstateSet[jjnewStateCnt++] = state;
1436  jjrounds[state] = jjround;
1437  }
1438  }
1439  private void JjAddStates(int start, int end)
1440  {
1441  do
1442  {
1443  jjstateSet[jjnewStateCnt++] = jjnextStates[start];
1444  }
1445  while (start++ != end);
1446  }
1447  private void JjCheckNAddTwoStates(int state1, int state2)
1448  {
1449  JjCheckNAdd(state1);
1450  JjCheckNAdd(state2);
1451  }
1452 
1453  private void JjCheckNAddStates(int start, int end)
1454  {
1455  do
1456  {
1457  JjCheckNAdd(jjnextStates[start]);
1458  }
1459  while (start++ != end);
1460  }
1461  }
1462 }