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