~ubuntu-branches/ubuntu/trusty/pylucene/trusty

« back to all changes in this revision

Viewing changes to lucene-java-3.5.0/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParserTokenManager.java

  • Committer: Package Import Robot
  • Author(s): Dmitry Nezhevenko
  • Date: 2012-04-23 16:43:55 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120423164355-grqtepnwtecdjfk2
Tags: 3.5.0-1
* New maintainer (closes: 670179)
* New upstream release
* Switch to dpkg-source 3.0 (quilt) format
* Switch to machine-readable debian/copyright
* Bump debian/compat to 8, drop debian/pycompat
* Switch from cdbs to dh
* Add watch file
* Build for all supported versions of python2 (closes: 581198, 632240)
* Rename binary package to python-lucene (closes: 581197)
* Add -dbg package

Show diffs side-by-side

added added

removed removed

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