synPredMatched27 = false; } rewind(_m27);
synPredMatched369 = false; } rewind(_m369);
	public final void document_function(		PathExpr expr	) throws RecognitionException, TokenStreamException, PermissionDeniedException,EXistException {				Token  arg3 = null;		Token  arg1 = null;		Token  arg2 = null;		Token  arg4 = null;					Expression step = null;			boolean inclusive = true;						switch ( LA(1)) {		case LITERAL_doctype:		{			match(LITERAL_doctype);			match(LPAREN);			arg3 = LT(1);			match(CONST);			match(RPAREN);			if ( inputState.guessing==0 ) {								DBBroker broker = null;				try {				broker = pool.get();				includeDocs = broker.getDocumentsByDoctype(user, arg3.getText());				step = new RootNode(pool);				expr.add(step);				expr.setDocumentSet(includeDocs);				} catch(EXistException e) {				e.printStackTrace();				} finally {				pool.release( broker );				}								}			break;		}		case LITERAL_collection:		{			match(LITERAL_collection);			match(LPAREN);			arg4 = LT(1);			match(CONST);			{			_loop32:			do {				if ((LA(1)==COMMA)) {					match(COMMA);					{					switch ( LA(1)) {					case LITERAL_false:					{						match(LITERAL_false);						if ( inputState.guessing==0 ) {							inclusive = false;						}						break;					}					case LITERAL_true:					{						match(LITERAL_true);						if ( inputState.guessing==0 ) {							inclusive = true;						}						break;					}					default:					{						throw new NoViableAltException(LT(1), getFilename());					}					}					}				}				else {					break _loop32;				}							} while (true);			}			match(RPAREN);			if ( inputState.guessing==0 ) {								DBBroker broker = null;				try {				broker = pool.get();				includeDocs = broker.getDocumentsByCollection(user, arg4.getText(), inclusive);								step = new RootNode(pool);				expr.setDocumentSet(includeDocs);				expr.add(step);				} catch(EXistException e) {				e.printStackTrace();				} finally {				pool.release( broker );				}								}			break;		}		default:			boolean synPredMatched27 = false;			if (((LA(1)==LITERAL_document) && (LA(2)==LPAREN))) {				int _m27 = mark();				synPredMatched27 = true;				inputState.guessing++;				try {					{					match(LITERAL_document);					match(LPAREN);					match(STAR);					}				}				catch (RecognitionException pe) {					synPredMatched27 = false;				}				rewind(_m27);				inputState.guessing--;			}			if ( synPredMatched27 ) {				match(LITERAL_document);				match(LPAREN);				match(STAR);				match(RPAREN);				if ( inputState.guessing==0 ) {										DBBroker broker = null;					try {					broker = pool.get();					includeDocs = broker.getAllDocuments(user);					step = new RootNode(pool);					expr.setDocumentSet(includeDocs);					expr.add(step);					} catch(EXistException e) {					e.printStackTrace();					} finally {					pool.release( broker );					}										}			}			else if ((LA(1)==LITERAL_document) && (LA(2)==LPAREN)) {				match(LITERAL_document);				match(LPAREN);				arg1 = LT(1);				match(CONST);				if ( inputState.guessing==0 ) {										DBBroker broker = null;					try {					broker = pool.get();					step = new RootNode(pool);					expr.add(step);					DocumentImpl doc = (DocumentImpl)broker.getDocument(user, arg1.getText());					if(doc != null) {					expr.addDocument(doc);					includeDocs.add(doc);					}					} catch(EXistException e) {					e.printStackTrace();					} finally {					pool.release( broker );					}										}				{				_loop29:				do {					if ((LA(1)==COMMA)) {						match(COMMA);						arg2 = LT(1);						match(CONST);						if ( inputState.guessing==0 ) {														DBBroker broker = null;							try {							broker = pool.get();							DocumentImpl doc = (DocumentImpl)broker.getDocument(arg2.getText());							if(doc != null) {							expr.addDocument(doc);							includeDocs.add(doc);							}							} catch(EXistException e) {							e.printStackTrace();							} finally {							pool.release( broker );							}														}					}					else {						break _loop29;					}									} while (true);				}				match(RPAREN);			}		else {			throw new NoViableAltException(LT(1), getFilename());		}		}	}