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