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