AST __t188 = _t;
AST __t189 = _t;
	public final Expression  constructor(AST _t,		PathExpr path	) throws RecognitionException, PermissionDeniedException,EXistException,XPathException {		Expression step;				org.exist.xquery.parser.XQueryAST constructor_AST_in = (_t == ASTNULL) ? null : (org.exist.xquery.parser.XQueryAST)_t;		org.exist.xquery.parser.XQueryAST qn = null;		org.exist.xquery.parser.XQueryAST prefix = null;		org.exist.xquery.parser.XQueryAST uri = null;		org.exist.xquery.parser.XQueryAST attr = null;		org.exist.xquery.parser.XQueryAST pid = null;		org.exist.xquery.parser.XQueryAST e = null;		org.exist.xquery.parser.XQueryAST attrName = null;		org.exist.xquery.parser.XQueryAST attrVal = null;		org.exist.xquery.parser.XQueryAST pcdata = null;		org.exist.xquery.parser.XQueryAST t = null;		org.exist.xquery.parser.XQueryAST tc = null;		org.exist.xquery.parser.XQueryAST d = null;		org.exist.xquery.parser.XQueryAST cdata = null;		org.exist.xquery.parser.XQueryAST p = null;		org.exist.xquery.parser.XQueryAST cdataSect = null;		org.exist.xquery.parser.XQueryAST l = null;					step= null;			PathExpr elementContent= null;			Expression contentExpr= null;			Expression qnameExpr = null;						if (_t==null) _t=ASTNULL;		switch ( _t.getType()) {		case COMP_ELEM_CONSTRUCTOR:		{			AST __t184 = _t;			qn = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;			match(_t,COMP_ELEM_CONSTRUCTOR);			_t = _t.getFirstChild();									ElementConstructor c= new ElementConstructor(context);						c.setASTNode(qn);						step= c;						SequenceConstructor construct = new SequenceConstructor(context);						EnclosedExpr enclosed = new EnclosedExpr(context);						enclosed.addPath(construct);						c.setContent(enclosed);						PathExpr qnamePathExpr = new PathExpr(context);						c.setNameExpr(qnamePathExpr);								qnameExpr=expr(_t,qnamePathExpr);			_t = _retTree;			{			_loop187:			do {				if (_t==null) _t=ASTNULL;				switch ( _t.getType()) {				case COMP_NS_CONSTRUCTOR:				{					AST __t186 = _t;					prefix = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;					match(_t,COMP_NS_CONSTRUCTOR);					_t = _t.getFirstChild();					uri = (org.exist.xquery.parser.XQueryAST)_t;					match(_t,STRING_LITERAL);					_t = _t.getNextSibling();					_t = __t186;					_t = _t.getNextSibling();														c.addNamespaceDecl(prefix.getText(), uri.getText());													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 142:				case SELF:				case XML_COMMENT:				case XML_PI:				case AT:				case PARENT:				case LITERAL_child:				case LITERAL_self:				case LITERAL_descendant:				case 154:				case 155:				case LITERAL_following:				case LITERAL_parent:				case LITERAL_ancestor:				case 159:				case 160:				case DOUBLE_LITERAL:				case DECIMAL_LITERAL:				case INTEGER_LITERAL:				case XML_CDATA:				case LITERAL_preceding:				{					elementContent = new PathExpr(context);					contentExpr=expr(_t,elementContent);					_t = _retTree;					construct.addPath(elementContent);					break;				}				default:				{					break _loop187;				}				}			} while (true);			}			_t = __t184;			_t = _t.getNextSibling();			break;		}		case COMP_ATTR_CONSTRUCTOR:		{			AST __t188 = _t;			attr = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;			match(_t,COMP_ATTR_CONSTRUCTOR);			_t = _t.getFirstChild();									DynamicAttributeConstructor a= new DynamicAttributeConstructor(context);			a.setASTNode(attr);			step = a;			PathExpr qnamePathExpr = new PathExpr(context);			a.setNameExpr(qnamePathExpr);			elementContent = new PathExpr(context);			a.setContentExpr(elementContent);								qnameExpr=expr(_t,qnamePathExpr);			_t = _retTree;			contentExpr=expr(_t,elementContent);			_t = _retTree;			_t = __t188;			_t = _t.getNextSibling();			break;		}		case COMP_PI_CONSTRUCTOR:		{			AST __t189 = _t;			pid = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;			match(_t,COMP_PI_CONSTRUCTOR);			_t = _t.getFirstChild();									DynamicPIConstructor pd= new DynamicPIConstructor(context);			pd.setASTNode(pid);			step = pd;			PathExpr qnamePathExpr = new PathExpr(context);			pd.setNameExpr(qnamePathExpr);			elementContent = new PathExpr(context);			pd.setContentExpr(elementContent);								qnameExpr=expr(_t,qnamePathExpr);			_t = _retTree;			contentExpr=expr(_t,elementContent);			_t = _retTree;			_t = __t189;			_t = _t.getNextSibling();			break;		}		case ELEMENT:		{			AST __t190 = _t;			e = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;			match(_t,ELEMENT);			_t = _t.getFirstChild();									ElementConstructor c= new ElementConstructor(context, e.getText());						c.setASTNode(e);						step= c;								{			_loop196:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==ATTRIBUTE)) {					AST __t192 = _t;					attrName = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;					match(_t,ATTRIBUTE);					_t = _t.getFirstChild();															AttributeConstructor attrib= new AttributeConstructor(context, attrName.getText());					attrib.setASTNode(attrName);														{					int _cnt195=0;					_loop195:					do {						if (_t==null) _t=ASTNULL;						switch ( _t.getType()) {						case ATTRIBUTE_CONTENT:						{							attrVal = (org.exist.xquery.parser.XQueryAST)_t;							match(_t,ATTRIBUTE_CONTENT);							_t = _t.getNextSibling();																				attrib.addValue(attrVal.getText()); 																			break;						}						case LCURLY:						{							AST __t194 = _t;							org.exist.xquery.parser.XQueryAST tmp82_AST_in = (org.exist.xquery.parser.XQueryAST)_t;							match(_t,LCURLY);							_t = _t.getFirstChild();							PathExpr enclosed= new PathExpr(context);							expr(_t,enclosed);							_t = _retTree;							attrib.addEnclosedExpr(enclosed);							_t = __t194;							_t = _t.getNextSibling();							break;						}						default:						{							if ( _cnt195>=1 ) { break _loop195; } else {throw new NoViableAltException(_t);}						}						}						_cnt195++;					} while (true);					}					c.addAttribute(attrib);					_t = __t192;					_t = _t.getNextSibling();				}				else {					break _loop196;				}							} while (true);			}			{			_loop198:			do {				if (_t==null) _t=ASTNULL;				if ((_tokenSet_1.member(_t.getType()))) {														if (elementContent == null) {										elementContent= new PathExpr(context);										c.setContent(elementContent);									}													contentExpr=constructor(_t,elementContent);					_t = _retTree;					elementContent.add(contentExpr);				}				else {					break _loop198;				}							} while (true);			}			_t = __t190;			_t = _t.getNextSibling();			break;		}		case TEXT:		{			AST __t199 = _t;			pcdata = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;			match(_t,TEXT);			_t = _t.getFirstChild();									TextConstructor text= new TextConstructor(context, pcdata.getText());			text.setASTNode(pcdata);						step= text;								_t = __t199;			_t = _t.getNextSibling();			break;		}		case COMP_TEXT_CONSTRUCTOR:		{			AST __t200 = _t;			t = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;			match(_t,COMP_TEXT_CONSTRUCTOR);			_t = _t.getFirstChild();									elementContent = new PathExpr(context);						DynamicTextConstructor text = new DynamicTextConstructor(context, elementContent);						text.setASTNode(t);						step= text;								contentExpr=expr(_t,elementContent);			_t = _retTree;			_t = __t200;			_t = _t.getNextSibling();			break;		}		case COMP_COMMENT_CONSTRUCTOR:		{			AST __t201 = _t;			tc = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;			match(_t,COMP_COMMENT_CONSTRUCTOR);			_t = _t.getFirstChild();									elementContent = new PathExpr(context);						DynamicCommentConstructor comment = new DynamicCommentConstructor(context, elementContent);						comment.setASTNode(t);						step= comment;								contentExpr=expr(_t,elementContent);			_t = _retTree;			_t = __t201;			_t = _t.getNextSibling();			break;		}		case COMP_DOC_CONSTRUCTOR:		{			AST __t202 = _t;			d = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;			match(_t,COMP_DOC_CONSTRUCTOR);			_t = _t.getFirstChild();									elementContent = new PathExpr(context);						DocumentConstructor doc = new DocumentConstructor(context, elementContent);						doc.setASTNode(d);						step= doc;								contentExpr=expr(_t,elementContent);			_t = _retTree;			_t = __t202;			_t = _t.getNextSibling();			break;		}		case XML_COMMENT:		{			AST __t203 = _t;			cdata = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;			match(_t,XML_COMMENT);			_t = _t.getFirstChild();									CommentConstructor comment= new CommentConstructor(context, cdata.getText());			comment.setASTNode(cdata);						step= comment;								_t = __t203;			_t = _t.getNextSibling();			break;		}		case XML_PI:		{			AST __t204 = _t;			p = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;			match(_t,XML_PI);			_t = _t.getFirstChild();									PIConstructor pi= new PIConstructor(context, p.getText());			pi.setASTNode(p);						step= pi;								_t = __t204;			_t = _t.getNextSibling();			break;		}		case XML_CDATA:		{			AST __t205 = _t;			cdataSect = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;			match(_t,XML_CDATA);			_t = _t.getFirstChild();									CDATAConstructor cd = new CDATAConstructor(context, cdataSect.getText());						cd.setASTNode(cdataSect);						step= cd;								_t = __t205;			_t = _t.getNextSibling();			break;		}		case LCURLY:		{			AST __t206 = _t;			l = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;			match(_t,LCURLY);			_t = _t.getFirstChild();						EnclosedExpr subexpr= new EnclosedExpr(context); 			subexpr.setASTNode(l);						step=expr(_t,subexpr);			_t = _retTree;			step= subexpr;			_t = __t206;			_t = _t.getNextSibling();			break;		}		default:		{			throw new NoViableAltException(_t);		}		}		_retTree = _t;		return step;	}