cvsimport
[beagle.git] / beagled / Lucene.Net / QueryParser / QueryParserTokenManager.cs
blob01221b4a8f3e8656e5a3259dcdcd10b30066ba56
1 /*
2 * Copyright 2004 The Apache Software Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 /* Generated By:JavaCC: Do not edit this line. QueryParserTokenManager.java */
19 using System;
20 using Lucene.Net.Analysis;
21 using Lucene.Net.Documents;
22 using Term = Lucene.Net.Index.Term;
23 using Lucene.Net.Search;
24 using Searchable = Lucene.Net.Search.Searchable;
25 using Parameter = Lucene.Net.Util.Parameter;
27 namespace Lucene.Net.QueryParsers
30 public class QueryParserTokenManager : QueryParserConstants
32 private void InitBlock()
35 private int JjStopStringLiteralDfa_3(int pos, long active0)
37 switch (pos)
40 default:
41 return - 1;
45 private int JjStartNfa_3(int pos, long active0)
47 return JjMoveNfa_3(JjStopStringLiteralDfa_3(pos, active0), pos + 1);
49 private int JjStopAtPos(int pos, int kind)
51 jjmatchedKind = kind;
52 jjmatchedPos = pos;
53 return pos + 1;
55 private int JjStartNfaWithStates_3(int pos, int kind, int state)
57 jjmatchedKind = kind;
58 jjmatchedPos = pos;
59 try
61 curChar = input_stream.ReadChar();
63 catch (System.IO.IOException)
65 return pos + 1;
67 return JjMoveNfa_3(state, pos + 1);
69 private int JjMoveStringLiteralDfa0_3()
71 switch (curChar)
74 case (char) (40):
75 return JjStopAtPos(0, 12);
77 case (char) (41):
78 return JjStopAtPos(0, 13);
80 case (char) (43):
81 return JjStopAtPos(0, 10);
83 case (char) (45):
84 return JjStopAtPos(0, 11);
86 case (char) (58):
87 return JjStopAtPos(0, 14);
89 case (char) (91):
90 return JjStopAtPos(0, 21);
92 case (char) (94):
93 return JjStopAtPos(0, 15);
95 case (char) (123):
96 return JjStopAtPos(0, 22);
98 default:
99 return JjMoveNfa_3(0, 0);
103 private void JjCheckNAdd(int state)
105 if (jjrounds[state] != jjround)
107 jjstateSet[jjnewStateCnt++] = state;
108 jjrounds[state] = jjround;
111 private void JjAddStates(int start, int end)
115 jjstateSet[jjnewStateCnt++] = jjnextStates[start];
117 while (start++ != end);
119 private void JjCheckNAddTwoStates(int state1, int state2)
121 JjCheckNAdd(state1);
122 JjCheckNAdd(state2);
124 private void JjCheckNAddStates(int start, int end)
128 JjCheckNAdd(jjnextStates[start]);
130 while (start++ != end);
132 private void JjCheckNAddStates(int start)
134 JjCheckNAdd(jjnextStates[start]);
135 JjCheckNAdd(jjnextStates[start + 1]);
137 internal static readonly ulong[] jjbitVec0 = new ulong[]{0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL};
138 internal static readonly ulong[] jjbitVec2 = new ulong[]{0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL};
139 private int JjMoveNfa_3(int startState, int curPos)
141 int[] nextStates;
142 int startsAt = 0;
143 jjnewStateCnt = 33;
144 int i = 1;
145 jjstateSet[0] = startState;
146 int j, kind = 0x7fffffff;
147 for (; ; )
149 if (++jjround == 0x7fffffff)
150 ReInitRounds();
151 if (curChar < 64)
153 ulong l = ((ulong) 1L) << curChar;
154 MatchLoop:
157 switch (jjstateSet[--i])
160 case 0:
161 if ((0x7bffd0f8ffffd9ffL & l) != (ulong) 0L)
163 if (kind > 17)
164 kind = 17;
165 JjCheckNAddStates(0, 6);
167 else if ((0x100002600L & l) != (ulong) 0L)
169 if (kind > 6)
170 kind = 6;
172 else if (curChar == 34)
173 JjCheckNAdd(15);
174 else if (curChar == 33)
176 if (kind > 9)
177 kind = 9;
179 if (curChar == 38)
180 jjstateSet[jjnewStateCnt++] = 4;
181 break;
183 case 4:
184 if (curChar == 38 && kind > 7)
185 kind = 7;
186 break;
188 case 5:
189 if (curChar == 38)
190 jjstateSet[jjnewStateCnt++] = 4;
191 break;
193 case 13:
194 if (curChar == 33 && kind > 9)
195 kind = 9;
196 break;
198 case 14:
199 if (curChar == 34)
200 JjCheckNAdd(15);
201 break;
203 case 15:
204 if ((0xfffffffbffffffffL & l) != (ulong) 0L)
205 JjCheckNAddTwoStates(15, 16);
206 break;
208 case 16:
209 if (curChar == 34 && kind > 16)
210 kind = 16;
211 break;
213 case 18:
214 if ((0x3ff000000000000L & l) == (ulong) 0L)
215 break;
216 if (kind > 18)
217 kind = 18;
218 JjAddStates(7, 8);
219 break;
221 case 19:
222 if (curChar == 46)
223 JjCheckNAdd(20);
224 break;
226 case 20:
227 if ((0x3ff000000000000L & l) == (ulong) 0L)
228 break;
229 if (kind > 18)
230 kind = 18;
231 JjCheckNAdd(20);
232 break;
234 case 21:
235 if ((0x7bffd0f8ffffd9ffL & l) == (ulong) 0L)
236 break;
237 if (kind > 17)
238 kind = 17;
239 JjCheckNAddStates(0, 6);
240 break;
242 case 22:
243 if ((0x7bfff8f8ffffd9ffL & l) == (ulong) 0L)
244 break;
245 if (kind > 17)
246 kind = 17;
247 JjCheckNAddTwoStates(22, 23);
248 break;
250 case 24:
251 if ((0x84002f0600000000L & l) == (ulong) 0L)
252 break;
253 if (kind > 17)
254 kind = 17;
255 JjCheckNAddTwoStates(22, 23);
256 break;
258 case 25:
259 if ((0x7bfff8f8ffffd9ffL & l) != (ulong) 0L)
260 JjCheckNAddStates(9, 11);
261 break;
263 case 26:
264 if (curChar == 42 && kind > 19)
265 kind = 19;
266 break;
268 case 28:
269 if ((0x84002f0600000000L & l) != (ulong) 0L)
270 JjCheckNAddStates(9, 11);
271 break;
273 case 29:
274 if ((0xfbfffcf8ffffd9ffL & l) == (ulong) 0L)
275 break;
276 if (kind > 20)
277 kind = 20;
278 JjCheckNAddTwoStates(29, 30);
279 break;
281 case 31:
282 if ((0x84002f0600000000L & l) == (ulong) 0L)
283 break;
284 if (kind > 20)
285 kind = 20;
286 JjCheckNAddTwoStates(29, 30);
287 break;
289 default: break;
293 while (i != startsAt);
295 else if (curChar < 128)
297 ulong l = ((ulong) 1L) << (curChar & 63);
298 MatchLoop1:
301 switch (jjstateSet[--i])
304 case 0:
305 if ((0x97ffffff97ffffffL & l) != (ulong) 0L)
307 if (kind > 17)
308 kind = 17;
309 JjCheckNAddStates(0, 6);
311 else if (curChar == 126)
313 if (kind > 18)
314 kind = 18;
315 jjstateSet[jjnewStateCnt++] = 18;
317 if (curChar == 92)
318 JjCheckNAddStates(12, 14);
319 else if (curChar == 78)
320 jjstateSet[jjnewStateCnt++] = 11;
321 else if (curChar == 124)
322 jjstateSet[jjnewStateCnt++] = 8;
323 else if (curChar == 79)
324 jjstateSet[jjnewStateCnt++] = 6;
325 else if (curChar == 65)
326 jjstateSet[jjnewStateCnt++] = 2;
327 break;
329 case 1:
330 if (curChar == 68 && kind > 7)
331 kind = 7;
332 break;
334 case 2:
335 if (curChar == 78)
336 jjstateSet[jjnewStateCnt++] = 1;
337 break;
339 case 3:
340 if (curChar == 65)
341 jjstateSet[jjnewStateCnt++] = 2;
342 break;
344 case 6:
345 if (curChar == 82 && kind > 8)
346 kind = 8;
347 break;
349 case 7:
350 if (curChar == 79)
351 jjstateSet[jjnewStateCnt++] = 6;
352 break;
354 case 8:
355 if (curChar == 124 && kind > 8)
356 kind = 8;
357 break;
359 case 9:
360 if (curChar == 124)
361 jjstateSet[jjnewStateCnt++] = 8;
362 break;
364 case 10:
365 if (curChar == 84 && kind > 9)
366 kind = 9;
367 break;
369 case 11:
370 if (curChar == 79)
371 jjstateSet[jjnewStateCnt++] = 10;
372 break;
374 case 12:
375 if (curChar == 78)
376 jjstateSet[jjnewStateCnt++] = 11;
377 break;
379 case 15:
380 JjAddStates(15, 16);
381 break;
383 case 17:
384 if (curChar != 126)
385 break;
386 if (kind > 18)
387 kind = 18;
388 jjstateSet[jjnewStateCnt++] = 18;
389 break;
391 case 21:
392 if ((0x97ffffff97ffffffL & l) == (ulong) 0L)
393 break;
394 if (kind > 17)
395 kind = 17;
396 JjCheckNAddStates(0, 6);
397 break;
399 case 22:
400 if ((0x97ffffff97ffffffL & l) == (ulong) 0L)
401 break;
402 if (kind > 17)
403 kind = 17;
404 JjCheckNAddTwoStates(22, 23);
405 break;
407 case 23:
408 if (curChar == 92)
409 JjCheckNAddTwoStates(24, 24);
410 break;
412 case 24:
413 if ((0x6800000078000000L & l) == (ulong) 0L)
414 break;
415 if (kind > 17)
416 kind = 17;
417 JjCheckNAddTwoStates(22, 23);
418 break;
420 case 25:
421 if ((0x97ffffff97ffffffL & l) != (ulong) 0L)
422 JjCheckNAddStates(9, 11);
423 break;
425 case 27:
426 if (curChar == 92)
427 JjCheckNAddTwoStates(28, 28);
428 break;
430 case 28:
431 if ((0x6800000078000000L & l) != (ulong) 0L)
432 JjCheckNAddStates(9, 11);
433 break;
435 case 29:
436 if ((0x97ffffff97ffffffL & l) == (ulong) 0L)
437 break;
438 if (kind > 20)
439 kind = 20;
440 JjCheckNAddTwoStates(29, 30);
441 break;
443 case 30:
444 if (curChar == 92)
445 JjCheckNAddTwoStates(31, 31);
446 break;
448 case 31:
449 if ((0x6800000078000000L & l) == (ulong) 0L)
450 break;
451 if (kind > 20)
452 kind = 20;
453 JjCheckNAddTwoStates(29, 30);
454 break;
456 case 32:
457 if (curChar == 92)
458 JjCheckNAddStates(12, 14);
459 break;
461 default: break;
465 while (i != startsAt);
467 else
469 int hiByte = (int) (curChar >> 8);
470 int i1 = hiByte >> 6;
471 ulong l1 = ((ulong) 1L) << (hiByte & 63);
472 int i2 = (curChar & 0xff) >> 6;
473 ulong l2 = ((ulong) 1L) << (curChar & 63);
474 MatchLoop1:
477 switch (jjstateSet[--i])
480 case 0:
481 if (!JjCanMove_0(hiByte, i1, i2, (ulong) l1, (ulong) l2))
482 break;
483 if (kind > 17)
484 kind = 17;
485 JjCheckNAddStates(0, 6);
486 break;
488 case 15:
489 if (JjCanMove_0(hiByte, i1, i2, (ulong) l1, (ulong) l2))
490 JjAddStates(15, 16);
491 break;
493 case 22:
494 if (!JjCanMove_0(hiByte, i1, i2, (ulong) l1, (ulong) l2))
495 break;
496 if (kind > 17)
497 kind = 17;
498 JjCheckNAddTwoStates(22, 23);
499 break;
501 case 25:
502 if (JjCanMove_0(hiByte, i1, i2, (ulong) l1, (ulong) l2))
503 JjCheckNAddStates(9, 11);
504 break;
506 case 29:
507 if (!JjCanMove_0(hiByte, i1, i2, (ulong) l1, (ulong) l2))
508 break;
509 if (kind > 20)
510 kind = 20;
511 JjCheckNAddTwoStates(29, 30);
512 break;
514 default: break;
518 while (i != startsAt);
520 if (kind != 0x7fffffff)
522 jjmatchedKind = kind;
523 jjmatchedPos = curPos;
524 kind = 0x7fffffff;
526 ++curPos;
527 if ((i = jjnewStateCnt) == (startsAt = 33 - (jjnewStateCnt = startsAt)))
528 return curPos;
531 curChar = input_stream.ReadChar();
533 catch (System.IO.IOException e)
535 return curPos;
539 private int JjStopStringLiteralDfa_1(int pos, ulong active0)
541 switch (pos)
544 case 0:
545 if ((active0 & 0x10000000L) != 0L)
547 jjmatchedKind = 31;
548 return 4;
550 return - 1;
552 default:
553 return - 1;
557 private int JjStartNfa_1(int pos, ulong active0)
559 return JjMoveNfa_1(JjStopStringLiteralDfa_1(pos, (ulong) active0), pos + 1);
561 private int JjStartNfaWithStates_1(int pos, int kind, int state)
563 jjmatchedKind = kind;
564 jjmatchedPos = pos;
567 curChar = input_stream.ReadChar();
569 catch (System.IO.IOException)
571 return pos + 1;
573 return JjMoveNfa_1(state, pos + 1);
575 private int JjMoveStringLiteralDfa0_1()
577 switch (curChar)
580 case (char) (84):
581 return JjMoveStringLiteralDfa1_1((ulong) 0x10000000L);
583 case (char) (125):
584 return JjStopAtPos(0, 29);
586 default:
587 return JjMoveNfa_1(0, 0);
591 private int JjMoveStringLiteralDfa1_1(ulong active0)
595 curChar = input_stream.ReadChar();
597 catch (System.IO.IOException)
599 JjStopStringLiteralDfa_1(0, (ulong) active0);
600 return 1;
602 switch (curChar)
605 case (char) (79):
606 if ((active0 & 0x10000000L) != 0L)
607 return JjStartNfaWithStates_1(1, 28, 4);
608 break;
610 default:
611 break;
614 return JjStartNfa_1(0, (ulong) active0);
616 private int JjMoveNfa_1(int startState, int curPos)
618 int[] nextStates;
619 int startsAt = 0;
620 jjnewStateCnt = 5;
621 int i = 1;
622 jjstateSet[0] = startState;
623 int j, kind = 0x7fffffff;
624 for (; ; )
626 if (++jjround == 0x7fffffff)
627 ReInitRounds();
628 if (curChar < 64)
630 ulong l = ((ulong) 1L) << curChar;
631 MatchLoop1:
634 switch (jjstateSet[--i])
637 case 0:
638 if ((0xfffffffeffffffffL & l) != (ulong) 0L)
640 if (kind > 31)
641 kind = 31;
642 JjCheckNAdd(4);
644 if ((0x100002600L & l) != (ulong) 0L)
646 if (kind > 6)
647 kind = 6;
649 else if (curChar == 34)
650 JjCheckNAdd(2);
651 break;
653 case 1:
654 if (curChar == 34)
655 JjCheckNAdd(2);
656 break;
658 case 2:
659 if ((0xfffffffbffffffffL & l) != (ulong) 0L)
660 JjCheckNAddTwoStates(2, 3);
661 break;
663 case 3:
664 if (curChar == 34 && kind > 30)
665 kind = 30;
666 break;
668 case 4:
669 if ((0xfffffffeffffffffL & l) == (ulong) 0L)
670 break;
671 if (kind > 31)
672 kind = 31;
673 JjCheckNAdd(4);
674 break;
676 default: break;
680 while (i != startsAt);
682 else if (curChar < 128)
684 ulong l = ((ulong) 1L) << (curChar & 63);
685 MatchLoop1:
688 switch (jjstateSet[--i])
691 case 0:
692 case 4:
693 if ((0xdfffffffffffffffL & l) == (ulong) 0L)
694 break;
695 if (kind > 31)
696 kind = 31;
697 JjCheckNAdd(4);
698 break;
700 case 2:
701 JjAddStates(17, 18);
702 break;
704 default: break;
708 while (i != startsAt);
710 else
712 int hiByte = (int) (curChar >> 8);
713 int i1 = hiByte >> 6;
714 ulong l1 = ((ulong) 1L) << (hiByte & 63);
715 int i2 = (curChar & 0xff) >> 6;
716 ulong l2 = ((ulong) 1L) << (curChar & 63);
717 MatchLoop1:
720 switch (jjstateSet[--i])
723 case 0:
724 case 4:
725 if (!JjCanMove_0(hiByte, i1, i2, (ulong) l1, (ulong) l2))
726 break;
727 if (kind > 31)
728 kind = 31;
729 JjCheckNAdd(4);
730 break;
732 case 2:
733 if (JjCanMove_0(hiByte, i1, i2, (ulong) l1, (ulong) l2))
734 JjAddStates(17, 18);
735 break;
737 default: break;
741 while (i != startsAt);
743 if (kind != 0x7fffffff)
745 jjmatchedKind = kind;
746 jjmatchedPos = curPos;
747 kind = 0x7fffffff;
749 ++curPos;
750 if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt)))
751 return curPos;
754 curChar = input_stream.ReadChar();
756 catch (System.IO.IOException)
758 return curPos;
762 private int JjMoveStringLiteralDfa0_0()
764 return JjMoveNfa_0(0, 0);
766 private int JjMoveNfa_0(int startState, int curPos)
768 int[] nextStates;
769 int startsAt = 0;
770 jjnewStateCnt = 3;
771 int i = 1;
772 jjstateSet[0] = startState;
773 int j, kind = 0x7fffffff;
774 for (; ; )
776 if (++jjround == 0x7fffffff)
777 ReInitRounds();
778 if (curChar < 64)
780 ulong l = ((ulong) 1L) << curChar;
781 MatchLoop1:
784 switch (jjstateSet[--i])
787 case 0:
788 if ((0x3ff000000000000L & l) == (ulong) 0L)
789 break;
790 if (kind > 23)
791 kind = 23;
792 JjAddStates(19, 20);
793 break;
795 case 1:
796 if (curChar == 46)
797 JjCheckNAdd(2);
798 break;
800 case 2:
801 if ((0x3ff000000000000L & l) == (ulong) 0L)
802 break;
803 if (kind > 23)
804 kind = 23;
805 JjCheckNAdd(2);
806 break;
808 default: break;
812 while (i != startsAt);
814 else if (curChar < 128)
816 ulong l = ((ulong) 1L) << (curChar & 63);
817 MatchLoop1:
820 switch (jjstateSet[--i])
823 default: break;
827 while (i != startsAt);
829 else
831 int hiByte = (int) (curChar >> 8);
832 int i1 = hiByte >> 6;
833 ulong l1 = ((ulong) 1L) << (hiByte & 63);
834 int i2 = (curChar & 0xff) >> 6;
835 ulong l2 = ((ulong) 1L) << (curChar & 63);
836 MatchLoop1:
839 switch (jjstateSet[--i])
842 default: break;
846 while (i != startsAt);
848 if (kind != 0x7fffffff)
850 jjmatchedKind = kind;
851 jjmatchedPos = curPos;
852 kind = 0x7fffffff;
854 ++curPos;
855 if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt)))
856 return curPos;
859 curChar = input_stream.ReadChar();
861 catch (System.IO.IOException e)
863 return curPos;
867 private int JjStopStringLiteralDfa_2(int pos, ulong active0)
869 switch (pos)
872 case 0:
873 if ((active0 & 0x1000000L) != (ulong) 0L)
875 jjmatchedKind = 27;
876 return 4;
878 return - 1;
880 default:
881 return - 1;
885 private int JjStartNfa_2(int pos, ulong active0)
887 return JjMoveNfa_2(JjStopStringLiteralDfa_2(pos, (ulong) active0), pos + 1);
889 private int JjStartNfaWithStates_2(int pos, int kind, int state)
891 jjmatchedKind = kind;
892 jjmatchedPos = pos;
895 curChar = input_stream.ReadChar();
897 catch (System.IO.IOException e)
899 return pos + 1;
901 return JjMoveNfa_2(state, pos + 1);
903 private int JjMoveStringLiteralDfa0_2()
905 switch (curChar)
908 case (char) (84):
909 return JjMoveStringLiteralDfa1_2((ulong) 0x1000000L);
911 case (char) (93):
912 return JjStopAtPos(0, 25);
914 default:
915 return JjMoveNfa_2(0, 0);
919 private int JjMoveStringLiteralDfa1_2(ulong active0)
923 curChar = input_stream.ReadChar();
925 catch (System.IO.IOException e)
927 JjStopStringLiteralDfa_2(0, (ulong) active0);
928 return 1;
930 switch (curChar)
933 case (char) (79):
934 if ((active0 & 0x1000000L) != (ulong) 0L)
935 return JjStartNfaWithStates_2(1, 24, 4);
936 break;
938 default:
939 break;
942 return JjStartNfa_2(0, (ulong) active0);
944 private int JjMoveNfa_2(int startState, int curPos)
946 int[] nextStates;
947 int startsAt = 0;
948 jjnewStateCnt = 5;
949 int i = 1;
950 jjstateSet[0] = startState;
951 int j, kind = 0x7fffffff;
952 for (; ; )
954 if (++jjround == 0x7fffffff)
955 ReInitRounds();
956 if (curChar < 64)
958 ulong l = ((ulong) 1L) << curChar;
959 MatchLoop1:
962 switch (jjstateSet[--i])
965 case 0:
966 if ((0xfffffffeffffffffL & l) != (ulong) 0L)
968 if (kind > 27)
969 kind = 27;
970 JjCheckNAdd(4);
972 if ((0x100002600L & l) != (ulong) 0L)
974 if (kind > 6)
975 kind = 6;
977 else if (curChar == 34)
978 JjCheckNAdd(2);
979 break;
981 case 1:
982 if (curChar == 34)
983 JjCheckNAdd(2);
984 break;
986 case 2:
987 if ((0xfffffffbffffffffL & l) != (ulong) 0L)
988 JjCheckNAddTwoStates(2, 3);
989 break;
991 case 3:
992 if (curChar == 34 && kind > 26)
993 kind = 26;
994 break;
996 case 4:
997 if ((0xfffffffeffffffffL & l) == (ulong) 0L)
998 break;
999 if (kind > 27)
1000 kind = 27;
1001 JjCheckNAdd(4);
1002 break;
1004 default: break;
1008 while (i != startsAt);
1010 else if (curChar < 128)
1012 ulong l = ((ulong) 1L) << (curChar & 63);
1013 MatchLoop1:
1016 switch (jjstateSet[--i])
1019 case 0:
1020 case 4:
1021 if ((0xffffffffdfffffffL & l) == (ulong) 0L)
1022 break;
1023 if (kind > 27)
1024 kind = 27;
1025 JjCheckNAdd(4);
1026 break;
1028 case 2:
1029 JjAddStates(17, 18);
1030 break;
1032 default: break;
1036 while (i != startsAt);
1038 else
1040 int hiByte = (int) (curChar >> 8);
1041 int i1 = hiByte >> 6;
1042 ulong l1 = ((ulong) 1L) << (hiByte & 63);
1043 int i2 = (curChar & 0xff) >> 6;
1044 ulong l2 = ((ulong) 1L) << (curChar & 63);
1045 MatchLoop1:
1048 switch (jjstateSet[--i])
1051 case 0:
1052 case 4:
1053 if (!JjCanMove_0(hiByte, i1, i2, (ulong) l1, (ulong) l2))
1054 break;
1055 if (kind > 27)
1056 kind = 27;
1057 JjCheckNAdd(4);
1058 break;
1060 case 2:
1061 if (JjCanMove_0(hiByte, i1, i2, (ulong) l1, (ulong) l2))
1062 JjAddStates(17, 18);
1063 break;
1065 default: break;
1069 while (i != startsAt);
1071 if (kind != 0x7fffffff)
1073 jjmatchedKind = kind;
1074 jjmatchedPos = curPos;
1075 kind = 0x7fffffff;
1077 ++curPos;
1078 if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt)))
1079 return curPos;
1082 curChar = input_stream.ReadChar();
1084 catch (System.IO.IOException e)
1086 return curPos;
1090 internal static readonly int[] jjnextStates = new int[]{22, 25, 26, 29, 30, 27, 23, 18, 19, 25, 26, 27, 24, 28, 31, 15, 16, 2, 3, 0, 1};
1091 private static bool JjCanMove_0(int hiByte, int i1, int i2, ulong l1, ulong l2)
1093 switch (hiByte)
1096 case 0:
1097 return ((jjbitVec2[i2] & l2) != (ulong) 0L);
1099 default:
1100 if ((jjbitVec0[i1] & l1) != (ulong) 0L)
1101 return true;
1102 return false;
1106 public static readonly System.String[] jjstrLiteralImages = new System.String[]{"", null, null, null, null, null, null, null, null, null, "\x002B", "\x002D", "\x0028", "\x0029", "\x003A", "\x005E", null, null, null, null, null, "\x005B", "\x007B", null, "\x0054\x004F", "\x005D", null, null, "\x0054\x004F", "\x007D", null, null};
1107 public static readonly System.String[] lexStateNames = new System.String[]{"Boost", "RangeEx", "RangeIn", "DEFAULT"};
1108 public static readonly int[] jjnewLexState = new int[]{- 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};
1109 internal static readonly ulong[] jjtoToken = new ulong[]{0xffffff81L};
1110 internal static readonly long[] jjtoSkip = new long[]{0x40L};
1111 protected internal CharStream input_stream;
1112 private uint[] jjrounds = new uint[33];
1113 private int[] jjstateSet = new int[66];
1114 protected internal char curChar;
1115 public QueryParserTokenManager(CharStream stream)
1117 InitBlock();
1118 input_stream = stream;
1120 public QueryParserTokenManager(CharStream stream, int lexState) : this(stream)
1122 SwitchTo(lexState);
1124 public virtual void ReInit(CharStream stream)
1126 jjmatchedPos = jjnewStateCnt = 0;
1127 curLexState = defaultLexState;
1128 input_stream = stream;
1129 ReInitRounds();
1131 private void ReInitRounds()
1133 int i;
1134 jjround = 0x80000001;
1135 for (i = 33; i-- > 0; )
1136 jjrounds[i] = 0x80000000;
1138 public virtual void ReInit(CharStream stream, int lexState)
1140 ReInit(stream);
1141 SwitchTo(lexState);
1143 public virtual void SwitchTo(int lexState)
1145 if (lexState >= 4 || lexState < 0)
1146 throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
1147 else
1148 curLexState = lexState;
1151 protected internal virtual Token JjFillToken()
1153 Token t = Token.NewToken(jjmatchedKind);
1154 t.kind = jjmatchedKind;
1155 System.String im = jjstrLiteralImages[jjmatchedKind];
1156 t.image = (im == null) ? input_stream.GetImage() : im;
1157 t.beginLine = input_stream.GetBeginLine();
1158 t.beginColumn = input_stream.GetBeginColumn();
1159 t.endLine = input_stream.GetEndLine();
1160 t.endColumn = input_stream.GetEndColumn();
1161 return t;
1164 internal int curLexState = 3;
1165 internal int defaultLexState = 3;
1166 internal int jjnewStateCnt;
1167 internal uint jjround;
1168 internal int jjmatchedPos;
1169 internal int jjmatchedKind;
1171 public virtual Token GetNextToken()
1173 int kind;
1174 Token specialToken = null;
1175 Token matchedToken;
1176 int curPos = 0;
1178 for (; ; )
1182 curChar = input_stream.BeginToken();
1184 catch (System.IO.IOException e)
1186 jjmatchedKind = 0;
1187 matchedToken = JjFillToken();
1188 return matchedToken;
1191 switch (curLexState)
1194 case 0:
1195 jjmatchedKind = 0x7fffffff;
1196 jjmatchedPos = 0;
1197 curPos = JjMoveStringLiteralDfa0_0();
1198 break;
1200 case 1:
1201 jjmatchedKind = 0x7fffffff;
1202 jjmatchedPos = 0;
1203 curPos = JjMoveStringLiteralDfa0_1();
1204 break;
1206 case 2:
1207 jjmatchedKind = 0x7fffffff;
1208 jjmatchedPos = 0;
1209 curPos = JjMoveStringLiteralDfa0_2();
1210 break;
1212 case 3:
1213 jjmatchedKind = 0x7fffffff;
1214 jjmatchedPos = 0;
1215 curPos = JjMoveStringLiteralDfa0_3();
1216 break;
1218 if (jjmatchedKind != 0x7fffffff)
1220 if (jjmatchedPos + 1 < curPos)
1221 input_stream.Backup(curPos - jjmatchedPos - 1);
1222 if ((jjtoToken[jjmatchedKind >> 6] & ((ulong) (1L << (jjmatchedKind & 63)))) != (ulong) 0L)
1224 matchedToken = JjFillToken();
1225 if (jjnewLexState[jjmatchedKind] != - 1)
1226 curLexState = jjnewLexState[jjmatchedKind];
1227 return matchedToken;
1229 else
1231 if (jjnewLexState[jjmatchedKind] != - 1)
1232 curLexState = jjnewLexState[jjmatchedKind];
1233 goto EOFLoop;
1236 int error_line = input_stream.GetEndLine();
1237 int error_column = input_stream.GetEndColumn();
1238 System.String error_after = null;
1239 bool EOFSeen = false;
1242 input_stream.ReadChar(); input_stream.Backup(1);
1244 catch (System.IO.IOException e1)
1246 EOFSeen = true;
1247 error_after = curPos <= 1?"":input_stream.GetImage();
1248 if (curChar == '\n' || curChar == '\r')
1250 error_line++;
1251 error_column = 0;
1253 else
1254 error_column++;
1256 if (!EOFSeen)
1258 input_stream.Backup(1);
1259 error_after = curPos <= 1?"":input_stream.GetImage();
1261 throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
1263 EOFLoop: ;