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