_t = __t19;
_t = __t20;
	public final void prolog(AST _t,		PathExpr path	) throws RecognitionException, PermissionDeniedException,EXistException,XPathException {				org.exist.xquery.parser.XQueryAST prolog_AST_in = (_t == ASTNULL) ? null : (org.exist.xquery.parser.XQueryAST)_t;		org.exist.xquery.parser.XQueryAST v = null;		org.exist.xquery.parser.XQueryAST prefix = null;		org.exist.xquery.parser.XQueryAST uri = null;		org.exist.xquery.parser.XQueryAST defu = null;		org.exist.xquery.parser.XQueryAST deff = null;		org.exist.xquery.parser.XQueryAST defc = null;		org.exist.xquery.parser.XQueryAST qname = null;		org.exist.xquery.parser.XQueryAST e = null;		org.exist.xquery.parser.XQueryAST i = null;		org.exist.xquery.parser.XQueryAST pfx = null;		org.exist.xquery.parser.XQueryAST moduleURI = null;		org.exist.xquery.parser.XQueryAST at = null;		Expression step = null;				{		if (_t==null) _t=ASTNULL;		switch ( _t.getType()) {		case VERSION_DECL:		{			AST __t9 = _t;			v = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;			match(_t,VERSION_DECL);			_t = _t.getFirstChild();										if (!v.getText().equals("1.0"))								throw new XPathException(v, "Wrong XQuery version: require 1.0");									_t = __t9;			_t = _t.getNextSibling();			break;		}		case 3:		case QNAME:		case PARENTHESIZED:		case ABSOLUTE_SLASH:		case ABSOLUTE_DSLASH:		case WILDCARD:		case PREFIX_WILDCARD:		case FUNCTION:		case UNARY_MINUS:		case UNARY_PLUS:		case VARIABLE_REF:		case ELEMENT:		case TEXT:		case NAMESPACE_DECL:		case DEF_NAMESPACE_DECL:		case DEF_COLLATION_DECL:		case DEF_FUNCTION_NS_DECL:		case GLOBAL_VAR:		case FUNCTION_DECL:		case BEFORE:		case AFTER:		case ATTRIBUTE_TEST:		case COMP_ELEM_CONSTRUCTOR:		case COMP_ATTR_CONSTRUCTOR:		case COMP_TEXT_CONSTRUCTOR:		case COMP_COMMENT_CONSTRUCTOR:		case COMP_PI_CONSTRUCTOR:		case COMP_DOC_CONSTRUCTOR:		case NCNAME:		case EQ:		case STRING_LITERAL:		case LITERAL_import:		case LITERAL_xmlspace:		case LITERAL_ordering:		case LITERAL_construction:		case LITERAL_element:		case LCURLY:		case COMMA:		case STAR:		case PLUS:		case LITERAL_some:		case LITERAL_every:		case LITERAL_if:		case LITERAL_return:		case LITERAL_or:		case LITERAL_and:		case LITERAL_instance:		case LITERAL_castable:		case LITERAL_cast:		case LT:		case GT:		case LITERAL_eq:		case LITERAL_ne:		case LITERAL_lt:		case LITERAL_le:		case LITERAL_gt:		case LITERAL_ge:		case NEQ:		case GTEQ:		case LTEQ:		case LITERAL_is:		case LITERAL_isnot:		case ANDEQ:		case OREQ:		case LITERAL_to:		case MINUS:		case LITERAL_div:		case LITERAL_idiv:		case LITERAL_mod:		case UNION:		case LITERAL_intersect:		case LITERAL_except:		case SLASH:		case DSLASH:		case LITERAL_text:		case LITERAL_node:		case LITERAL_attribute:		case LITERAL_comment:		case 140:		case SELF:		case XML_COMMENT:		case XML_PI:		case AT:		case PARENT:		case LITERAL_child:		case LITERAL_self:		case LITERAL_descendant:		case 152:		case 153:		case LITERAL_following:		case LITERAL_parent:		case LITERAL_ancestor:		case 157:		case 158:		case DOUBLE_LITERAL:		case DECIMAL_LITERAL:		case INTEGER_LITERAL:		case XML_CDATA:		case LITERAL_preceding:		{			break;		}		default:		{			throw new NoViableAltException(_t);		}		}		}		{		_loop27:		do {			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case NAMESPACE_DECL:			{				AST __t11 = _t;				prefix = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;				match(_t,NAMESPACE_DECL);				_t = _t.getFirstChild();				uri = (org.exist.xquery.parser.XQueryAST)_t;				match(_t,STRING_LITERAL);				_t = _t.getNextSibling();				context.declareNamespace(prefix.getText(), uri.getText());				_t = __t11;				_t = _t.getNextSibling();				break;			}			case LITERAL_xmlspace:			{				AST __t12 = _t;				org.exist.xquery.parser.XQueryAST tmp25_AST_in = (org.exist.xquery.parser.XQueryAST)_t;				match(_t,LITERAL_xmlspace);				_t = _t.getFirstChild();				{				if (_t==null) _t=ASTNULL;				switch ( _t.getType()) {				case LITERAL_preserve:				{					org.exist.xquery.parser.XQueryAST tmp26_AST_in = (org.exist.xquery.parser.XQueryAST)_t;					match(_t,LITERAL_preserve);					_t = _t.getNextSibling();					context.setStripWhitespace(false);					break;				}				case LITERAL_strip:				{					org.exist.xquery.parser.XQueryAST tmp27_AST_in = (org.exist.xquery.parser.XQueryAST)_t;					match(_t,LITERAL_strip);					_t = _t.getNextSibling();					context.setStripWhitespace(true);					break;				}				default:				{					throw new NoViableAltException(_t);				}				}				}				_t = __t12;				_t = _t.getNextSibling();				break;			}			case LITERAL_ordering:			{				AST __t14 = _t;				org.exist.xquery.parser.XQueryAST tmp28_AST_in = (org.exist.xquery.parser.XQueryAST)_t;				match(_t,LITERAL_ordering);				_t = _t.getFirstChild();				{				if (_t==null) _t=ASTNULL;				switch ( _t.getType()) {				case LITERAL_ordered:				{					org.exist.xquery.parser.XQueryAST tmp29_AST_in = (org.exist.xquery.parser.XQueryAST)_t;					match(_t,LITERAL_ordered);					_t = _t.getNextSibling();					break;				}				case LITERAL_unordered:				{					org.exist.xquery.parser.XQueryAST tmp30_AST_in = (org.exist.xquery.parser.XQueryAST)_t;					match(_t,LITERAL_unordered);					_t = _t.getNextSibling();					break;				}				default:				{					throw new NoViableAltException(_t);				}				}				}				_t = __t14;				_t = _t.getNextSibling();				break;			}			case LITERAL_construction:			{				AST __t16 = _t;				org.exist.xquery.parser.XQueryAST tmp31_AST_in = (org.exist.xquery.parser.XQueryAST)_t;				match(_t,LITERAL_construction);				_t = _t.getFirstChild();				{				if (_t==null) _t=ASTNULL;				switch ( _t.getType()) {				case LITERAL_preserve:				{					org.exist.xquery.parser.XQueryAST tmp32_AST_in = (org.exist.xquery.parser.XQueryAST)_t;					match(_t,LITERAL_preserve);					_t = _t.getNextSibling();					break;				}				case LITERAL_strip:				{					org.exist.xquery.parser.XQueryAST tmp33_AST_in = (org.exist.xquery.parser.XQueryAST)_t;					match(_t,LITERAL_strip);					_t = _t.getNextSibling();					break;				}				default:				{					throw new NoViableAltException(_t);				}				}				}				_t = __t16;				_t = _t.getNextSibling();				break;			}			case DEF_NAMESPACE_DECL:			{				AST __t18 = _t;				org.exist.xquery.parser.XQueryAST tmp34_AST_in = (org.exist.xquery.parser.XQueryAST)_t;				match(_t,DEF_NAMESPACE_DECL);				_t = _t.getFirstChild();				defu = (org.exist.xquery.parser.XQueryAST)_t;				match(_t,STRING_LITERAL);				_t = _t.getNextSibling();				context.declareNamespace("", defu.getText());				_t = __t18;				_t = _t.getNextSibling();				break;			}			case DEF_FUNCTION_NS_DECL:			{				AST __t19 = _t;				org.exist.xquery.parser.XQueryAST tmp35_AST_in = (org.exist.xquery.parser.XQueryAST)_t;				match(_t,DEF_FUNCTION_NS_DECL);				_t = _t.getFirstChild();				deff = (org.exist.xquery.parser.XQueryAST)_t;				match(_t,STRING_LITERAL);				_t = _t.getNextSibling();				context.setDefaultFunctionNamespace(deff.getText());				_t = __t19;				_t = _t.getNextSibling();				break;			}			case DEF_COLLATION_DECL:			{				AST __t20 = _t;				org.exist.xquery.parser.XQueryAST tmp36_AST_in = (org.exist.xquery.parser.XQueryAST)_t;				match(_t,DEF_COLLATION_DECL);				_t = _t.getFirstChild();				defc = (org.exist.xquery.parser.XQueryAST)_t;				match(_t,STRING_LITERAL);				_t = _t.getNextSibling();				context.setDefaultCollation(defc.getText());				_t = __t20;				_t = _t.getNextSibling();				break;			}			case GLOBAL_VAR:			{				AST __t21 = _t;				qname = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;				match(_t,GLOBAL_VAR);				_t = _t.getFirstChild();												PathExpr enclosed= new PathExpr(context);								SequenceType type= null;											{				if (_t==null) _t=ASTNULL;				switch ( _t.getType()) {				case LITERAL_as:				{					AST __t23 = _t;					org.exist.xquery.parser.XQueryAST tmp37_AST_in = (org.exist.xquery.parser.XQueryAST)_t;					match(_t,LITERAL_as);					_t = _t.getFirstChild();					type= new SequenceType();					sequenceType(_t,type);					_t = _retTree;					_t = __t23;					_t = _t.getNextSibling();					break;				}				case QNAME:				case PARENTHESIZED:				case ABSOLUTE_SLASH:				case ABSOLUTE_DSLASH:				case WILDCARD:				case PREFIX_WILDCARD:				case FUNCTION:				case UNARY_MINUS:				case UNARY_PLUS:				case VARIABLE_REF:				case ELEMENT:				case TEXT:				case BEFORE:				case AFTER:				case ATTRIBUTE_TEST:				case COMP_ELEM_CONSTRUCTOR:				case COMP_ATTR_CONSTRUCTOR:				case COMP_TEXT_CONSTRUCTOR:				case COMP_COMMENT_CONSTRUCTOR:				case COMP_PI_CONSTRUCTOR:				case COMP_DOC_CONSTRUCTOR:				case NCNAME:				case EQ:				case STRING_LITERAL:				case LITERAL_element:				case LCURLY:				case COMMA:				case STAR:				case PLUS:				case LITERAL_some:				case LITERAL_every:				case LITERAL_if:				case LITERAL_return:				case LITERAL_or:				case LITERAL_and:				case LITERAL_instance:				case LITERAL_castable:				case LITERAL_cast:				case LT:				case GT:				case LITERAL_eq:				case LITERAL_ne:				case LITERAL_lt:				case LITERAL_le:				case LITERAL_gt:				case LITERAL_ge:				case NEQ:				case GTEQ:				case LTEQ:				case LITERAL_is:				case LITERAL_isnot:				case ANDEQ:				case OREQ:				case LITERAL_to:				case MINUS:				case LITERAL_div:				case LITERAL_idiv:				case LITERAL_mod:				case UNION:				case LITERAL_intersect:				case LITERAL_except:				case SLASH:				case DSLASH:				case LITERAL_text:				case LITERAL_node:				case LITERAL_attribute:				case LITERAL_comment:				case 140:				case SELF:				case XML_COMMENT:				case XML_PI:				case AT:				case PARENT:				case LITERAL_child:				case LITERAL_self:				case LITERAL_descendant:				case 152:				case 153:				case LITERAL_following:				case LITERAL_parent:				case LITERAL_ancestor:				case 157:				case 158:				case DOUBLE_LITERAL:				case DECIMAL_LITERAL:				case INTEGER_LITERAL:				case XML_CDATA:				case LITERAL_preceding:				{					break;				}				default:				{					throw new NoViableAltException(_t);				}				}				}				e = _t==ASTNULL ? null : (org.exist.xquery.parser.XQueryAST)_t;				step=expr(_t,enclosed);				_t = _retTree;												VariableDeclaration decl= new VariableDeclaration(context, qname.getText(), enclosed);								decl.setSequenceType(type);								decl.setASTNode(e);								path.add(decl);								if(myModule != null) {									QName qn = QName.parse(context, qname.getText());									myModule.declareVariable(qn, decl);								}											_t = __t21;				_t = _t.getNextSibling();				break;			}			case FUNCTION_DECL:			{				functionDecl(_t,path);				_t = _retTree;				break;			}			case LITERAL_import:			{				AST __t24 = _t;				i = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;				match(_t,LITERAL_import);				_t = _t.getFirstChild();												String modulePrefix = null;								String location = null;											{				if (_t==null) _t=ASTNULL;				switch ( _t.getType()) {				case NCNAME:				{					pfx = (org.exist.xquery.parser.XQueryAST)_t;					match(_t,NCNAME);					_t = _t.getNextSibling();					modulePrefix = pfx.getText();					break;				}				case STRING_LITERAL:				{					break;				}				default:				{					throw new NoViableAltException(_t);				}				}				}				moduleURI = (org.exist.xquery.parser.XQueryAST)_t;				match(_t,STRING_LITERAL);				_t = _t.getNextSibling();				{				if (_t==null) _t=ASTNULL;				switch ( _t.getType()) {				case STRING_LITERAL:				{					at = (org.exist.xquery.parser.XQueryAST)_t;					match(_t,STRING_LITERAL);					_t = _t.getNextSibling();					location = at.getText();					break;				}				case 3:				{					break;				}				default:				{					throw new NoViableAltException(_t);				}				}				}										                try {									context.importModule(moduleURI.getText(), modulePrefix, location);						                } catch(XPathException xpe) {						                    xpe.prependMessage("error found while loading module " + modulePrefix + ": ");						                    throw xpe;						                }											_t = __t24;				_t = _t.getNextSibling();				break;			}			default:			{				break _loop27;			}			}		} while (true);		}		_retTree = _t;	}