001 // $ANTLR 2.7.4: "SubtreeSpecificationChecker.g" -> "AntlrSubtreeSpecificationCheckerLexer.java"$
002
003 /*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements. See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership. The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License. You may obtain a copy of the License at
011 *
012 * http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied. See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 *
021 */
022
023
024 package org.apache.directory.shared.ldap.subtree;
025
026 import org.apache.directory.shared.ldap.name.LdapDN;
027 import org.apache.directory.shared.ldap.filter.FilterParser;
028 import org.apache.directory.shared.ldap.util.ComponentsMonitor;
029 import org.apache.directory.shared.ldap.util.OptionalComponentsMonitor;
030
031 import org.slf4j.Logger;
032 import org.slf4j.LoggerFactory;
033
034 import java.io.InputStream;
035 import antlr.TokenStreamException;
036 import antlr.TokenStreamIOException;
037 import antlr.TokenStreamRecognitionException;
038 import antlr.CharStreamException;
039 import antlr.CharStreamIOException;
040 import antlr.ANTLRException;
041 import java.io.Reader;
042 import java.util.Hashtable;
043 import antlr.CharScanner;
044 import antlr.InputBuffer;
045 import antlr.ByteBuffer;
046 import antlr.CharBuffer;
047 import antlr.Token;
048 import antlr.CommonToken;
049 import antlr.RecognitionException;
050 import antlr.NoViableAltForCharException;
051 import antlr.MismatchedCharException;
052 import antlr.TokenStream;
053 import antlr.ANTLRHashString;
054 import antlr.LexerSharedInputState;
055 import antlr.collections.impl.BitSet;
056 import antlr.SemanticException;
057
058 /**
059 * The parser's primary lexer.
060 *
061 * @see <a href="http://www.faqs.org/rfcs/rfc3672.html">RFC 3672</a>
062 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
063 * @version $Rev$
064 */
065 public class AntlrSubtreeSpecificationCheckerLexer extends antlr.CharScanner implements AntlrSubtreeSpecificationCheckerTokenTypes, TokenStream
066 {
067
068 private static final Logger log = LoggerFactory.getLogger( AntlrSubtreeSpecificationLexer.class );
069 public AntlrSubtreeSpecificationCheckerLexer(InputStream in) {
070 this(new ByteBuffer(in));
071 }
072 public AntlrSubtreeSpecificationCheckerLexer(Reader in) {
073 this(new CharBuffer(in));
074 }
075 public AntlrSubtreeSpecificationCheckerLexer(InputBuffer ib) {
076 this(new LexerSharedInputState(ib));
077 }
078 public AntlrSubtreeSpecificationCheckerLexer(LexerSharedInputState state) {
079 super(state);
080 caseSensitiveLiterals = true;
081 setCaseSensitive(true);
082 literals = new Hashtable();
083 literals.put(new ANTLRHashString("end", this), new Integer(4));
084 literals.put(new ANTLRHashString("specificExclusions", this), new Integer(10));
085 literals.put(new ANTLRHashString("or", this), new Integer(24));
086 literals.put(new ANTLRHashString("minimum", this), new Integer(14));
087 literals.put(new ANTLRHashString("chopBefore", this), new Integer(11));
088 literals.put(new ANTLRHashString("chopAfter", this), new Integer(13));
089 literals.put(new ANTLRHashString("maximum", this), new Integer(15));
090 literals.put(new ANTLRHashString("and", this), new Integer(23));
091 literals.put(new ANTLRHashString("not", this), new Integer(25));
092 literals.put(new ANTLRHashString("item", this), new Integer(22));
093 literals.put(new ANTLRHashString("specificationFilter", this), new Integer(16));
094 literals.put(new ANTLRHashString("base", this), new Integer(9));
095 }
096
097 public Token nextToken() throws TokenStreamException {
098 Token theRetToken=null;
099 tryAgain:
100 for (;;) {
101 Token _token = null;
102 int _ttype = Token.INVALID_TYPE;
103 resetText();
104 try { // for char stream error handling
105 try { // for lexical error handling
106 switch ( LA(1)) {
107 case ' ':
108 {
109 mSP(true);
110 theRetToken=_returnToken;
111 break;
112 }
113 case ':':
114 {
115 mCOLON(true);
116 theRetToken=_returnToken;
117 break;
118 }
119 case '{':
120 {
121 mOPEN_CURLY(true);
122 theRetToken=_returnToken;
123 break;
124 }
125 case '}':
126 {
127 mCLOSE_CURLY(true);
128 theRetToken=_returnToken;
129 break;
130 }
131 case ',':
132 {
133 mSEP(true);
134 theRetToken=_returnToken;
135 break;
136 }
137 case '"':
138 {
139 mSAFEUTF8STRING(true);
140 theRetToken=_returnToken;
141 break;
142 }
143 case 'A': case 'B': case 'C': case 'D':
144 case 'E': case 'F': case 'G': case 'H':
145 case 'I': case 'J': case 'K': case 'L':
146 case 'M': case 'N': case 'O': case 'P':
147 case 'Q': case 'R': case 'S': case 'T':
148 case 'U': case 'V': case 'W': case 'X':
149 case 'Y': case 'Z': case 'a': case 'b':
150 case 'c': case 'd': case 'e': case 'f':
151 case 'g': case 'h': case 'i': case 'j':
152 case 'k': case 'l': case 'm': case 'n':
153 case 'o': case 'p': case 'q': case 'r':
154 case 's': case 't': case 'u': case 'v':
155 case 'w': case 'x': case 'y': case 'z':
156 {
157 mDESCR(true);
158 theRetToken=_returnToken;
159 break;
160 }
161 case '0': case '1': case '2': case '3':
162 case '4': case '5': case '6': case '7':
163 case '8': case '9':
164 {
165 mINTEGER_OR_NUMERICOID(true);
166 theRetToken=_returnToken;
167 break;
168 }
169 case '(':
170 {
171 mFILTER(true);
172 theRetToken=_returnToken;
173 break;
174 }
175 default:
176 {
177 if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);}
178 else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
179 }
180 }
181 if ( _returnToken==null ) continue tryAgain; // found SKIP token
182 _ttype = _returnToken.getType();
183 _ttype = testLiteralsTable(_ttype);
184 _returnToken.setType(_ttype);
185 return _returnToken;
186 }
187 catch (RecognitionException e) {
188 throw new TokenStreamRecognitionException(e);
189 }
190 }
191 catch (CharStreamException cse) {
192 if ( cse instanceof CharStreamIOException ) {
193 throw new TokenStreamIOException(((CharStreamIOException)cse).io);
194 }
195 else {
196 throw new TokenStreamException(cse.getMessage());
197 }
198 }
199 }
200 }
201
202 public final void mSP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
203 int _ttype; Token _token=null; int _begin=text.length();
204 _ttype = SP;
205 int _saveIndex;
206
207 match(' ');
208 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
209 _token = makeToken(_ttype);
210 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
211 }
212 _returnToken = _token;
213 }
214
215 public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
216 int _ttype; Token _token=null; int _begin=text.length();
217 _ttype = COLON;
218 int _saveIndex;
219
220 match(':');
221 if ( inputState.guessing==0 ) {
222 log.debug( "matched COLON(':')" );
223 }
224 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
225 _token = makeToken(_ttype);
226 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
227 }
228 _returnToken = _token;
229 }
230
231 public final void mOPEN_CURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
232 int _ttype; Token _token=null; int _begin=text.length();
233 _ttype = OPEN_CURLY;
234 int _saveIndex;
235
236 match('{');
237 if ( inputState.guessing==0 ) {
238 log.debug( "matched LBRACKET('{')" );
239 }
240 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
241 _token = makeToken(_ttype);
242 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
243 }
244 _returnToken = _token;
245 }
246
247 public final void mCLOSE_CURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
248 int _ttype; Token _token=null; int _begin=text.length();
249 _ttype = CLOSE_CURLY;
250 int _saveIndex;
251
252 match('}');
253 if ( inputState.guessing==0 ) {
254 log.debug( "matched RBRACKET('}')" );
255 }
256 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
257 _token = makeToken(_ttype);
258 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
259 }
260 _returnToken = _token;
261 }
262
263 public final void mSEP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
264 int _ttype; Token _token=null; int _begin=text.length();
265 _ttype = SEP;
266 int _saveIndex;
267
268 match(',');
269 if ( inputState.guessing==0 ) {
270 log.debug( "matched SEP(',')" );
271 }
272 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
273 _token = makeToken(_ttype);
274 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
275 }
276 _returnToken = _token;
277 }
278
279 public final void mSAFEUTF8STRING(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
280 int _ttype; Token _token=null; int _begin=text.length();
281 _ttype = SAFEUTF8STRING;
282 int _saveIndex;
283
284 _saveIndex=text.length();
285 match('"');
286 text.setLength(_saveIndex);
287 {
288 _loop1659:
289 do {
290 if ((_tokenSet_0.member(LA(1)))) {
291 mSAFEUTF8CHAR(false);
292 }
293 else {
294 break _loop1659;
295 }
296
297 } while (true);
298 }
299 _saveIndex=text.length();
300 match('"');
301 text.setLength(_saveIndex);
302 if ( inputState.guessing==0 ) {
303 log.debug( "matched SAFEUTF8CHAR: \"" + getText() + "\"" );
304 }
305 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
306 _token = makeToken(_ttype);
307 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
308 }
309 _returnToken = _token;
310 }
311
312 protected final void mSAFEUTF8CHAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
313 int _ttype; Token _token=null; int _begin=text.length();
314 _ttype = SAFEUTF8CHAR;
315 int _saveIndex;
316
317 switch ( LA(1)) {
318 case '\u0001': case '\u0002': case '\u0003': case '\u0004':
319 case '\u0005': case '\u0006': case '\u0007': case '\u0008':
320 case '\t': case '\n': case '\u000b': case '\u000c':
321 case '\r': case '\u000e': case '\u000f': case '\u0010':
322 case '\u0011': case '\u0012': case '\u0013': case '\u0014':
323 case '\u0015': case '\u0016': case '\u0017': case '\u0018':
324 case '\u0019': case '\u001a': case '\u001b': case '\u001c':
325 case '\u001d': case '\u001e': case '\u001f': case ' ':
326 case '!':
327 {
328 matchRange('\u0001','\u0021');
329 break;
330 }
331 case '#': case '$': case '%': case '&':
332 case '\'': case '(': case ')': case '*':
333 case '+': case ',': case '-': case '.':
334 case '/': case '0': case '1': case '2':
335 case '3': case '4': case '5': case '6':
336 case '7': case '8': case '9': case ':':
337 case ';': case '<': case '=': case '>':
338 case '?': case '@': case 'A': case 'B':
339 case 'C': case 'D': case 'E': case 'F':
340 case 'G': case 'H': case 'I': case 'J':
341 case 'K': case 'L': case 'M': case 'N':
342 case 'O': case 'P': case 'Q': case 'R':
343 case 'S': case 'T': case 'U': case 'V':
344 case 'W': case 'X': case 'Y': case 'Z':
345 case '[': case '\\': case ']': case '^':
346 case '_': case '`': case 'a': case 'b':
347 case 'c': case 'd': case 'e': case 'f':
348 case 'g': case 'h': case 'i': case 'j':
349 case 'k': case 'l': case 'm': case 'n':
350 case 'o': case 'p': case 'q': case 'r':
351 case 's': case 't': case 'u': case 'v':
352 case 'w': case 'x': case 'y': case 'z':
353 case '{': case '|': case '}': case '~':
354 case '\u007f':
355 {
356 matchRange('\u0023','\u007F');
357 break;
358 }
359 case '\u00c0': case '\u00c1': case '\u00c2': case '\u00c3':
360 case '\u00c4': case '\u00c5': case '\u00c6': case '\u00c7':
361 case '\u00c8': case '\u00c9': case '\u00ca': case '\u00cb':
362 case '\u00cc': case '\u00cd': case '\u00ce': case '\u00cf':
363 case '\u00d0': case '\u00d1': case '\u00d2': case '\u00d3':
364 case '\u00d4': case '\u00d5': case '\u00d6':
365 {
366 matchRange('\u00c0','\u00d6');
367 break;
368 }
369 case '\u00d8': case '\u00d9': case '\u00da': case '\u00db':
370 case '\u00dc': case '\u00dd': case '\u00de': case '\u00df':
371 case '\u00e0': case '\u00e1': case '\u00e2': case '\u00e3':
372 case '\u00e4': case '\u00e5': case '\u00e6': case '\u00e7':
373 case '\u00e8': case '\u00e9': case '\u00ea': case '\u00eb':
374 case '\u00ec': case '\u00ed': case '\u00ee': case '\u00ef':
375 case '\u00f0': case '\u00f1': case '\u00f2': case '\u00f3':
376 case '\u00f4': case '\u00f5': case '\u00f6':
377 {
378 matchRange('\u00d8','\u00f6');
379 break;
380 }
381 case '\u00f8': case '\u00f9': case '\u00fa': case '\u00fb':
382 case '\u00fc': case '\u00fd': case '\u00fe': case '\u00ff':
383 {
384 matchRange('\u00f8','\u00ff');
385 break;
386 }
387 default:
388 if (((LA(1) >= '\u0100' && LA(1) <= '\u1fff'))) {
389 matchRange('\u0100','\u1fff');
390 }
391 else if (((LA(1) >= '\u3040' && LA(1) <= '\u318f'))) {
392 matchRange('\u3040','\u318f');
393 }
394 else if (((LA(1) >= '\u3300' && LA(1) <= '\u337f'))) {
395 matchRange('\u3300','\u337f');
396 }
397 else if (((LA(1) >= '\u3400' && LA(1) <= '\u3d2d'))) {
398 matchRange('\u3400','\u3d2d');
399 }
400 else if (((LA(1) >= '\u4e00' && LA(1) <= '\u9fff'))) {
401 matchRange('\u4e00','\u9fff');
402 }
403 else if (((LA(1) >= '\uf900' && LA(1) <= '\ufaff'))) {
404 matchRange('\uf900','\ufaff');
405 }
406 else {
407 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
408 }
409 }
410 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
411 _token = makeToken(_ttype);
412 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
413 }
414 _returnToken = _token;
415 }
416
417 public final void mDESCR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
418 int _ttype; Token _token=null; int _begin=text.length();
419 _ttype = DESCR;
420 int _saveIndex;
421
422 mALPHA(false);
423 {
424 _loop1662:
425 do {
426 switch ( LA(1)) {
427 case 'A': case 'B': case 'C': case 'D':
428 case 'E': case 'F': case 'G': case 'H':
429 case 'I': case 'J': case 'K': case 'L':
430 case 'M': case 'N': case 'O': case 'P':
431 case 'Q': case 'R': case 'S': case 'T':
432 case 'U': case 'V': case 'W': case 'X':
433 case 'Y': case 'Z': case 'a': case 'b':
434 case 'c': case 'd': case 'e': case 'f':
435 case 'g': case 'h': case 'i': case 'j':
436 case 'k': case 'l': case 'm': case 'n':
437 case 'o': case 'p': case 'q': case 'r':
438 case 's': case 't': case 'u': case 'v':
439 case 'w': case 'x': case 'y': case 'z':
440 {
441 mALPHA(false);
442 break;
443 }
444 case '0': case '1': case '2': case '3':
445 case '4': case '5': case '6': case '7':
446 case '8': case '9':
447 {
448 mDIGIT(false);
449 break;
450 }
451 case '-':
452 {
453 match('-');
454 break;
455 }
456 default:
457 {
458 break _loop1662;
459 }
460 }
461 } while (true);
462 }
463 if ( inputState.guessing==0 ) {
464 log.debug( "matched DESCR" );
465 }
466 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
467 _token = makeToken(_ttype);
468 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
469 }
470 _returnToken = _token;
471 }
472
473 protected final void mALPHA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
474 int _ttype; Token _token=null; int _begin=text.length();
475 _ttype = ALPHA;
476 int _saveIndex;
477
478 switch ( LA(1)) {
479 case 'A': case 'B': case 'C': case 'D':
480 case 'E': case 'F': case 'G': case 'H':
481 case 'I': case 'J': case 'K': case 'L':
482 case 'M': case 'N': case 'O': case 'P':
483 case 'Q': case 'R': case 'S': case 'T':
484 case 'U': case 'V': case 'W': case 'X':
485 case 'Y': case 'Z':
486 {
487 matchRange('A','Z');
488 break;
489 }
490 case 'a': case 'b': case 'c': case 'd':
491 case 'e': case 'f': case 'g': case 'h':
492 case 'i': case 'j': case 'k': case 'l':
493 case 'm': case 'n': case 'o': case 'p':
494 case 'q': case 'r': case 's': case 't':
495 case 'u': case 'v': case 'w': case 'x':
496 case 'y': case 'z':
497 {
498 matchRange('a','z');
499 break;
500 }
501 default:
502 {
503 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
504 }
505 }
506 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
507 _token = makeToken(_ttype);
508 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
509 }
510 _returnToken = _token;
511 }
512
513 protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
514 int _ttype; Token _token=null; int _begin=text.length();
515 _ttype = DIGIT;
516 int _saveIndex;
517
518 switch ( LA(1)) {
519 case '0':
520 {
521 match('0');
522 break;
523 }
524 case '1': case '2': case '3': case '4':
525 case '5': case '6': case '7': case '8':
526 case '9':
527 {
528 mLDIGIT(false);
529 break;
530 }
531 default:
532 {
533 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
534 }
535 }
536 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
537 _token = makeToken(_ttype);
538 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
539 }
540 _returnToken = _token;
541 }
542
543 public final void mINTEGER_OR_NUMERICOID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
544 int _ttype; Token _token=null; int _begin=text.length();
545 _ttype = INTEGER_OR_NUMERICOID;
546 int _saveIndex;
547
548 boolean synPredMatched1665 = false;
549 if ((((LA(1) >= '0' && LA(1) <= '9')) && (_tokenSet_1.member(LA(2))))) {
550 int _m1665 = mark();
551 synPredMatched1665 = true;
552 inputState.guessing++;
553 try {
554 {
555 mINTEGER(false);
556 mDOT(false);
557 }
558 }
559 catch (RecognitionException pe) {
560 synPredMatched1665 = false;
561 }
562 rewind(_m1665);
563 inputState.guessing--;
564 }
565 if ( synPredMatched1665 ) {
566 mNUMERICOID(false);
567 if ( inputState.guessing==0 ) {
568
569 _ttype = NUMERICOID;
570
571 }
572 }
573 else if (((LA(1) >= '0' && LA(1) <= '9')) && (true)) {
574 mINTEGER(false);
575 if ( inputState.guessing==0 ) {
576
577 _ttype = INTEGER;
578
579 }
580 }
581 else {
582 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
583 }
584
585 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
586 _token = makeToken(_ttype);
587 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
588 }
589 _returnToken = _token;
590 }
591
592 protected final void mINTEGER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
593 int _ttype; Token _token=null; int _begin=text.length();
594 _ttype = INTEGER;
595 int _saveIndex;
596
597 if (((LA(1) >= '1' && LA(1) <= '9')) && ((LA(2) >= '0' && LA(2) <= '9'))) {
598 {
599 mLDIGIT(false);
600 {
601 int _cnt1669=0;
602 _loop1669:
603 do {
604 if (((LA(1) >= '0' && LA(1) <= '9'))) {
605 mDIGIT(false);
606 }
607 else {
608 if ( _cnt1669>=1 ) { break _loop1669; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
609 }
610
611 _cnt1669++;
612 } while (true);
613 }
614 }
615 if ( inputState.guessing==0 ) {
616 log.debug( "matched INTEGER: " + getText() );
617 }
618 }
619 else if (((LA(1) >= '0' && LA(1) <= '9')) && (true)) {
620 mDIGIT(false);
621 }
622 else {
623 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
624 }
625
626 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
627 _token = makeToken(_ttype);
628 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
629 }
630 _returnToken = _token;
631 }
632
633 protected final void mDOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
634 int _ttype; Token _token=null; int _begin=text.length();
635 _ttype = DOT;
636 int _saveIndex;
637
638 match('.');
639 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
640 _token = makeToken(_ttype);
641 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
642 }
643 _returnToken = _token;
644 }
645
646 protected final void mNUMERICOID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
647 int _ttype; Token _token=null; int _begin=text.length();
648 _ttype = NUMERICOID;
649 int _saveIndex;
650
651 mINTEGER(false);
652 {
653 int _cnt1672=0;
654 _loop1672:
655 do {
656 if ((LA(1)=='.')) {
657 mDOT(false);
658 mINTEGER(false);
659 }
660 else {
661 if ( _cnt1672>=1 ) { break _loop1672; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
662 }
663
664 _cnt1672++;
665 } while (true);
666 }
667 if ( inputState.guessing==0 ) {
668 log.debug( "matched NUMERICOID: " + getText() );
669 }
670 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
671 _token = makeToken(_ttype);
672 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
673 }
674 _returnToken = _token;
675 }
676
677 protected final void mLDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
678 int _ttype; Token _token=null; int _begin=text.length();
679 _ttype = LDIGIT;
680 int _saveIndex;
681
682 matchRange('1','9');
683 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
684 _token = makeToken(_ttype);
685 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
686 }
687 _returnToken = _token;
688 }
689
690 public final void mFILTER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
691 int _ttype; Token _token=null; int _begin=text.length();
692 _ttype = FILTER;
693 int _saveIndex;
694
695 match('(');
696 {
697 switch ( LA(1)) {
698 case '&':
699 {
700 {
701 match('&');
702 {
703 _loop1682:
704 do {
705 if ((LA(1)==' ')) {
706 mSP(false);
707 }
708 else {
709 break _loop1682;
710 }
711
712 } while (true);
713 }
714 {
715 int _cnt1684=0;
716 _loop1684:
717 do {
718 if ((LA(1)=='(')) {
719 mFILTER(false);
720 }
721 else {
722 if ( _cnt1684>=1 ) { break _loop1684; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
723 }
724
725 _cnt1684++;
726 } while (true);
727 }
728 }
729 break;
730 }
731 case '|':
732 {
733 {
734 match('|');
735 {
736 _loop1687:
737 do {
738 if ((LA(1)==' ')) {
739 mSP(false);
740 }
741 else {
742 break _loop1687;
743 }
744
745 } while (true);
746 }
747 {
748 int _cnt1689=0;
749 _loop1689:
750 do {
751 if ((LA(1)=='(')) {
752 mFILTER(false);
753 }
754 else {
755 if ( _cnt1689>=1 ) { break _loop1689; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
756 }
757
758 _cnt1689++;
759 } while (true);
760 }
761 }
762 break;
763 }
764 case '!':
765 {
766 {
767 match('!');
768 {
769 _loop1692:
770 do {
771 if ((LA(1)==' ')) {
772 mSP(false);
773 }
774 else {
775 break _loop1692;
776 }
777
778 } while (true);
779 }
780 mFILTER(false);
781 }
782 break;
783 }
784 default:
785 if ((_tokenSet_2.member(LA(1)))) {
786 mFILTER_VALUE(false);
787 }
788 else {
789 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
790 }
791 }
792 }
793 match(')');
794 {
795 _loop1694:
796 do {
797 if ((LA(1)==' ')) {
798 mSP(false);
799 }
800 else {
801 break _loop1694;
802 }
803
804 } while (true);
805 }
806 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
807 _token = makeToken(_ttype);
808 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
809 }
810 _returnToken = _token;
811 }
812
813 protected final void mFILTER_VALUE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
814 int _ttype; Token _token=null; int _begin=text.length();
815 _ttype = FILTER_VALUE;
816 int _saveIndex;
817
818 {
819 {
820 match(_tokenSet_2);
821 }
822 {
823 _loop1700:
824 do {
825 if ((_tokenSet_3.member(LA(1)))) {
826 {
827 match(_tokenSet_3);
828 }
829 }
830 else {
831 break _loop1700;
832 }
833
834 } while (true);
835 }
836 }
837 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
838 _token = makeToken(_ttype);
839 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
840 }
841 _returnToken = _token;
842 }
843
844
845 private static final long[] mk_tokenSet_0() {
846 long[] data = new long[3988];
847 data[0]=-17179869186L;
848 data[1]=-1L;
849 data[3]=-36028797027352577L;
850 for (int i = 4; i<=127; i++) { data[i]=-1L; }
851 for (int i = 193; i<=197; i++) { data[i]=-1L; }
852 data[198]=65535L;
853 for (int i = 204; i<=205; i++) { data[i]=-1L; }
854 for (int i = 208; i<=243; i++) { data[i]=-1L; }
855 data[244]=70368744177663L;
856 for (int i = 312; i<=639; i++) { data[i]=-1L; }
857 for (int i = 996; i<=1003; i++) { data[i]=-1L; }
858 return data;
859 }
860 public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
861 private static final long[] mk_tokenSet_1() {
862 long[] data = new long[1025];
863 data[0]=288019269919178752L;
864 return data;
865 }
866 public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
867 private static final long[] mk_tokenSet_2() {
868 long[] data = new long[2048];
869 data[0]=-3582002724866L;
870 data[1]=-1152921504606846977L;
871 for (int i = 2; i<=127; i++) { data[i]=-1L; }
872 for (int i = 193; i<=197; i++) { data[i]=-1L; }
873 data[198]=65535L;
874 for (int i = 204; i<=205; i++) { data[i]=-1L; }
875 for (int i = 208; i<=243; i++) { data[i]=-1L; }
876 data[244]=70368744177663L;
877 for (int i = 312; i<=639; i++) { data[i]=-1L; }
878 for (int i = 996; i<=1003; i++) { data[i]=-1L; }
879 return data;
880 }
881 public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
882 private static final long[] mk_tokenSet_3() {
883 long[] data = new long[2048];
884 data[0]=-2199023255554L;
885 for (int i = 1; i<=127; i++) { data[i]=-1L; }
886 for (int i = 193; i<=197; i++) { data[i]=-1L; }
887 data[198]=65535L;
888 for (int i = 204; i<=205; i++) { data[i]=-1L; }
889 for (int i = 208; i<=243; i++) { data[i]=-1L; }
890 data[244]=70368744177663L;
891 for (int i = 312; i<=639; i++) { data[i]=-1L; }
892 for (int i = 996; i<=1003; i++) { data[i]=-1L; }
893 return data;
894 }
895 public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
896
897 }