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