1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.apache.directory.api.ldap.model.subtree;
25
26 import org.apache.directory.api.ldap.model.name.Dn;
27 import org.apache.directory.api.ldap.model.filter.ExprNode;
28 import org.apache.directory.api.ldap.model.filter.LeafNode;
29 import org.apache.directory.api.ldap.model.filter.BranchNode;
30 import org.apache.directory.api.ldap.model.filter.AndNode;
31 import org.apache.directory.api.ldap.model.filter.OrNode;
32 import org.apache.directory.api.ldap.model.filter.NotNode;
33 import org.apache.directory.api.ldap.model.filter.EqualityNode;
34 import org.apache.directory.api.ldap.model.filter.FilterParser;
35 import org.apache.directory.api.util.ComponentsMonitor;
36 import org.apache.directory.api.util.OptionalComponentsMonitor;
37 import org.apache.directory.api.ldap.model.schema.SchemaManager;
38
39 import org.slf4j.Logger;
40 import org.slf4j.LoggerFactory;
41
42 import java.io.InputStream;
43 import antlr.TokenStreamException;
44 import antlr.TokenStreamIOException;
45 import antlr.TokenStreamRecognitionException;
46 import antlr.CharStreamException;
47 import antlr.CharStreamIOException;
48 import antlr.ANTLRException;
49 import java.io.Reader;
50 import java.util.Hashtable;
51 import antlr.CharScanner;
52 import antlr.InputBuffer;
53 import antlr.ByteBuffer;
54 import antlr.CharBuffer;
55 import antlr.Token;
56 import antlr.CommonToken;
57 import antlr.RecognitionException;
58 import antlr.NoViableAltForCharException;
59 import antlr.MismatchedCharException;
60 import antlr.TokenStream;
61 import antlr.ANTLRHashString;
62 import antlr.LexerSharedInputState;
63 import antlr.collections.impl.BitSet;
64 import antlr.SemanticException;
65
66
67
68
69
70
71
72 public class AntlrSubtreeSpecificationCheckerLexer extends antlr.CharScanner implements AntlrSubtreeSpecificationCheckerTokenTypes, TokenStream
73 {
74
75 private static final Logger log = LoggerFactory.getLogger( AntlrSubtreeSpecificationLexer.class );
76 public AntlrSubtreeSpecificationCheckerLexer(InputStream in) {
77 this(new ByteBuffer(in));
78 }
79 public AntlrSubtreeSpecificationCheckerLexer(Reader in) {
80 this(new CharBuffer(in));
81 }
82 public AntlrSubtreeSpecificationCheckerLexer(InputBuffer ib) {
83 this(new LexerSharedInputState(ib));
84 }
85 public AntlrSubtreeSpecificationCheckerLexer(LexerSharedInputState state) {
86 super(state);
87 caseSensitiveLiterals = true;
88 setCaseSensitive(true);
89 literals = new Hashtable();
90 literals.put(new ANTLRHashString("end", this), new Integer(4));
91 literals.put(new ANTLRHashString("specificExclusions", this), new Integer(10));
92 literals.put(new ANTLRHashString("or", this), new Integer(24));
93 literals.put(new ANTLRHashString("minimum", this), new Integer(14));
94 literals.put(new ANTLRHashString("chopBefore", this), new Integer(11));
95 literals.put(new ANTLRHashString("chopAfter", this), new Integer(13));
96 literals.put(new ANTLRHashString("maximum", this), new Integer(15));
97 literals.put(new ANTLRHashString("and", this), new Integer(23));
98 literals.put(new ANTLRHashString("not", this), new Integer(25));
99 literals.put(new ANTLRHashString("item", this), new Integer(22));
100 literals.put(new ANTLRHashString("specificationFilter", this), new Integer(16));
101 literals.put(new ANTLRHashString("base", this), new Integer(9));
102 }
103
104 public Token nextToken() throws TokenStreamException {
105 Token theRetToken=null;
106 tryAgain:
107 for (;;) {
108 Token _token = null;
109 int _ttype = Token.INVALID_TYPE;
110 resetText();
111 try {
112 try {
113 switch ( LA(1)) {
114 case ' ':
115 {
116 mSP(true);
117 theRetToken=_returnToken;
118 break;
119 }
120 case ':':
121 {
122 mCOLON(true);
123 theRetToken=_returnToken;
124 break;
125 }
126 case '{':
127 {
128 mOPEN_CURLY(true);
129 theRetToken=_returnToken;
130 break;
131 }
132 case '}':
133 {
134 mCLOSE_CURLY(true);
135 theRetToken=_returnToken;
136 break;
137 }
138 case ',':
139 {
140 mSEP(true);
141 theRetToken=_returnToken;
142 break;
143 }
144 case '"':
145 {
146 mSAFEUTF8STRING(true);
147 theRetToken=_returnToken;
148 break;
149 }
150 case 'A': case 'B': case 'C': case 'D':
151 case 'E': case 'F': case 'G': case 'H':
152 case 'I': case 'J': case 'K': case 'L':
153 case 'M': case 'N': case 'O': case 'P':
154 case 'Q': case 'R': case 'S': case 'T':
155 case 'U': case 'V': case 'W': case 'X':
156 case 'Y': case 'Z': case 'a': case 'b':
157 case 'c': case 'd': case 'e': case 'f':
158 case 'g': case 'h': case 'i': case 'j':
159 case 'k': case 'l': case 'm': case 'n':
160 case 'o': case 'p': case 'q': case 'r':
161 case 's': case 't': case 'u': case 'v':
162 case 'w': case 'x': case 'y': case 'z':
163 {
164 mDESCR(true);
165 theRetToken=_returnToken;
166 break;
167 }
168 case '0': case '1': case '2': case '3':
169 case '4': case '5': case '6': case '7':
170 case '8': case '9':
171 {
172 mINTEGER_OR_NUMERICOID(true);
173 theRetToken=_returnToken;
174 break;
175 }
176 case '(':
177 {
178 mFILTER(true);
179 theRetToken=_returnToken;
180 break;
181 }
182 default:
183 {
184 if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);}
185 else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
186 }
187 }
188 if ( _returnToken==null ) continue tryAgain;
189 _ttype = _returnToken.getType();
190 _ttype = testLiteralsTable(_ttype);
191 _returnToken.setType(_ttype);
192 return _returnToken;
193 }
194 catch (RecognitionException e) {
195 throw new TokenStreamRecognitionException(e);
196 }
197 }
198 catch (CharStreamException cse) {
199 if ( cse instanceof CharStreamIOException ) {
200 throw new TokenStreamIOException(((CharStreamIOException)cse).io);
201 }
202 else {
203 throw new TokenStreamException(cse.getMessage());
204 }
205 }
206 }
207 }
208
209 public final void mSP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
210 int _ttype; Token _token=null; int _begin=text.length();
211 _ttype = SP;
212 int _saveIndex;
213
214 match(' ');
215 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
216 _token = makeToken(_ttype);
217 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
218 }
219 _returnToken = _token;
220 }
221
222 public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
223 int _ttype; Token _token=null; int _begin=text.length();
224 _ttype = COLON;
225 int _saveIndex;
226
227 match(':');
228 if ( inputState.guessing==0 ) {
229 log.debug( "matched COLON(':')" );
230 }
231 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
232 _token = makeToken(_ttype);
233 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
234 }
235 _returnToken = _token;
236 }
237
238 public final void mOPEN_CURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
239 int _ttype; Token _token=null; int _begin=text.length();
240 _ttype = OPEN_CURLY;
241 int _saveIndex;
242
243 match('{');
244 if ( inputState.guessing==0 ) {
245 log.debug( "matched LBRACKET('{')" );
246 }
247 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
248 _token = makeToken(_ttype);
249 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
250 }
251 _returnToken = _token;
252 }
253
254 public final void mCLOSE_CURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
255 int _ttype; Token _token=null; int _begin=text.length();
256 _ttype = CLOSE_CURLY;
257 int _saveIndex;
258
259 match('}');
260 if ( inputState.guessing==0 ) {
261 log.debug( "matched RBRACKET('}')" );
262 }
263 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
264 _token = makeToken(_ttype);
265 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
266 }
267 _returnToken = _token;
268 }
269
270 public final void mSEP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
271 int _ttype; Token _token=null; int _begin=text.length();
272 _ttype = SEP;
273 int _saveIndex;
274
275 match(',');
276 if ( inputState.guessing==0 ) {
277 log.debug( "matched SEP(',')" );
278 }
279 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
280 _token = makeToken(_ttype);
281 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
282 }
283 _returnToken = _token;
284 }
285
286 public final void mSAFEUTF8STRING(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
287 int _ttype; Token _token=null; int _begin=text.length();
288 _ttype = SAFEUTF8STRING;
289 int _saveIndex;
290
291 _saveIndex=text.length();
292 match('"');
293 text.setLength(_saveIndex);
294 {
295 _loop102:
296 do {
297 if ((_tokenSet_0.member(LA(1)))) {
298 mSAFEUTF8CHAR(false);
299 }
300 else {
301 break _loop102;
302 }
303
304 } while (true);
305 }
306 _saveIndex=text.length();
307 match('"');
308 text.setLength(_saveIndex);
309 if ( inputState.guessing==0 ) {
310 log.debug( "matched SAFEUTF8CHAR: \"" + getText() + "\"" );
311 }
312 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
313 _token = makeToken(_ttype);
314 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
315 }
316 _returnToken = _token;
317 }
318
319 protected final void mSAFEUTF8CHAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
320 int _ttype; Token _token=null; int _begin=text.length();
321 _ttype = SAFEUTF8CHAR;
322 int _saveIndex;
323
324 switch ( LA(1)) {
325 case '\u0001': case '\u0002': case '\u0003': case '\u0004':
326 case '\u0005': case '\u0006': case '\u0007': case '\u0008':
327 case '\t': case '\n': case '\u000b': case '\u000c':
328 case '\r': case '\u000e': case '\u000f': case '\u0010':
329 case '\u0011': case '\u0012': case '\u0013': case '\u0014':
330 case '\u0015': case '\u0016': case '\u0017': case '\u0018':
331 case '\u0019': case '\u001a': case '\u001b': case '\u001c':
332 case '\u001d': case '\u001e': case '\u001f': case ' ':
333 case '!':
334 {
335 matchRange('\u0001','\u0021');
336 break;
337 }
338 case '#': case '$': case '%': case '&':
339 case '\'': case '(': case ')': case '*':
340 case '+': case ',': case '-': case '.':
341 case '/': case '0': case '1': case '2':
342 case '3': case '4': case '5': case '6':
343 case '7': case '8': case '9': case ':':
344 case ';': case '<': case '=': case '>':
345 case '?': case '@': case 'A': case 'B':
346 case 'C': case 'D': case 'E': case 'F':
347 case 'G': case 'H': case 'I': case 'J':
348 case 'K': case 'L': case 'M': case 'N':
349 case 'O': case 'P': case 'Q': case 'R':
350 case 'S': case 'T': case 'U': case 'V':
351 case 'W': case 'X': case 'Y': case 'Z':
352 case '[': case '\\': case ']': case '^':
353 case '_': case '`': case 'a': case 'b':
354 case 'c': case 'd': case 'e': case 'f':
355 case 'g': case 'h': case 'i': case 'j':
356 case 'k': case 'l': case 'm': case 'n':
357 case 'o': case 'p': case 'q': case 'r':
358 case 's': case 't': case 'u': case 'v':
359 case 'w': case 'x': case 'y': case 'z':
360 case '{': case '|': case '}': case '~':
361 case '\u007f':
362 {
363 matchRange('\u0023','\u007F');
364 break;
365 }
366 case '\u00c0': case '\u00c1': case '\u00c2': case '\u00c3':
367 case '\u00c4': case '\u00c5': case '\u00c6': case '\u00c7':
368 case '\u00c8': case '\u00c9': case '\u00ca': case '\u00cb':
369 case '\u00cc': case '\u00cd': case '\u00ce': case '\u00cf':
370 case '\u00d0': case '\u00d1': case '\u00d2': case '\u00d3':
371 case '\u00d4': case '\u00d5': case '\u00d6':
372 {
373 matchRange('\u00c0','\u00d6');
374 break;
375 }
376 case '\u00d8': case '\u00d9': case '\u00da': case '\u00db':
377 case '\u00dc': case '\u00dd': case '\u00de': case '\u00df':
378 case '\u00e0': case '\u00e1': case '\u00e2': case '\u00e3':
379 case '\u00e4': case '\u00e5': case '\u00e6': case '\u00e7':
380 case '\u00e8': case '\u00e9': case '\u00ea': case '\u00eb':
381 case '\u00ec': case '\u00ed': case '\u00ee': case '\u00ef':
382 case '\u00f0': case '\u00f1': case '\u00f2': case '\u00f3':
383 case '\u00f4': case '\u00f5': case '\u00f6':
384 {
385 matchRange('\u00d8','\u00f6');
386 break;
387 }
388 case '\u00f8': case '\u00f9': case '\u00fa': case '\u00fb':
389 case '\u00fc': case '\u00fd': case '\u00fe': case '\u00ff':
390 {
391 matchRange('\u00f8','\u00ff');
392 break;
393 }
394 default:
395 if (((LA(1) >= '\u0100' && LA(1) <= '\u1fff'))) {
396 matchRange('\u0100','\u1fff');
397 }
398 else if (((LA(1) >= '\u3040' && LA(1) <= '\u318f'))) {
399 matchRange('\u3040','\u318f');
400 }
401 else if (((LA(1) >= '\u3300' && LA(1) <= '\u337f'))) {
402 matchRange('\u3300','\u337f');
403 }
404 else if (((LA(1) >= '\u3400' && LA(1) <= '\u3d2d'))) {
405 matchRange('\u3400','\u3d2d');
406 }
407 else if (((LA(1) >= '\u4e00' && LA(1) <= '\u9fff'))) {
408 matchRange('\u4e00','\u9fff');
409 }
410 else if (((LA(1) >= '\uf900' && LA(1) <= '\ufaff'))) {
411 matchRange('\uf900','\ufaff');
412 }
413 else {
414 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
415 }
416 }
417 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
418 _token = makeToken(_ttype);
419 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
420 }
421 _returnToken = _token;
422 }
423
424 public final void mDESCR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
425 int _ttype; Token _token=null; int _begin=text.length();
426 _ttype = DESCR;
427 int _saveIndex;
428
429 mALPHA(false);
430 {
431 _loop105:
432 do {
433 switch ( LA(1)) {
434 case 'A': case 'B': case 'C': case 'D':
435 case 'E': case 'F': case 'G': case 'H':
436 case 'I': case 'J': case 'K': case 'L':
437 case 'M': case 'N': case 'O': case 'P':
438 case 'Q': case 'R': case 'S': case 'T':
439 case 'U': case 'V': case 'W': case 'X':
440 case 'Y': case 'Z': case 'a': case 'b':
441 case 'c': case 'd': case 'e': case 'f':
442 case 'g': case 'h': case 'i': case 'j':
443 case 'k': case 'l': case 'm': case 'n':
444 case 'o': case 'p': case 'q': case 'r':
445 case 's': case 't': case 'u': case 'v':
446 case 'w': case 'x': case 'y': case 'z':
447 {
448 mALPHA(false);
449 break;
450 }
451 case '0': case '1': case '2': case '3':
452 case '4': case '5': case '6': case '7':
453 case '8': case '9':
454 {
455 mDIGIT(false);
456 break;
457 }
458 case '-':
459 {
460 match('-');
461 break;
462 }
463 default:
464 {
465 break _loop105;
466 }
467 }
468 } while (true);
469 }
470 if ( inputState.guessing==0 ) {
471 log.debug( "matched DESCR" );
472 }
473 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
474 _token = makeToken(_ttype);
475 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
476 }
477 _returnToken = _token;
478 }
479
480 protected final void mALPHA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
481 int _ttype; Token _token=null; int _begin=text.length();
482 _ttype = ALPHA;
483 int _saveIndex;
484
485 switch ( LA(1)) {
486 case 'A': case 'B': case 'C': case 'D':
487 case 'E': case 'F': case 'G': case 'H':
488 case 'I': case 'J': case 'K': case 'L':
489 case 'M': case 'N': case 'O': case 'P':
490 case 'Q': case 'R': case 'S': case 'T':
491 case 'U': case 'V': case 'W': case 'X':
492 case 'Y': case 'Z':
493 {
494 matchRange('A','Z');
495 break;
496 }
497 case 'a': case 'b': case 'c': case 'd':
498 case 'e': case 'f': case 'g': case 'h':
499 case 'i': case 'j': case 'k': case 'l':
500 case 'm': case 'n': case 'o': case 'p':
501 case 'q': case 'r': case 's': case 't':
502 case 'u': case 'v': case 'w': case 'x':
503 case 'y': case 'z':
504 {
505 matchRange('a','z');
506 break;
507 }
508 default:
509 {
510 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
511 }
512 }
513 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
514 _token = makeToken(_ttype);
515 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
516 }
517 _returnToken = _token;
518 }
519
520 protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
521 int _ttype; Token _token=null; int _begin=text.length();
522 _ttype = DIGIT;
523 int _saveIndex;
524
525 switch ( LA(1)) {
526 case '0':
527 {
528 match('0');
529 break;
530 }
531 case '1': case '2': case '3': case '4':
532 case '5': case '6': case '7': case '8':
533 case '9':
534 {
535 mLDIGIT(false);
536 break;
537 }
538 default:
539 {
540 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
541 }
542 }
543 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
544 _token = makeToken(_ttype);
545 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
546 }
547 _returnToken = _token;
548 }
549
550 public final void mINTEGER_OR_NUMERICOID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
551 int _ttype; Token _token=null; int _begin=text.length();
552 _ttype = INTEGER_OR_NUMERICOID;
553 int _saveIndex;
554
555 boolean synPredMatched108 = false;
556 if ((((LA(1) >= '0' && LA(1) <= '9')) && (_tokenSet_1.member(LA(2))))) {
557 int _m108 = mark();
558 synPredMatched108 = true;
559 inputState.guessing++;
560 try {
561 {
562 mINTEGER(false);
563 mDOT(false);
564 }
565 }
566 catch (RecognitionException pe) {
567 synPredMatched108 = false;
568 }
569 rewind(_m108);
570 inputState.guessing--;
571 }
572 if ( synPredMatched108 ) {
573 mNUMERICOID(false);
574 if ( inputState.guessing==0 ) {
575
576 _ttype = NUMERICOID;
577
578 }
579 }
580 else if (((LA(1) >= '0' && LA(1) <= '9')) && (true)) {
581 mINTEGER(false);
582 if ( inputState.guessing==0 ) {
583
584 _ttype = INTEGER;
585
586 }
587 }
588 else {
589 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
590 }
591
592 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
593 _token = makeToken(_ttype);
594 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
595 }
596 _returnToken = _token;
597 }
598
599 protected final void mINTEGER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
600 int _ttype; Token _token=null; int _begin=text.length();
601 _ttype = INTEGER;
602 int _saveIndex;
603
604 if (((LA(1) >= '1' && LA(1) <= '9')) && ((LA(2) >= '0' && LA(2) <= '9'))) {
605 {
606 mLDIGIT(false);
607 {
608 int _cnt112=0;
609 _loop112:
610 do {
611 if (((LA(1) >= '0' && LA(1) <= '9'))) {
612 mDIGIT(false);
613 }
614 else {
615 if ( _cnt112>=1 ) { break _loop112; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
616 }
617
618 _cnt112++;
619 } while (true);
620 }
621 }
622 if ( inputState.guessing==0 ) {
623 log.debug( "matched INTEGER: " + getText() );
624 }
625 }
626 else if (((LA(1) >= '0' && LA(1) <= '9')) && (true)) {
627 mDIGIT(false);
628 }
629 else {
630 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
631 }
632
633 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
634 _token = makeToken(_ttype);
635 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
636 }
637 _returnToken = _token;
638 }
639
640 protected final void mDOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
641 int _ttype; Token _token=null; int _begin=text.length();
642 _ttype = DOT;
643 int _saveIndex;
644
645 match('.');
646 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
647 _token = makeToken(_ttype);
648 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
649 }
650 _returnToken = _token;
651 }
652
653 protected final void mNUMERICOID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
654 int _ttype; Token _token=null; int _begin=text.length();
655 _ttype = NUMERICOID;
656 int _saveIndex;
657
658 mINTEGER(false);
659 {
660 int _cnt115=0;
661 _loop115:
662 do {
663 if ((LA(1)=='.')) {
664 mDOT(false);
665 mINTEGER(false);
666 }
667 else {
668 if ( _cnt115>=1 ) { break _loop115; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
669 }
670
671 _cnt115++;
672 } while (true);
673 }
674 if ( inputState.guessing==0 ) {
675 log.debug( "matched NUMERICOID: " + getText() );
676 }
677 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
678 _token = makeToken(_ttype);
679 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
680 }
681 _returnToken = _token;
682 }
683
684 protected final void mLDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
685 int _ttype; Token _token=null; int _begin=text.length();
686 _ttype = LDIGIT;
687 int _saveIndex;
688
689 matchRange('1','9');
690 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
691 _token = makeToken(_ttype);
692 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
693 }
694 _returnToken = _token;
695 }
696
697 public final void mFILTER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
698 int _ttype; Token _token=null; int _begin=text.length();
699 _ttype = FILTER;
700 int _saveIndex;
701
702 match('(');
703 {
704 switch ( LA(1)) {
705 case '&':
706 {
707 {
708 match('&');
709 {
710 _loop125:
711 do {
712 if ((LA(1)==' ')) {
713 mSP(false);
714 }
715 else {
716 break _loop125;
717 }
718
719 } while (true);
720 }
721 {
722 int _cnt127=0;
723 _loop127:
724 do {
725 if ((LA(1)=='(')) {
726 mFILTER(false);
727 }
728 else {
729 if ( _cnt127>=1 ) { break _loop127; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
730 }
731
732 _cnt127++;
733 } while (true);
734 }
735 }
736 break;
737 }
738 case '|':
739 {
740 {
741 match('|');
742 {
743 _loop130:
744 do {
745 if ((LA(1)==' ')) {
746 mSP(false);
747 }
748 else {
749 break _loop130;
750 }
751
752 } while (true);
753 }
754 {
755 int _cnt132=0;
756 _loop132:
757 do {
758 if ((LA(1)=='(')) {
759 mFILTER(false);
760 }
761 else {
762 if ( _cnt132>=1 ) { break _loop132; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
763 }
764
765 _cnt132++;
766 } while (true);
767 }
768 }
769 break;
770 }
771 case '!':
772 {
773 {
774 match('!');
775 {
776 _loop135:
777 do {
778 if ((LA(1)==' ')) {
779 mSP(false);
780 }
781 else {
782 break _loop135;
783 }
784
785 } while (true);
786 }
787 mFILTER(false);
788 }
789 break;
790 }
791 default:
792 if ((_tokenSet_2.member(LA(1)))) {
793 mFILTER_VALUE(false);
794 }
795 else {
796 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
797 }
798 }
799 }
800 match(')');
801 {
802 _loop137:
803 do {
804 if ((LA(1)==' ')) {
805 mSP(false);
806 }
807 else {
808 break _loop137;
809 }
810
811 } while (true);
812 }
813 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
814 _token = makeToken(_ttype);
815 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
816 }
817 _returnToken = _token;
818 }
819
820 protected final void mFILTER_VALUE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
821 int _ttype; Token _token=null; int _begin=text.length();
822 _ttype = FILTER_VALUE;
823 int _saveIndex;
824
825 {
826 {
827 match(_tokenSet_2);
828 }
829 {
830 _loop143:
831 do {
832 if ((_tokenSet_3.member(LA(1)))) {
833 {
834 match(_tokenSet_3);
835 }
836 }
837 else {
838 break _loop143;
839 }
840
841 } while (true);
842 }
843 }
844 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
845 _token = makeToken(_ttype);
846 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
847 }
848 _returnToken = _token;
849 }
850
851
852 private static final long[] mk_tokenSet_0() {
853 long[] data = new long[3988];
854 data[0]=-17179869186L;
855 data[1]=-1L;
856 data[3]=-36028797027352577L;
857 for (int i = 4; i<=127; i++) { data[i]=-1L; }
858 for (int i = 193; i<=197; i++) { data[i]=-1L; }
859 data[198]=65535L;
860 for (int i = 204; i<=205; i++) { data[i]=-1L; }
861 for (int i = 208; i<=243; i++) { data[i]=-1L; }
862 data[244]=70368744177663L;
863 for (int i = 312; i<=639; i++) { data[i]=-1L; }
864 for (int i = 996; i<=1003; i++) { data[i]=-1L; }
865 return data;
866 }
867 public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
868 private static final long[] mk_tokenSet_1() {
869 long[] data = new long[1025];
870 data[0]=288019269919178752L;
871 return data;
872 }
873 public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
874 private static final long[] mk_tokenSet_2() {
875 long[] data = new long[2048];
876 data[0]=-3582002724866L;
877 data[1]=-1152921504606846977L;
878 for (int i = 2; i<=127; i++) { data[i]=-1L; }
879 for (int i = 193; i<=197; i++) { data[i]=-1L; }
880 data[198]=65535L;
881 for (int i = 204; i<=205; i++) { data[i]=-1L; }
882 for (int i = 208; i<=243; i++) { data[i]=-1L; }
883 data[244]=70368744177663L;
884 for (int i = 312; i<=639; i++) { data[i]=-1L; }
885 for (int i = 996; i<=1003; i++) { data[i]=-1L; }
886 return data;
887 }
888 public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
889 private static final long[] mk_tokenSet_3() {
890 long[] data = new long[2048];
891 data[0]=-2199023255554L;
892 for (int i = 1; i<=127; i++) { data[i]=-1L; }
893 for (int i = 193; i<=197; i++) { data[i]=-1L; }
894 data[198]=65535L;
895 for (int i = 204; i<=205; i++) { data[i]=-1L; }
896 for (int i = 208; i<=243; i++) { data[i]=-1L; }
897 data[244]=70368744177663L;
898 for (int i = 312; i<=639; i++) { data[i]=-1L; }
899 for (int i = 996; i<=1003; i++) { data[i]=-1L; }
900 return data;
901 }
902 public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
903
904 }