001    // $ANTLR 2.7.4: "ACIItem.g" -> "AntlrACIItemLexer.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.aci;
025    
026    
027    import java.util.List;
028    import java.util.ArrayList;
029    import java.util.HashSet;
030    import java.util.Map;
031    import java.util.Set;
032    import java.util.Enumeration;
033    
034    import javax.naming.directory.Attribute;
035    import javax.naming.directory.BasicAttribute;
036    
037    import org.apache.directory.shared.ldap.filter.BranchNode;
038    import org.apache.directory.shared.ldap.filter.AndNode;
039    import org.apache.directory.shared.ldap.filter.OrNode;
040    import org.apache.directory.shared.ldap.filter.NotNode;
041    import org.apache.directory.shared.ldap.filter.ExprNode;
042    import org.apache.directory.shared.ldap.filter.LeafNode;
043    import org.apache.directory.shared.ldap.filter.EqualityNode;
044    import org.apache.directory.shared.ldap.filter.FilterParser;
045    import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
046    import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
047    import org.apache.directory.shared.ldap.subtree.SubtreeSpecificationModifier;
048    import org.apache.directory.shared.ldap.util.ComponentsMonitor;
049    import org.apache.directory.shared.ldap.util.MandatoryAndOptionalComponentsMonitor;
050    import org.apache.directory.shared.ldap.util.MandatoryComponentsMonitor;
051    import org.apache.directory.shared.ldap.util.NamespaceTools;
052    import org.apache.directory.shared.ldap.util.NoDuplicateKeysMap;
053    import org.apache.directory.shared.ldap.util.OptionalComponentsMonitor;
054    import org.apache.directory.shared.ldap.name.DN;
055    import org.apache.directory.shared.ldap.name.RDN;
056    import org.apache.directory.shared.ldap.constants.SchemaConstants;
057    import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
058    import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
059    import org.apache.directory.shared.ldap.entry.StringValue;
060    
061    import org.slf4j.Logger;
062    import org.slf4j.LoggerFactory;
063    
064    
065    import java.io.InputStream;
066    import antlr.TokenStreamException;
067    import antlr.TokenStreamIOException;
068    import antlr.TokenStreamRecognitionException;
069    import antlr.CharStreamException;
070    import antlr.CharStreamIOException;
071    import antlr.ANTLRException;
072    import java.io.Reader;
073    import java.util.Hashtable;
074    import antlr.CharScanner;
075    import antlr.InputBuffer;
076    import antlr.ByteBuffer;
077    import antlr.CharBuffer;
078    import antlr.Token;
079    import antlr.CommonToken;
080    import antlr.RecognitionException;
081    import antlr.NoViableAltForCharException;
082    import antlr.MismatchedCharException;
083    import antlr.TokenStream;
084    import antlr.ANTLRHashString;
085    import antlr.LexerSharedInputState;
086    import antlr.collections.impl.BitSet;
087    import antlr.SemanticException;
088    
089    /**
090      * The parser's primary lexer.
091      *
092      * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
093      * @version $Rev$
094      */
095    public class AntlrACIItemLexer extends antlr.CharScanner implements AntlrACIItemParserTokenTypes, TokenStream
096     {
097    
098        private static final Logger log = LoggerFactory.getLogger( AntlrACIItemLexer.class );
099    public AntlrACIItemLexer(InputStream in) {
100            this(new ByteBuffer(in));
101    }
102    public AntlrACIItemLexer(Reader in) {
103            this(new CharBuffer(in));
104    }
105    public AntlrACIItemLexer(InputBuffer ib) {
106            this(new LexerSharedInputState(ib));
107    }
108    public AntlrACIItemLexer(LexerSharedInputState state) {
109            super(state);
110            caseSensitiveLiterals = true;
111            setCaseSensitive(true);
112            literals = new Hashtable();
113            literals.put(new ANTLRHashString("type", this), new Integer(30));
114            literals.put(new ANTLRHashString("strong", this), new Integer(17));
115            literals.put(new ANTLRHashString("name", this), new Integer(68));
116            literals.put(new ANTLRHashString("specificExclusions", this), new Integer(73));
117            literals.put(new ANTLRHashString("denyBrowse", this), new Integer(47));
118            literals.put(new ANTLRHashString("denyModify", this), new Integer(53));
119            literals.put(new ANTLRHashString("denyCompare", this), new Integer(59));
120            literals.put(new ANTLRHashString("classes", this), new Integer(35));
121            literals.put(new ANTLRHashString("denyAdd", this), new Integer(39));
122            literals.put(new ANTLRHashString("maximum", this), new Integer(77));
123            literals.put(new ANTLRHashString("grantInvoke", this), new Integer(62));
124            literals.put(new ANTLRHashString("denyDiscloseOnError", this), new Integer(41));
125            literals.put(new ANTLRHashString("rangeOfValues", this), new Integer(90));
126            literals.put(new ANTLRHashString("maxCount", this), new Integer(31));
127            literals.put(new ANTLRHashString("userClasses", this), new Integer(64));
128            literals.put(new ANTLRHashString("denyInvoke", this), new Integer(63));
129            literals.put(new ANTLRHashString("and", this), new Integer(81));
130            literals.put(new ANTLRHashString("denyRead", this), new Integer(43));
131            literals.put(new ANTLRHashString("not", this), new Integer(83));
132            literals.put(new ANTLRHashString("grantReturnDN", this), new Integer(56));
133            literals.put(new ANTLRHashString("maxImmSub", this), new Integer(32));
134            literals.put(new ANTLRHashString("grantCompare", this), new Integer(58));
135            literals.put(new ANTLRHashString("parentOfEntry", this), new Integer(67));
136            literals.put(new ANTLRHashString("precedence", this), new Integer(12));
137            literals.put(new ANTLRHashString("base", this), new Integer(72));
138            literals.put(new ANTLRHashString("minimum", this), new Integer(76));
139            literals.put(new ANTLRHashString("grantsAndDenials", this), new Integer(37));
140            literals.put(new ANTLRHashString("itemOrUserFirst", this), new Integer(18));
141            literals.put(new ANTLRHashString("entry", this), new Integer(23));
142            literals.put(new ANTLRHashString("FALSE", this), new Integer(84));
143            literals.put(new ANTLRHashString("selfValue", this), new Integer(28));
144            literals.put(new ANTLRHashString("specificationFilter", this), new Integer(91));
145            literals.put(new ANTLRHashString("itemPermissions", this), new Integer(36));
146            literals.put(new ANTLRHashString("grantRemove", this), new Integer(44));
147            literals.put(new ANTLRHashString("or", this), new Integer(82));
148            literals.put(new ANTLRHashString("allAttributeValues", this), new Integer(26));
149            literals.put(new ANTLRHashString("none", this), new Integer(15));
150            literals.put(new ANTLRHashString("attributeType", this), new Integer(25));
151            literals.put(new ANTLRHashString("chopAfter", this), new Integer(75));
152            literals.put(new ANTLRHashString("subtree", this), new Integer(70));
153            literals.put(new ANTLRHashString("denyRemove", this), new Integer(45));
154            literals.put(new ANTLRHashString("userFirst", this), new Integer(21));
155            literals.put(new ANTLRHashString("grantAdd", this), new Integer(38));
156            literals.put(new ANTLRHashString("grantFilterMatch", this), new Integer(60));
157            literals.put(new ANTLRHashString("allUserAttributeTypesAndValues", this), new Integer(27));
158            literals.put(new ANTLRHashString("maxValueCount", this), new Integer(29));
159            literals.put(new ANTLRHashString("grantExport", this), new Integer(48));
160            literals.put(new ANTLRHashString("basicLevels", this), new Integer(87));
161            literals.put(new ANTLRHashString("denyFilterMatch", this), new Integer(61));
162            literals.put(new ANTLRHashString("protectedItems", this), new Integer(22));
163            literals.put(new ANTLRHashString("identificationTag", this), new Integer(10));
164            literals.put(new ANTLRHashString("grantRename", this), new Integer(54));
165            literals.put(new ANTLRHashString("grantImport", this), new Integer(50));
166            literals.put(new ANTLRHashString("localQualifier", this), new Integer(88));
167            literals.put(new ANTLRHashString("userPermissions", this), new Integer(71));
168            literals.put(new ANTLRHashString("grantRead", this), new Integer(42));
169            literals.put(new ANTLRHashString("denyExport", this), new Integer(49));
170            literals.put(new ANTLRHashString("denyRename", this), new Integer(55));
171            literals.put(new ANTLRHashString("itemFirst", this), new Integer(19));
172            literals.put(new ANTLRHashString("denyImport", this), new Integer(51));
173            literals.put(new ANTLRHashString("restrictedBy", this), new Integer(33));
174            literals.put(new ANTLRHashString("chopBefore", this), new Integer(74));
175            literals.put(new ANTLRHashString("signed", this), new Integer(89));
176            literals.put(new ANTLRHashString("grantDiscloseOnError", this), new Integer(40));
177            literals.put(new ANTLRHashString("level", this), new Integer(86));
178            literals.put(new ANTLRHashString("allUserAttributeTypes", this), new Integer(24));
179            literals.put(new ANTLRHashString("TRUE", this), new Integer(85));
180            literals.put(new ANTLRHashString("authenticationLevel", this), new Integer(14));
181            literals.put(new ANTLRHashString("denyReturnDN", this), new Integer(57));
182            literals.put(new ANTLRHashString("grantBrowse", this), new Integer(46));
183            literals.put(new ANTLRHashString("thisEntry", this), new Integer(66));
184            literals.put(new ANTLRHashString("grantModify", this), new Integer(52));
185            literals.put(new ANTLRHashString("allUsers", this), new Integer(65));
186            literals.put(new ANTLRHashString("item", this), new Integer(80));
187            literals.put(new ANTLRHashString("userGroup", this), new Integer(69));
188            literals.put(new ANTLRHashString("simple", this), new Integer(16));
189            literals.put(new ANTLRHashString("valuesIn", this), new Integer(34));
190    }
191    
192    public Token nextToken() throws TokenStreamException {
193            Token theRetToken=null;
194    tryAgain:
195            for (;;) {
196                    Token _token = null;
197                    int _ttype = Token.INVALID_TYPE;
198                    resetText();
199                    try {   // for char stream error handling
200                            try {   // for lexical error handling
201                                    switch ( LA(1)) {
202                                    case '{':
203                                    {
204                                            mOPEN_CURLY(true);
205                                            theRetToken=_returnToken;
206                                            break;
207                                    }
208                                    case '}':
209                                    {
210                                            mCLOSE_CURLY(true);
211                                            theRetToken=_returnToken;
212                                            break;
213                                    }
214                                    case ',':
215                                    {
216                                            mSEP(true);
217                                            theRetToken=_returnToken;
218                                            break;
219                                    }
220                                    case '\t':  case '\n':  case '\r':  case ' ':
221                                    {
222                                            mSP(true);
223                                            theRetToken=_returnToken;
224                                            break;
225                                    }
226                                    case ':':
227                                    {
228                                            mCOLON(true);
229                                            theRetToken=_returnToken;
230                                            break;
231                                    }
232                                    case '0':  case '1':  case '2':  case '3':
233                                    case '4':  case '5':  case '6':  case '7':
234                                    case '8':  case '9':
235                                    {
236                                            mINTEGER_OR_NUMERICOID(true);
237                                            theRetToken=_returnToken;
238                                            break;
239                                    }
240                                    case '"':
241                                    {
242                                            mSAFEUTF8STRING(true);
243                                            theRetToken=_returnToken;
244                                            break;
245                                    }
246                                    case 'A':  case 'B':  case 'C':  case 'D':
247                                    case 'E':  case 'F':  case 'G':  case 'H':
248                                    case 'I':  case 'J':  case 'K':  case 'L':
249                                    case 'M':  case 'N':  case 'O':  case 'P':
250                                    case 'Q':  case 'R':  case 'S':  case 'T':
251                                    case 'U':  case 'V':  case 'W':  case 'X':
252                                    case 'Y':  case 'Z':  case 'a':  case 'b':
253                                    case 'c':  case 'd':  case 'e':  case 'f':
254                                    case 'g':  case 'h':  case 'i':  case 'j':
255                                    case 'k':  case 'l':  case 'm':  case 'n':
256                                    case 'o':  case 'p':  case 'q':  case 'r':
257                                    case 's':  case 't':  case 'u':  case 'v':
258                                    case 'w':  case 'x':  case 'y':  case 'z':
259                                    {
260                                            mDESCR(true);
261                                            theRetToken=_returnToken;
262                                            break;
263                                    }
264                                    default:
265                                    {
266                                            if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);}
267                                    else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
268                                    }
269                                    }
270                                    if ( _returnToken==null ) continue tryAgain; // found SKIP token
271                                    _ttype = _returnToken.getType();
272                                    _ttype = testLiteralsTable(_ttype);
273                                    _returnToken.setType(_ttype);
274                                    return _returnToken;
275                            }
276                            catch (RecognitionException e) {
277                                    throw new TokenStreamRecognitionException(e);
278                            }
279                    }
280                    catch (CharStreamException cse) {
281                            if ( cse instanceof CharStreamIOException ) {
282                                    throw new TokenStreamIOException(((CharStreamIOException)cse).io);
283                            }
284                            else {
285                                    throw new TokenStreamException(cse.getMessage());
286                            }
287                    }
288            }
289    }
290    
291            protected final void mSAFEUTF8CHAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
292                    int _ttype; Token _token=null; int _begin=text.length();
293                    _ttype = SAFEUTF8CHAR;
294                    int _saveIndex;
295                    
296                    switch ( LA(1)) {
297                    case '\u0001':  case '\u0002':  case '\u0003':  case '\u0004':
298                    case '\u0005':  case '\u0006':  case '\u0007':  case '\u0008':
299                    case '\t':  case '\n':  case '\u000b':  case '\u000c':
300                    case '\r':  case '\u000e':  case '\u000f':  case '\u0010':
301                    case '\u0011':  case '\u0012':  case '\u0013':  case '\u0014':
302                    case '\u0015':  case '\u0016':  case '\u0017':  case '\u0018':
303                    case '\u0019':  case '\u001a':  case '\u001b':  case '\u001c':
304                    case '\u001d':  case '\u001e':  case '\u001f':  case ' ':
305                    case '!':
306                    {
307                            matchRange('\u0001','\u0021');
308                            break;
309                    }
310                    case '#':  case '$':  case '%':  case '&':
311                    case '\'':  case '(':  case ')':  case '*':
312                    case '+':  case ',':  case '-':  case '.':
313                    case '/':  case '0':  case '1':  case '2':
314                    case '3':  case '4':  case '5':  case '6':
315                    case '7':  case '8':  case '9':  case ':':
316                    case ';':  case '<':  case '=':  case '>':
317                    case '?':  case '@':  case 'A':  case 'B':
318                    case 'C':  case 'D':  case 'E':  case 'F':
319                    case 'G':  case 'H':  case 'I':  case 'J':
320                    case 'K':  case 'L':  case 'M':  case 'N':
321                    case 'O':  case 'P':  case 'Q':  case 'R':
322                    case 'S':  case 'T':  case 'U':  case 'V':
323                    case 'W':  case 'X':  case 'Y':  case 'Z':
324                    case '[':  case '\\':  case ']':  case '^':
325                    case '_':  case '`':  case 'a':  case 'b':
326                    case 'c':  case 'd':  case 'e':  case 'f':
327                    case 'g':  case 'h':  case 'i':  case 'j':
328                    case 'k':  case 'l':  case 'm':  case 'n':
329                    case 'o':  case 'p':  case 'q':  case 'r':
330                    case 's':  case 't':  case 'u':  case 'v':
331                    case 'w':  case 'x':  case 'y':  case 'z':
332                    case '{':  case '|':  case '}':  case '~':
333                    case '\u007f':
334                    {
335                            matchRange('\u0023','\u007F');
336                            break;
337                    }
338                    case '\u00c0':  case '\u00c1':  case '\u00c2':  case '\u00c3':
339                    case '\u00c4':  case '\u00c5':  case '\u00c6':  case '\u00c7':
340                    case '\u00c8':  case '\u00c9':  case '\u00ca':  case '\u00cb':
341                    case '\u00cc':  case '\u00cd':  case '\u00ce':  case '\u00cf':
342                    case '\u00d0':  case '\u00d1':  case '\u00d2':  case '\u00d3':
343                    case '\u00d4':  case '\u00d5':  case '\u00d6':
344                    {
345                            matchRange('\u00c0','\u00d6');
346                            break;
347                    }
348                    case '\u00d8':  case '\u00d9':  case '\u00da':  case '\u00db':
349                    case '\u00dc':  case '\u00dd':  case '\u00de':  case '\u00df':
350                    case '\u00e0':  case '\u00e1':  case '\u00e2':  case '\u00e3':
351                    case '\u00e4':  case '\u00e5':  case '\u00e6':  case '\u00e7':
352                    case '\u00e8':  case '\u00e9':  case '\u00ea':  case '\u00eb':
353                    case '\u00ec':  case '\u00ed':  case '\u00ee':  case '\u00ef':
354                    case '\u00f0':  case '\u00f1':  case '\u00f2':  case '\u00f3':
355                    case '\u00f4':  case '\u00f5':  case '\u00f6':
356                    {
357                            matchRange('\u00d8','\u00f6');
358                            break;
359                    }
360                    case '\u00f8':  case '\u00f9':  case '\u00fa':  case '\u00fb':
361                    case '\u00fc':  case '\u00fd':  case '\u00fe':  case '\u00ff':
362                    {
363                            matchRange('\u00f8','\u00ff');
364                            break;
365                    }
366                    default:
367                            if (((LA(1) >= '\u0100' && LA(1) <= '\u1fff'))) {
368                                    matchRange('\u0100','\u1fff');
369                            }
370                            else if (((LA(1) >= '\u3040' && LA(1) <= '\u318f'))) {
371                                    matchRange('\u3040','\u318f');
372                            }
373                            else if (((LA(1) >= '\u3300' && LA(1) <= '\u337f'))) {
374                                    matchRange('\u3300','\u337f');
375                            }
376                            else if (((LA(1) >= '\u3400' && LA(1) <= '\u3d2d'))) {
377                                    matchRange('\u3400','\u3d2d');
378                            }
379                            else if (((LA(1) >= '\u4e00' && LA(1) <= '\u9fff'))) {
380                                    matchRange('\u4e00','\u9fff');
381                            }
382                            else if (((LA(1) >= '\uf900' && LA(1) <= '\ufaff'))) {
383                                    matchRange('\uf900','\ufaff');
384                            }
385                    else {
386                            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
387                    }
388                    }
389                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
390                            _token = makeToken(_ttype);
391                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
392                    }
393                    _returnToken = _token;
394            }
395            
396            public final void mOPEN_CURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
397                    int _ttype; Token _token=null; int _begin=text.length();
398                    _ttype = OPEN_CURLY;
399                    int _saveIndex;
400                    
401                    match('{');
402                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
403                            _token = makeToken(_ttype);
404                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
405                    }
406                    _returnToken = _token;
407            }
408            
409            public final void mCLOSE_CURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
410                    int _ttype; Token _token=null; int _begin=text.length();
411                    _ttype = CLOSE_CURLY;
412                    int _saveIndex;
413                    
414                    match('}');
415                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
416                            _token = makeToken(_ttype);
417                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
418                    }
419                    _returnToken = _token;
420            }
421            
422            public final void mSEP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
423                    int _ttype; Token _token=null; int _begin=text.length();
424                    _ttype = SEP;
425                    int _saveIndex;
426                    
427                    match(',');
428                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
429                            _token = makeToken(_ttype);
430                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
431                    }
432                    _returnToken = _token;
433            }
434            
435            public final void mSP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
436                    int _ttype; Token _token=null; int _begin=text.length();
437                    _ttype = SP;
438                    int _saveIndex;
439                    
440                    switch ( LA(1)) {
441                    case ' ':
442                    {
443                            match(' ');
444                            break;
445                    }
446                    case '\t':
447                    {
448                            match('\t');
449                            break;
450                    }
451                    case '\n':
452                    {
453                            match('\n');
454                            if ( inputState.guessing==0 ) {
455                                    newline();
456                            }
457                            break;
458                    }
459                    case '\r':
460                    {
461                            match('\r');
462                            break;
463                    }
464                    default:
465                    {
466                            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
467                    }
468                    }
469                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
470                            _token = makeToken(_ttype);
471                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
472                    }
473                    _returnToken = _token;
474            }
475            
476            public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
477                    int _ttype; Token _token=null; int _begin=text.length();
478                    _ttype = COLON;
479                    int _saveIndex;
480                    
481                    match(':');
482                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
483                            _token = makeToken(_ttype);
484                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
485                    }
486                    _returnToken = _token;
487            }
488            
489            protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
490                    int _ttype; Token _token=null; int _begin=text.length();
491                    _ttype = DIGIT;
492                    int _saveIndex;
493                    
494                    switch ( LA(1)) {
495                    case '0':
496                    {
497                            match('0');
498                            break;
499                    }
500                    case '1':  case '2':  case '3':  case '4':
501                    case '5':  case '6':  case '7':  case '8':
502                    case '9':
503                    {
504                            mLDIGIT(false);
505                            break;
506                    }
507                    default:
508                    {
509                            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
510                    }
511                    }
512                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
513                            _token = makeToken(_ttype);
514                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
515                    }
516                    _returnToken = _token;
517            }
518            
519            protected final void mLDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
520                    int _ttype; Token _token=null; int _begin=text.length();
521                    _ttype = LDIGIT;
522                    int _saveIndex;
523                    
524                    matchRange('1','9');
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 mALPHA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
533                    int _ttype; Token _token=null; int _begin=text.length();
534                    _ttype = ALPHA;
535                    int _saveIndex;
536                    
537                    switch ( LA(1)) {
538                    case 'A':  case 'B':  case 'C':  case 'D':
539                    case 'E':  case 'F':  case 'G':  case 'H':
540                    case 'I':  case 'J':  case 'K':  case 'L':
541                    case 'M':  case 'N':  case 'O':  case 'P':
542                    case 'Q':  case 'R':  case 'S':  case 'T':
543                    case 'U':  case 'V':  case 'W':  case 'X':
544                    case 'Y':  case 'Z':
545                    {
546                            matchRange('A','Z');
547                            break;
548                    }
549                    case 'a':  case 'b':  case 'c':  case 'd':
550                    case 'e':  case 'f':  case 'g':  case 'h':
551                    case 'i':  case 'j':  case 'k':  case 'l':
552                    case 'm':  case 'n':  case 'o':  case 'p':
553                    case 'q':  case 'r':  case 's':  case 't':
554                    case 'u':  case 'v':  case 'w':  case 'x':
555                    case 'y':  case 'z':
556                    {
557                            matchRange('a','z');
558                            break;
559                    }
560                    default:
561                    {
562                            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
563                    }
564                    }
565                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
566                            _token = makeToken(_ttype);
567                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
568                    }
569                    _returnToken = _token;
570            }
571            
572            protected final void mINTEGER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
573                    int _ttype; Token _token=null; int _begin=text.length();
574                    _ttype = INTEGER;
575                    int _saveIndex;
576                    
577                    if (((LA(1) >= '1' && LA(1) <= '9')) && ((LA(2) >= '0' && LA(2) <= '9'))) {
578                            {
579                            mLDIGIT(false);
580                            {
581                            int _cnt406=0;
582                            _loop406:
583                            do {
584                                    if (((LA(1) >= '0' && LA(1) <= '9'))) {
585                                            mDIGIT(false);
586                                    }
587                                    else {
588                                            if ( _cnt406>=1 ) { break _loop406; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
589                                    }
590                                    
591                                    _cnt406++;
592                            } while (true);
593                            }
594                            }
595                    }
596                    else if (((LA(1) >= '0' && LA(1) <= '9')) && (true)) {
597                            mDIGIT(false);
598                    }
599                    else {
600                            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
601                    }
602                    
603                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
604                            _token = makeToken(_ttype);
605                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
606                    }
607                    _returnToken = _token;
608            }
609            
610            protected final void mHYPHEN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
611                    int _ttype; Token _token=null; int _begin=text.length();
612                    _ttype = HYPHEN;
613                    int _saveIndex;
614                    
615                    match('-');
616                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
617                            _token = makeToken(_ttype);
618                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
619                    }
620                    _returnToken = _token;
621            }
622            
623            protected final void mNUMERICOID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
624                    int _ttype; Token _token=null; int _begin=text.length();
625                    _ttype = NUMERICOID;
626                    int _saveIndex;
627                    
628                    mINTEGER(false);
629                    {
630                    int _cnt410=0;
631                    _loop410:
632                    do {
633                            if ((LA(1)=='.')) {
634                                    mDOT(false);
635                                    mINTEGER(false);
636                            }
637                            else {
638                                    if ( _cnt410>=1 ) { break _loop410; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
639                            }
640                            
641                            _cnt410++;
642                    } while (true);
643                    }
644                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
645                            _token = makeToken(_ttype);
646                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
647                    }
648                    _returnToken = _token;
649            }
650            
651            protected final void mDOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
652                    int _ttype; Token _token=null; int _begin=text.length();
653                    _ttype = DOT;
654                    int _saveIndex;
655                    
656                    match('.');
657                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
658                            _token = makeToken(_ttype);
659                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
660                    }
661                    _returnToken = _token;
662            }
663            
664            public final void mINTEGER_OR_NUMERICOID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
665                    int _ttype; Token _token=null; int _begin=text.length();
666                    _ttype = INTEGER_OR_NUMERICOID;
667                    int _saveIndex;
668                    
669                    boolean synPredMatched414 = false;
670                    if ((((LA(1) >= '0' && LA(1) <= '9')) && (_tokenSet_0.member(LA(2))))) {
671                            int _m414 = mark();
672                            synPredMatched414 = true;
673                            inputState.guessing++;
674                            try {
675                                    {
676                                    mINTEGER(false);
677                                    mDOT(false);
678                                    }
679                            }
680                            catch (RecognitionException pe) {
681                                    synPredMatched414 = false;
682                            }
683                            rewind(_m414);
684                            inputState.guessing--;
685                    }
686                    if ( synPredMatched414 ) {
687                            mNUMERICOID(false);
688                            if ( inputState.guessing==0 ) {
689                                    
690                                    _ttype =  NUMERICOID;
691                                    
692                            }
693                    }
694                    else if (((LA(1) >= '0' && LA(1) <= '9')) && (true)) {
695                            mINTEGER(false);
696                            if ( inputState.guessing==0 ) {
697                                    
698                                    _ttype =  INTEGER;
699                                    
700                            }
701                    }
702                    else {
703                            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
704                    }
705                    
706                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
707                            _token = makeToken(_ttype);
708                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
709                    }
710                    _returnToken = _token;
711            }
712            
713            public final void mSAFEUTF8STRING(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
714                    int _ttype; Token _token=null; int _begin=text.length();
715                    _ttype = SAFEUTF8STRING;
716                    int _saveIndex;
717                    
718                    _saveIndex=text.length();
719                    match('"');
720                    text.setLength(_saveIndex);
721                    {
722                    _loop417:
723                    do {
724                            if ((_tokenSet_1.member(LA(1)))) {
725                                    mSAFEUTF8CHAR(false);
726                            }
727                            else {
728                                    break _loop417;
729                            }
730                            
731                    } while (true);
732                    }
733                    _saveIndex=text.length();
734                    match('"');
735                    text.setLength(_saveIndex);
736                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
737                            _token = makeToken(_ttype);
738                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
739                    }
740                    _returnToken = _token;
741            }
742            
743            public final void mDESCR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
744                    int _ttype; Token _token=null; int _begin=text.length();
745                    _ttype = DESCR;
746                    int _saveIndex;
747                    
748                    boolean synPredMatched422 = false;
749                    if (((LA(1)=='a') && (LA(2)=='t'))) {
750                            int _m422 = mark();
751                            synPredMatched422 = true;
752                            inputState.guessing++;
753                            try {
754                                    {
755                                    match("attributeValue");
756                                    {
757                                    int _cnt421=0;
758                                    _loop421:
759                                    do {
760                                            if ((_tokenSet_2.member(LA(1)))) {
761                                                    _saveIndex=text.length();
762                                                    mSP(false);
763                                                    text.setLength(_saveIndex);
764                                            }
765                                            else {
766                                                    if ( _cnt421>=1 ) { break _loop421; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
767                                            }
768                                            
769                                            _cnt421++;
770                                    } while (true);
771                                    }
772                                    match('{');
773                                    }
774                            }
775                            catch (RecognitionException pe) {
776                                    synPredMatched422 = false;
777                            }
778                            rewind(_m422);
779                            inputState.guessing--;
780                    }
781                    if ( synPredMatched422 ) {
782                            _saveIndex=text.length();
783                            match("attributeValue");
784                            text.setLength(_saveIndex);
785                            {
786                            int _cnt424=0;
787                            _loop424:
788                            do {
789                                    if ((_tokenSet_2.member(LA(1)))) {
790                                            _saveIndex=text.length();
791                                            mSP(false);
792                                            text.setLength(_saveIndex);
793                                    }
794                                    else {
795                                            if ( _cnt424>=1 ) { break _loop424; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
796                                    }
797                                    
798                                    _cnt424++;
799                            } while (true);
800                            }
801                            _saveIndex=text.length();
802                            match('{');
803                            text.setLength(_saveIndex);
804                            {
805                            _loop426:
806                            do {
807                                    // nongreedy exit test
808                                    if ((LA(1)=='}') && (true)) break _loop426;
809                                    if ((_tokenSet_3.member(LA(1))) && (_tokenSet_3.member(LA(2)))) {
810                                            matchNot(EOF_CHAR);
811                                    }
812                                    else {
813                                            break _loop426;
814                                    }
815                                    
816                            } while (true);
817                            }
818                            _saveIndex=text.length();
819                            match('}');
820                            text.setLength(_saveIndex);
821                            if ( inputState.guessing==0 ) {
822                                    _ttype =  ATTRIBUTE_VALUE_CANDIDATE;
823                            }
824                    }
825                    else {
826                            boolean synPredMatched430 = false;
827                            if (((LA(1)=='r') && (LA(2)=='a'))) {
828                                    int _m430 = mark();
829                                    synPredMatched430 = true;
830                                    inputState.guessing++;
831                                    try {
832                                            {
833                                            match("rangeOfValues");
834                                            {
835                                            int _cnt429=0;
836                                            _loop429:
837                                            do {
838                                                    if ((_tokenSet_2.member(LA(1)))) {
839                                                            _saveIndex=text.length();
840                                                            mSP(false);
841                                                            text.setLength(_saveIndex);
842                                                    }
843                                                    else {
844                                                            if ( _cnt429>=1 ) { break _loop429; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
845                                                    }
846                                                    
847                                                    _cnt429++;
848                                            } while (true);
849                                            }
850                                            match('(');
851                                            }
852                                    }
853                                    catch (RecognitionException pe) {
854                                            synPredMatched430 = false;
855                                    }
856                                    rewind(_m430);
857                                    inputState.guessing--;
858                            }
859                            if ( synPredMatched430 ) {
860                                    _saveIndex=text.length();
861                                    match("rangeOfValues");
862                                    text.setLength(_saveIndex);
863                                    {
864                                    int _cnt432=0;
865                                    _loop432:
866                                    do {
867                                            if ((_tokenSet_2.member(LA(1)))) {
868                                                    _saveIndex=text.length();
869                                                    mSP(false);
870                                                    text.setLength(_saveIndex);
871                                            }
872                                            else {
873                                                    if ( _cnt432>=1 ) { break _loop432; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
874                                            }
875                                            
876                                            _cnt432++;
877                                    } while (true);
878                                    }
879                                    mFILTER(false);
880                                    if ( inputState.guessing==0 ) {
881                                            _ttype =  RANGE_OF_VALUES_CANDIDATE;
882                                    }
883                            }
884                            else if ((_tokenSet_4.member(LA(1))) && (true)) {
885                                    mALPHA(false);
886                                    {
887                                    _loop434:
888                                    do {
889                                            switch ( LA(1)) {
890                                            case 'A':  case 'B':  case 'C':  case 'D':
891                                            case 'E':  case 'F':  case 'G':  case 'H':
892                                            case 'I':  case 'J':  case 'K':  case 'L':
893                                            case 'M':  case 'N':  case 'O':  case 'P':
894                                            case 'Q':  case 'R':  case 'S':  case 'T':
895                                            case 'U':  case 'V':  case 'W':  case 'X':
896                                            case 'Y':  case 'Z':  case 'a':  case 'b':
897                                            case 'c':  case 'd':  case 'e':  case 'f':
898                                            case 'g':  case 'h':  case 'i':  case 'j':
899                                            case 'k':  case 'l':  case 'm':  case 'n':
900                                            case 'o':  case 'p':  case 'q':  case 'r':
901                                            case 's':  case 't':  case 'u':  case 'v':
902                                            case 'w':  case 'x':  case 'y':  case 'z':
903                                            {
904                                                    mALPHA(false);
905                                                    break;
906                                            }
907                                            case '0':  case '1':  case '2':  case '3':
908                                            case '4':  case '5':  case '6':  case '7':
909                                            case '8':  case '9':
910                                            {
911                                                    mDIGIT(false);
912                                                    break;
913                                            }
914                                            case '-':
915                                            {
916                                                    mHYPHEN(false);
917                                                    break;
918                                            }
919                                            default:
920                                            {
921                                                    break _loop434;
922                                            }
923                                            }
924                                    } while (true);
925                                    }
926                            }
927                            else {
928                                    throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
929                            }
930                            }
931                            if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
932                                    _token = makeToken(_ttype);
933                                    _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
934                            }
935                            _returnToken = _token;
936                    }
937                    
938            protected final void mFILTER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
939                    int _ttype; Token _token=null; int _begin=text.length();
940                    _ttype = FILTER;
941                    int _saveIndex;
942                    
943                    match('(');
944                    {
945                    switch ( LA(1)) {
946                    case '&':
947                    {
948                            {
949                            match('&');
950                            {
951                            _loop439:
952                            do {
953                                    if ((_tokenSet_2.member(LA(1)))) {
954                                            mSP(false);
955                                    }
956                                    else {
957                                            break _loop439;
958                                    }
959                                    
960                            } while (true);
961                            }
962                            {
963                            int _cnt441=0;
964                            _loop441:
965                            do {
966                                    if ((LA(1)=='(')) {
967                                            mFILTER(false);
968                                    }
969                                    else {
970                                            if ( _cnt441>=1 ) { break _loop441; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
971                                    }
972                                    
973                                    _cnt441++;
974                            } while (true);
975                            }
976                            }
977                            break;
978                    }
979                    case '|':
980                    {
981                            {
982                            match('|');
983                            {
984                            _loop444:
985                            do {
986                                    if ((_tokenSet_2.member(LA(1)))) {
987                                            mSP(false);
988                                    }
989                                    else {
990                                            break _loop444;
991                                    }
992                                    
993                            } while (true);
994                            }
995                            {
996                            int _cnt446=0;
997                            _loop446:
998                            do {
999                                    if ((LA(1)=='(')) {
1000                                            mFILTER(false);
1001                                    }
1002                                    else {
1003                                            if ( _cnt446>=1 ) { break _loop446; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
1004                                    }
1005                                    
1006                                    _cnt446++;
1007                            } while (true);
1008                            }
1009                            }
1010                            break;
1011                    }
1012                    case '!':
1013                    {
1014                            {
1015                            match('!');
1016                            {
1017                            _loop449:
1018                            do {
1019                                    if ((_tokenSet_2.member(LA(1)))) {
1020                                            mSP(false);
1021                                    }
1022                                    else {
1023                                            break _loop449;
1024                                    }
1025                                    
1026                            } while (true);
1027                            }
1028                            mFILTER(false);
1029                            }
1030                            break;
1031                    }
1032                    default:
1033                            if ((_tokenSet_5.member(LA(1)))) {
1034                                    mFILTER_VALUE(false);
1035                            }
1036                    else {
1037                            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1038                    }
1039                    }
1040                    }
1041                    match(')');
1042                    {
1043                    _loop451:
1044                    do {
1045                            if ((_tokenSet_2.member(LA(1)))) {
1046                                    mSP(false);
1047                            }
1048                            else {
1049                                    break _loop451;
1050                            }
1051                            
1052                    } while (true);
1053                    }
1054                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1055                            _token = makeToken(_ttype);
1056                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
1057                    }
1058                    _returnToken = _token;
1059            }
1060            
1061            protected final void mFILTER_VALUE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
1062                    int _ttype; Token _token=null; int _begin=text.length();
1063                    _ttype = FILTER_VALUE;
1064                    int _saveIndex;
1065                    
1066                    {
1067                    {
1068                    match(_tokenSet_5);
1069                    }
1070                    {
1071                    _loop457:
1072                    do {
1073                            if ((_tokenSet_6.member(LA(1)))) {
1074                                    {
1075                                    match(_tokenSet_6);
1076                                    }
1077                            }
1078                            else {
1079                                    break _loop457;
1080                            }
1081                            
1082                    } while (true);
1083                    }
1084                    }
1085                    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1086                            _token = makeToken(_ttype);
1087                            _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
1088                    }
1089                    _returnToken = _token;
1090            }
1091            
1092            
1093            private static final long[] mk_tokenSet_0() {
1094                    long[] data = new long[1025];
1095                    data[0]=288019269919178752L;
1096                    return data;
1097            }
1098            public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
1099            private static final long[] mk_tokenSet_1() {
1100                    long[] data = new long[3988];
1101                    data[0]=-17179869186L;
1102                    data[1]=-1L;
1103                    data[3]=-36028797027352577L;
1104                    for (int i = 4; i<=127; i++) { data[i]=-1L; }
1105                    for (int i = 193; i<=197; i++) { data[i]=-1L; }
1106                    data[198]=65535L;
1107                    for (int i = 204; i<=205; i++) { data[i]=-1L; }
1108                    for (int i = 208; i<=243; i++) { data[i]=-1L; }
1109                    data[244]=70368744177663L;
1110                    for (int i = 312; i<=639; i++) { data[i]=-1L; }
1111                    for (int i = 996; i<=1003; i++) { data[i]=-1L; }
1112                    return data;
1113            }
1114            public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
1115            private static final long[] mk_tokenSet_2() {
1116                    long[] data = new long[1025];
1117                    data[0]=4294977024L;
1118                    return data;
1119            }
1120            public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
1121            private static final long[] mk_tokenSet_3() {
1122                    long[] data = new long[2048];
1123                    data[0]=-2L;
1124                    for (int i = 1; i<=127; i++) { data[i]=-1L; }
1125                    for (int i = 193; i<=197; i++) { data[i]=-1L; }
1126                    data[198]=65535L;
1127                    for (int i = 204; i<=205; i++) { data[i]=-1L; }
1128                    for (int i = 208; i<=243; i++) { data[i]=-1L; }
1129                    data[244]=70368744177663L;
1130                    for (int i = 312; i<=639; i++) { data[i]=-1L; }
1131                    for (int i = 996; i<=1003; i++) { data[i]=-1L; }
1132                    return data;
1133            }
1134            public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
1135            private static final long[] mk_tokenSet_4() {
1136                    long[] data = new long[1025];
1137                    data[1]=576460743847706622L;
1138                    return data;
1139            }
1140            public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4());
1141            private static final long[] mk_tokenSet_5() {
1142                    long[] data = new long[2048];
1143                    data[0]=-3582002724866L;
1144                    data[1]=-1152921504606846977L;
1145                    for (int i = 2; i<=127; i++) { data[i]=-1L; }
1146                    for (int i = 193; i<=197; i++) { data[i]=-1L; }
1147                    data[198]=65535L;
1148                    for (int i = 204; i<=205; i++) { data[i]=-1L; }
1149                    for (int i = 208; i<=243; i++) { data[i]=-1L; }
1150                    data[244]=70368744177663L;
1151                    for (int i = 312; i<=639; i++) { data[i]=-1L; }
1152                    for (int i = 996; i<=1003; i++) { data[i]=-1L; }
1153                    return data;
1154            }
1155            public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5());
1156            private static final long[] mk_tokenSet_6() {
1157                    long[] data = new long[2048];
1158                    data[0]=-2199023255554L;
1159                    for (int i = 1; i<=127; i++) { data[i]=-1L; }
1160                    for (int i = 193; i<=197; i++) { data[i]=-1L; }
1161                    data[198]=65535L;
1162                    for (int i = 204; i<=205; i++) { data[i]=-1L; }
1163                    for (int i = 208; i<=243; i++) { data[i]=-1L; }
1164                    data[244]=70368744177663L;
1165                    for (int i = 312; i<=639; i++) { data[i]=-1L; }
1166                    for (int i = 996; i<=1003; i++) { data[i]=-1L; }
1167                    return data;
1168            }
1169            public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6());
1170            
1171            }