1
2
3 package org.apache.maven.surefire.group.parse;
4 import org.apache.maven.surefire.group.match.*;
5 import java.io.*;
6
7
8 @SuppressWarnings ("unused")
9 public class GroupMatcherParserTokenManager implements GroupMatcherParserConstants {
10
11
12 public java.io.PrintStream debugStream = System.out;
13
14 public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
15 private final int jjStopStringLiteralDfa_0(int pos, long active0){
16 switch (pos)
17 {
18 case 0:
19 if ((active0 & 0x8400L) != 0L)
20 {
21 jjmatchedKind = 14;
22 return 5;
23 }
24 return -1;
25 case 1:
26 if ((active0 & 0x8400L) != 0L)
27 {
28 jjmatchedKind = 14;
29 jjmatchedPos = 1;
30 return 5;
31 }
32 return -1;
33 case 2:
34 if ((active0 & 0x400L) != 0L)
35 return 5;
36 if ((active0 & 0x8000L) != 0L)
37 {
38 jjmatchedKind = 14;
39 jjmatchedPos = 2;
40 return 5;
41 }
42 return -1;
43 case 3:
44 if ((active0 & 0x8000L) != 0L)
45 {
46 jjmatchedKind = 14;
47 jjmatchedPos = 3;
48 return 5;
49 }
50 return -1;
51 case 4:
52 if ((active0 & 0x8000L) != 0L)
53 {
54 jjmatchedKind = 14;
55 jjmatchedPos = 4;
56 return 5;
57 }
58 return -1;
59 default :
60 return -1;
61 }
62 }
63 private final int jjStartNfa_0(int pos, long active0){
64 return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
65 }
66 private int jjStopAtPos(int pos, int kind)
67 {
68 jjmatchedKind = kind;
69 jjmatchedPos = pos;
70 return pos + 1;
71 }
72 private int jjMoveStringLiteralDfa0_0(){
73 switch(curChar)
74 {
75 case 33:
76 return jjStopAtPos(0, 11);
77 case 38:
78 return jjMoveStringLiteralDfa1_0(0x80L);
79 case 40:
80 return jjStopAtPos(0, 12);
81 case 41:
82 return jjStopAtPos(0, 13);
83 case 44:
84 return jjStopAtPos(0, 9);
85 case 46:
86 return jjMoveStringLiteralDfa1_0(0x8000L);
87 case 78:
88 return jjMoveStringLiteralDfa1_0(0x400L);
89 case 124:
90 return jjMoveStringLiteralDfa1_0(0x100L);
91 default :
92 return jjMoveNfa_0(0, 0);
93 }
94 }
95 private int jjMoveStringLiteralDfa1_0(long active0){
96 try { curChar = input_stream.readChar(); }
97 catch(java.io.IOException e) {
98 jjStopStringLiteralDfa_0(0, active0);
99 return 1;
100 }
101 switch(curChar)
102 {
103 case 38:
104 if ((active0 & 0x80L) != 0L)
105 return jjStopAtPos(1, 7);
106 break;
107 case 79:
108 return jjMoveStringLiteralDfa2_0(active0, 0x400L);
109 case 99:
110 return jjMoveStringLiteralDfa2_0(active0, 0x8000L);
111 case 124:
112 if ((active0 & 0x100L) != 0L)
113 return jjStopAtPos(1, 8);
114 break;
115 default :
116 break;
117 }
118 return jjStartNfa_0(0, active0);
119 }
120 private int jjMoveStringLiteralDfa2_0(long old0, long active0){
121 if (((active0 &= old0)) == 0L)
122 return jjStartNfa_0(0, old0);
123 try { curChar = input_stream.readChar(); }
124 catch(java.io.IOException e) {
125 jjStopStringLiteralDfa_0(1, active0);
126 return 2;
127 }
128 switch(curChar)
129 {
130 case 84:
131 if ((active0 & 0x400L) != 0L)
132 return jjStartNfaWithStates_0(2, 10, 5);
133 break;
134 case 108:
135 return jjMoveStringLiteralDfa3_0(active0, 0x8000L);
136 default :
137 break;
138 }
139 return jjStartNfa_0(1, active0);
140 }
141 private int jjMoveStringLiteralDfa3_0(long old0, long active0){
142 if (((active0 &= old0)) == 0L)
143 return jjStartNfa_0(1, old0);
144 try { curChar = input_stream.readChar(); }
145 catch(java.io.IOException e) {
146 jjStopStringLiteralDfa_0(2, active0);
147 return 3;
148 }
149 switch(curChar)
150 {
151 case 97:
152 return jjMoveStringLiteralDfa4_0(active0, 0x8000L);
153 default :
154 break;
155 }
156 return jjStartNfa_0(2, active0);
157 }
158 private int jjMoveStringLiteralDfa4_0(long old0, long active0){
159 if (((active0 &= old0)) == 0L)
160 return jjStartNfa_0(2, old0);
161 try { curChar = input_stream.readChar(); }
162 catch(java.io.IOException e) {
163 jjStopStringLiteralDfa_0(3, active0);
164 return 4;
165 }
166 switch(curChar)
167 {
168 case 115:
169 return jjMoveStringLiteralDfa5_0(active0, 0x8000L);
170 default :
171 break;
172 }
173 return jjStartNfa_0(3, active0);
174 }
175 private int jjMoveStringLiteralDfa5_0(long old0, long active0){
176 if (((active0 &= old0)) == 0L)
177 return jjStartNfa_0(3, old0);
178 try { curChar = input_stream.readChar(); }
179 catch(java.io.IOException e) {
180 jjStopStringLiteralDfa_0(4, active0);
181 return 5;
182 }
183 switch(curChar)
184 {
185 case 115:
186 if ((active0 & 0x8000L) != 0L)
187 return jjStartNfaWithStates_0(5, 14, 5);
188 break;
189 default :
190 break;
191 }
192 return jjStartNfa_0(4, active0);
193 }
194 private int jjStartNfaWithStates_0(int pos, int kind, int state)
195 {
196 jjmatchedKind = kind;
197 jjmatchedPos = pos;
198 try { curChar = input_stream.readChar(); }
199 catch(java.io.IOException e) { return pos + 1; }
200 return jjMoveNfa_0(state, pos + 1);
201 }
202 private int jjMoveNfa_0(int startState, int curPos)
203 {
204 int startsAt = 0;
205 jjnewStateCnt = 6;
206 int i = 1;
207 jjstateSet[0] = startState;
208 int kind = 0x7fffffff;
209 for (;;)
210 {
211 if (++jjround == 0x7fffffff)
212 ReInitRounds();
213 if (curChar < 64)
214 {
215 long l = 1L << curChar;
216 do
217 {
218 switch(jjstateSet[--i])
219 {
220 case 0:
221 case 5:
222 if ((0x3ff641800000000L & l) == 0L)
223 break;
224 kind = 14;
225 { jjCheckNAdd(5); }
226 break;
227 default : break;
228 }
229 } while(i != startsAt);
230 }
231 else if (curChar < 128)
232 {
233 long l = 1L << (curChar & 077);
234 do
235 {
236 switch(jjstateSet[--i])
237 {
238 case 0:
239 if ((0x7fffffe97fffffeL & l) != 0L)
240 {
241 if (kind > 14)
242 kind = 14;
243 { jjCheckNAdd(5); }
244 }
245 if ((0x800000008000L & l) != 0L)
246 jjstateSet[jjnewStateCnt++] = 4;
247 else if ((0x200000002L & l) != 0L)
248 jjstateSet[jjnewStateCnt++] = 1;
249 break;
250 case 1:
251 if ((0x400000004000L & l) != 0L)
252 jjstateSet[jjnewStateCnt++] = 2;
253 break;
254 case 2:
255 if ((0x1000000010L & l) != 0L && kind > 5)
256 kind = 5;
257 break;
258 case 3:
259 if ((0x800000008000L & l) != 0L)
260 jjstateSet[jjnewStateCnt++] = 4;
261 break;
262 case 4:
263 if ((0x4000000040000L & l) != 0L && kind > 6)
264 kind = 6;
265 break;
266 case 5:
267 if ((0x7fffffe97fffffeL & l) == 0L)
268 break;
269 if (kind > 14)
270 kind = 14;
271 { jjCheckNAdd(5); }
272 break;
273 default : break;
274 }
275 } while(i != startsAt);
276 }
277 else
278 {
279 int i2 = (curChar & 0xff) >> 6;
280 long l2 = 1L << (curChar & 077);
281 do
282 {
283 switch(jjstateSet[--i])
284 {
285 default : break;
286 }
287 } while(i != startsAt);
288 }
289 if (kind != 0x7fffffff)
290 {
291 jjmatchedKind = kind;
292 jjmatchedPos = curPos;
293 kind = 0x7fffffff;
294 }
295 ++curPos;
296 if ((i = jjnewStateCnt) == (startsAt = 6 - (jjnewStateCnt = startsAt)))
297 return curPos;
298 try { curChar = input_stream.readChar(); }
299 catch(java.io.IOException e) { return curPos; }
300 }
301 }
302
303
304 public static final String[] jjstrLiteralImages = {
305 "", null, null, null, null, null, null, "\46\46", "\174\174", "\54",
306 "\116\117\124", "\41", "\50", "\51", null, "\56\143\154\141\163\163", };
307 protected Token jjFillToken()
308 {
309 final Token t;
310 final String curTokenImage;
311 final int beginLine;
312 final int endLine;
313 final int beginColumn;
314 final int endColumn;
315 String im = jjstrLiteralImages[jjmatchedKind];
316 curTokenImage = (im == null) ? input_stream.GetImage() : im;
317 beginLine = input_stream.getBeginLine();
318 beginColumn = input_stream.getBeginColumn();
319 endLine = input_stream.getEndLine();
320 endColumn = input_stream.getEndColumn();
321 t = Token.newToken(jjmatchedKind, curTokenImage);
322
323 t.beginLine = beginLine;
324 t.endLine = endLine;
325 t.beginColumn = beginColumn;
326 t.endColumn = endColumn;
327
328 return t;
329 }
330 static final int[] jjnextStates = {0
331 };
332
333 int curLexState = 0;
334 int defaultLexState = 0;
335 int jjnewStateCnt;
336 int jjround;
337 int jjmatchedPos;
338 int jjmatchedKind;
339
340
341 public Token getNextToken()
342 {
343 Token matchedToken;
344 int curPos = 0;
345
346 EOFLoop :
347 for (;;)
348 {
349 try
350 {
351 curChar = input_stream.BeginToken();
352 }
353 catch(Exception e)
354 {
355 jjmatchedKind = 0;
356 jjmatchedPos = -1;
357 matchedToken = jjFillToken();
358 return matchedToken;
359 }
360
361 try { input_stream.backup(0);
362 while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
363 curChar = input_stream.BeginToken();
364 }
365 catch (java.io.IOException e1) { continue EOFLoop; }
366 jjmatchedKind = 0x7fffffff;
367 jjmatchedPos = 0;
368 curPos = jjMoveStringLiteralDfa0_0();
369 if (jjmatchedKind != 0x7fffffff)
370 {
371 if (jjmatchedPos + 1 < curPos)
372 input_stream.backup(curPos - jjmatchedPos - 1);
373 if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
374 {
375 matchedToken = jjFillToken();
376 return matchedToken;
377 }
378 else
379 {
380 continue EOFLoop;
381 }
382 }
383 int error_line = input_stream.getEndLine();
384 int error_column = input_stream.getEndColumn();
385 String error_after = null;
386 boolean EOFSeen = false;
387 try { input_stream.readChar(); input_stream.backup(1); }
388 catch (java.io.IOException e1) {
389 EOFSeen = true;
390 error_after = curPos <= 1 ? "" : input_stream.GetImage();
391 if (curChar == '\n' || curChar == '\r') {
392 error_line++;
393 error_column = 0;
394 }
395 else
396 error_column++;
397 }
398 if (!EOFSeen) {
399 input_stream.backup(1);
400 error_after = curPos <= 1 ? "" : input_stream.GetImage();
401 }
402 throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
403 }
404 }
405
406 void SkipLexicalActions(Token matchedToken)
407 {
408 switch(jjmatchedKind)
409 {
410 default :
411 break;
412 }
413 }
414 void MoreLexicalActions()
415 {
416 jjimageLen += (lengthOfMatch = jjmatchedPos + 1);
417 switch(jjmatchedKind)
418 {
419 default :
420 break;
421 }
422 }
423 void TokenLexicalActions(Token matchedToken)
424 {
425 switch(jjmatchedKind)
426 {
427 default :
428 break;
429 }
430 }
431 private void jjCheckNAdd(int state)
432 {
433 if (jjrounds[state] != jjround)
434 {
435 jjstateSet[jjnewStateCnt++] = state;
436 jjrounds[state] = jjround;
437 }
438 }
439 private void jjAddStates(int start, int end)
440 {
441 do {
442 jjstateSet[jjnewStateCnt++] = jjnextStates[start];
443 } while (start++ != end);
444 }
445 private void jjCheckNAddTwoStates(int state1, int state2)
446 {
447 jjCheckNAdd(state1);
448 jjCheckNAdd(state2);
449 }
450
451
452 public GroupMatcherParserTokenManager(SimpleCharStream stream){
453
454 if (SimpleCharStream.staticFlag)
455 throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
456
457 input_stream = stream;
458 }
459
460
461 public GroupMatcherParserTokenManager (SimpleCharStream stream, int lexState){
462 ReInit(stream);
463 SwitchTo(lexState);
464 }
465
466
467
468 public void ReInit(SimpleCharStream stream)
469 {
470
471
472 jjmatchedPos =
473 jjnewStateCnt =
474 0;
475 curLexState = defaultLexState;
476 input_stream = stream;
477 ReInitRounds();
478 }
479
480 private void ReInitRounds()
481 {
482 int i;
483 jjround = 0x80000001;
484 for (i = 6; i-- > 0;)
485 jjrounds[i] = 0x80000000;
486 }
487
488
489 public void ReInit(SimpleCharStream stream, int lexState)
490
491 {
492 ReInit(stream);
493 SwitchTo(lexState);
494 }
495
496
497 public void SwitchTo(int lexState)
498 {
499 if (lexState >= 1 || lexState < 0)
500 throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
501 else
502 curLexState = lexState;
503 }
504
505
506
507 public static final String[] lexStateNames = {
508 "DEFAULT",
509 };
510
511
512 public static final int[] jjnewLexState = {
513 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
514 };
515 static final long[] jjtoToken = {
516 0xffe1L,
517 };
518 static final long[] jjtoSkip = {
519 0x1eL,
520 };
521 static final long[] jjtoSpecial = {
522 0x0L,
523 };
524 static final long[] jjtoMore = {
525 0x0L,
526 };
527 protected SimpleCharStream input_stream;
528
529 private final int[] jjrounds = new int[6];
530 private final int[] jjstateSet = new int[2 * 6];
531 private final StringBuilder jjimage = new StringBuilder();
532 private StringBuilder image = jjimage;
533 private int jjimageLen;
534 private int lengthOfMatch;
535 protected int curChar;
536 }