_t = __t265;
_t = __t268;
	public final void expr(AST _t,		PathExpr path	) throws RecognitionException, PermissionDeniedException,EXistException,XPathException {				AST expr_AST_in = (AST)_t;		AST varName = null;		AST letVarName = null;		Expression step= null;				if (_t==null) _t=ASTNULL;		switch ( _t.getType()) {		case COMMA:		{			AST __t241 = _t;			AST tmp3_AST_in = (AST)_t;			match(_t,COMMA);			_t = _t.getFirstChild();									PathExpr left= new PathExpr(context);						PathExpr right= new PathExpr(context);								expr(_t,left);			_t = _retTree;			expr(_t,right);			_t = _retTree;									SequenceConstructor sc = new SequenceConstructor(context);						sc.addExpression(left);						sc.addExpression(right);						path.add(sc);								_t = __t241;			_t = _t.getNextSibling();			break;		}		case LITERAL_if:		{			AST __t242 = _t;			AST tmp4_AST_in = (AST)_t;			match(_t,LITERAL_if);			_t = _t.getFirstChild();									PathExpr testExpr = new PathExpr(context);						PathExpr thenExpr = new PathExpr(context);						PathExpr elseExpr = new PathExpr(context);								expr(_t,testExpr);			_t = _retTree;			expr(_t,thenExpr);			_t = _retTree;			expr(_t,elseExpr);			_t = _retTree;									ConditionalExpression cond = 							new ConditionalExpression(context, testExpr, thenExpr, elseExpr);						path.add(cond);								_t = __t242;			_t = _t.getNextSibling();			break;		}		case LITERAL_return:		{			AST __t243 = _t;			AST tmp5_AST_in = (AST)_t;			match(_t,LITERAL_return);			_t = _t.getFirstChild();									List clauses= new ArrayList();						Expression action= new PathExpr(context);						PathExpr whereExpr= null;						List orderBy = null;								{			int _cnt253=0;			_loop253:			do {				if (_t==null) _t=ASTNULL;				switch ( _t.getType()) {				case LITERAL_for:				{					AST __t245 = _t;					AST tmp6_AST_in = (AST)_t;					match(_t,LITERAL_for);					_t = _t.getFirstChild();					{					int _cnt248=0;					_loop248:					do {						if (_t==null) _t=ASTNULL;						if ((_t.getType()==VARIABLE_BINDING)) {							AST __t247 = _t;							varName = _t==ASTNULL ? null :(AST)_t;							match(_t,VARIABLE_BINDING);							_t = _t.getFirstChild();																					ForLetClause clause= new ForLetClause();														PathExpr inputSequence= new PathExpr(context);																				expr(_t,inputSequence);							_t = _retTree;																					clause.varName= varName.getText();														clause.inputSequence= inputSequence;														clauses.add(clause);																				_t = __t247;							_t = _t.getNextSibling();						}						else {							if ( _cnt248>=1 ) { break _loop248; } else {throw new NoViableAltException(_t);}						}												_cnt248++;					} while (true);					}					_t = __t245;					_t = _t.getNextSibling();					break;				}				case LITERAL_let:				{					AST __t249 = _t;					AST tmp7_AST_in = (AST)_t;					match(_t,LITERAL_let);					_t = _t.getFirstChild();					{					int _cnt252=0;					_loop252:					do {						if (_t==null) _t=ASTNULL;						if ((_t.getType()==VARIABLE_BINDING)) {							AST __t251 = _t;							letVarName = _t==ASTNULL ? null :(AST)_t;							match(_t,VARIABLE_BINDING);							_t = _t.getFirstChild();																					ForLetClause clause= new ForLetClause();														clause.isForClause= false;														PathExpr inputSequence= new PathExpr(context);																				expr(_t,inputSequence);							_t = _retTree;																					clause.varName= letVarName.getText();														clause.inputSequence= inputSequence;														clauses.add(clause);																				_t = __t251;							_t = _t.getNextSibling();						}						else {							if ( _cnt252>=1 ) { break _loop252; } else {throw new NoViableAltException(_t);}						}												_cnt252++;					} while (true);					}					_t = __t249;					_t = _t.getNextSibling();					break;				}				default:				{					if ( _cnt253>=1 ) { break _loop253; } else {throw new NoViableAltException(_t);}				}				}				_cnt253++;			} while (true);			}			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case ORDER_BY:			{				AST __t255 = _t;				AST tmp8_AST_in = (AST)_t;				match(_t,ORDER_BY);				_t = _t.getFirstChild();				orderBy = new ArrayList(3);				{				int _cnt261=0;				_loop261:				do {					if (_t==null) _t=ASTNULL;					if ((_tokenSet_0.member(_t.getType()))) {																		PathExpr orderSpecExpr = new PathExpr(context); 																	expr(_t,orderSpecExpr);						_t = _retTree;																		OrderSpec orderSpec = new OrderSpec(orderSpecExpr);												int modifiers = 0;												orderBy.add(orderSpec);																	{						if (_t==null) _t=ASTNULL;						switch ( _t.getType()) {						case LITERAL_ascending:						case LITERAL_descending:						{							{							if (_t==null) _t=ASTNULL;							switch ( _t.getType()) {							case LITERAL_ascending:							{								AST tmp9_AST_in = (AST)_t;								match(_t,LITERAL_ascending);								_t = _t.getNextSibling();								break;							}							case LITERAL_descending:							{								AST tmp10_AST_in = (AST)_t;								match(_t,LITERAL_descending);								_t = _t.getNextSibling();																								modifiers = OrderSpec.DESCENDING_ORDER;																orderSpec.setModifiers(modifiers);																							break;							}							default:							{								throw new NoViableAltException(_t);							}							}							}							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 NCNAME:						case STRING_LITERAL:						case EQ:						case LCURLY:						case COMMA:						case LITERAL_empty:						case STAR:						case PLUS:						case LITERAL_if:						case LITERAL_return:						case LITERAL_or:						case LITERAL_and:						case NEQ:						case GT:						case GTEQ:						case LT:						case LTEQ:						case ANDEQ:						case OREQ:						case LITERAL_to:						case MINUS:						case LITERAL_div:						case LITERAL_mod:						case UNION:						case SLASH:						case DSLASH:						case LITERAL_text:						case LITERAL_node:						case SELF:						case XML_COMMENT:						case AT:						case PARENT:						case LITERAL_child:						case LITERAL_self:						case LITERAL_attribute:						case LITERAL_descendant:						case 100:						case 101:						case LITERAL_parent:						case LITERAL_ancestor:						case 104:						case 105:						case DOUBLE_LITERAL:						case DECIMAL_LITERAL:						case INTEGER_LITERAL:						case XML_PI:						{							break;						}						default:						{							throw new NoViableAltException(_t);						}						}						}						{						if (_t==null) _t=ASTNULL;						switch ( _t.getType()) {						case LITERAL_empty:						{							AST tmp11_AST_in = (AST)_t;							match(_t,LITERAL_empty);							_t = _t.getNextSibling();							{							if (_t==null) _t=ASTNULL;							switch ( _t.getType()) {							case LITERAL_greatest:							{								AST tmp12_AST_in = (AST)_t;								match(_t,LITERAL_greatest);								_t = _t.getNextSibling();								break;							}							case LITERAL_least:							{								AST tmp13_AST_in = (AST)_t;								match(_t,LITERAL_least);								_t = _t.getNextSibling();																									modifiers |= OrderSpec.EMPTY_LEAST; 																	orderSpec.setModifiers(modifiers);																								break;							}							default:							{								throw new NoViableAltException(_t);							}							}							}							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 NCNAME:						case STRING_LITERAL:						case EQ:						case LCURLY:						case COMMA:						case STAR:						case PLUS:						case LITERAL_if:						case LITERAL_return:						case LITERAL_or:						case LITERAL_and:						case NEQ:						case GT:						case GTEQ:						case LT:						case LTEQ:						case ANDEQ:						case OREQ:						case LITERAL_to:						case MINUS:						case LITERAL_div:						case LITERAL_mod:						case UNION:						case SLASH:						case DSLASH:						case LITERAL_text:						case LITERAL_node:						case SELF:						case XML_COMMENT:						case AT:						case PARENT:						case LITERAL_child:						case LITERAL_self:						case LITERAL_attribute:						case LITERAL_descendant:						case 100:						case 101:						case LITERAL_parent:						case LITERAL_ancestor:						case 104:						case 105:						case DOUBLE_LITERAL:						case DECIMAL_LITERAL:						case INTEGER_LITERAL:						case XML_PI:						{							break;						}						default:						{							throw new NoViableAltException(_t);						}						}						}					}					else {						if ( _cnt261>=1 ) { break _loop261; } else {throw new NoViableAltException(_t);}					}										_cnt261++;				} while (true);				}				_t = __t255;				_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 NCNAME:			case STRING_LITERAL:			case EQ:			case LCURLY:			case COMMA:			case STAR:			case PLUS:			case LITERAL_if:			case LITERAL_where:			case LITERAL_return:			case LITERAL_or:			case LITERAL_and:			case NEQ:			case GT:			case GTEQ:			case LT:			case LTEQ:			case ANDEQ:			case OREQ:			case LITERAL_to:			case MINUS:			case LITERAL_div:			case LITERAL_mod:			case UNION:			case SLASH:			case DSLASH:			case LITERAL_text:			case LITERAL_node:			case SELF:			case XML_COMMENT:			case AT:			case PARENT:			case LITERAL_child:			case LITERAL_self:			case LITERAL_attribute:			case LITERAL_descendant:			case 100:			case 101:			case LITERAL_parent:			case LITERAL_ancestor:			case 104:			case 105:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			case XML_PI:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case LITERAL_where:			{				AST tmp14_AST_in = (AST)_t;				match(_t,LITERAL_where);				_t = _t.getNextSibling();				whereExpr= new PathExpr(context);				expr(_t,whereExpr);				_t = _retTree;				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 NCNAME:			case STRING_LITERAL:			case EQ:			case LCURLY:			case COMMA:			case STAR:			case PLUS:			case LITERAL_if:			case LITERAL_return:			case LITERAL_or:			case LITERAL_and:			case NEQ:			case GT:			case GTEQ:			case LT:			case LTEQ:			case ANDEQ:			case OREQ:			case LITERAL_to:			case MINUS:			case LITERAL_div:			case LITERAL_mod:			case UNION:			case SLASH:			case DSLASH:			case LITERAL_text:			case LITERAL_node:			case SELF:			case XML_COMMENT:			case AT:			case PARENT:			case LITERAL_child:			case LITERAL_self:			case LITERAL_attribute:			case LITERAL_descendant:			case 100:			case 101:			case LITERAL_parent:			case LITERAL_ancestor:			case 104:			case 105:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			case XML_PI:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			expr(_t,(PathExpr) action);			_t = _retTree;									for (int i= clauses.size() - 1; i >= 0; i--) {							ForLetClause clause= (ForLetClause) clauses.get(i);							BindingExpression expr;							if (clause.isForClause)								expr= new ForExpr(context);							else								expr= new LetExpr(context);							expr.setVariable(clause.varName);							expr.setInputSequence(clause.inputSequence);							expr.setReturnExpression(action);							if (whereExpr != null) {								expr.setWhereExpression(whereExpr);								whereExpr= null;							}							if (orderBy != null) {								OrderSpec orderSpecs[] = new OrderSpec[orderBy.size()];								int k = 0;								for (Iterator j = orderBy.iterator(); j.hasNext(); k++) {									OrderSpec orderSpec = (OrderSpec) j.next();									orderSpecs[k] = orderSpec;								}								expr.setOrderSpecs(orderSpecs);							}							action= expr;						}						path.add(action);								_t = __t243;			_t = _t.getNextSibling();			break;		}		case LITERAL_or:		{			AST __t263 = _t;			AST tmp15_AST_in = (AST)_t;			match(_t,LITERAL_or);			_t = _t.getFirstChild();									PathExpr left= new PathExpr(context);						PathExpr right= new PathExpr(context);								expr(_t,left);			_t = _retTree;			expr(_t,right);			_t = _retTree;			_t = __t263;			_t = _t.getNextSibling();								OpOr or= new OpOr(context);					or.add(left);					or.add(right);					path.addPath(or);							break;		}		case LITERAL_and:		{			AST __t264 = _t;			AST tmp16_AST_in = (AST)_t;			match(_t,LITERAL_and);			_t = _t.getFirstChild();									PathExpr left= new PathExpr(context);						PathExpr right= new PathExpr(context);								expr(_t,left);			_t = _retTree;			expr(_t,right);			_t = _retTree;			_t = __t264;			_t = _t.getNextSibling();								OpAnd and= new OpAnd(context);					and.add(left);					and.add(right);					path.addPath(and);							break;		}		case PARENTHESIZED:		{			AST __t265 = _t;			AST tmp17_AST_in = (AST)_t;			match(_t,PARENTHESIZED);			_t = _t.getFirstChild();									PathExpr pathExpr= new PathExpr(context);						path.addPath(pathExpr);								{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			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 NCNAME:			case STRING_LITERAL:			case EQ:			case LCURLY:			case COMMA:			case STAR:			case PLUS:			case LITERAL_if:			case LITERAL_return:			case LITERAL_or:			case LITERAL_and:			case NEQ:			case GT:			case GTEQ:			case LT:			case LTEQ:			case ANDEQ:			case OREQ:			case LITERAL_to:			case MINUS:			case LITERAL_div:			case LITERAL_mod:			case UNION:			case SLASH:			case DSLASH:			case LITERAL_text:			case LITERAL_node:			case SELF:			case XML_COMMENT:			case AT:			case PARENT:			case LITERAL_child:			case LITERAL_self:			case LITERAL_attribute:			case LITERAL_descendant:			case 100:			case 101:			case LITERAL_parent:			case LITERAL_ancestor:			case 104:			case 105:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			case XML_PI:			{				expr(_t,pathExpr);				_t = _retTree;				break;			}			case 3:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			_t = __t265;			_t = _t.getNextSibling();			break;		}		case UNION:		{			AST __t267 = _t;			AST tmp18_AST_in = (AST)_t;			match(_t,UNION);			_t = _t.getFirstChild();									PathExpr left= new PathExpr(context);						PathExpr right= new PathExpr(context);								expr(_t,left);			_t = _retTree;			expr(_t,right);			_t = _retTree;			_t = __t267;			_t = _t.getNextSibling();								Union union= new Union(context, left, right);					path.add(union);							break;		}		case ABSOLUTE_SLASH:		{			AST __t268 = _t;			AST tmp19_AST_in = (AST)_t;			match(_t,ABSOLUTE_SLASH);			_t = _t.getFirstChild();									RootNode root= new RootNode(context);						path.add(root);								{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			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 NCNAME:			case STRING_LITERAL:			case EQ:			case LCURLY:			case COMMA:			case STAR:			case PLUS:			case LITERAL_if:			case LITERAL_return:			case LITERAL_or:			case LITERAL_and:			case NEQ:			case GT:			case GTEQ:			case LT:			case LTEQ:			case ANDEQ:			case OREQ:			case LITERAL_to:			case MINUS:			case LITERAL_div:			case LITERAL_mod:			case UNION:			case SLASH:			case DSLASH:			case LITERAL_text:			case LITERAL_node:			case SELF:			case XML_COMMENT:			case AT:			case PARENT:			case LITERAL_child:			case LITERAL_self:			case LITERAL_attribute:			case LITERAL_descendant:			case 100:			case 101:			case LITERAL_parent:			case LITERAL_ancestor:			case 104:			case 105:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			case XML_PI:			{				expr(_t,path);				_t = _retTree;				break;			}			case 3:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			_t = __t268;			_t = _t.getNextSibling();			break;		}		case ABSOLUTE_DSLASH:		{			AST __t270 = _t;			AST tmp20_AST_in = (AST)_t;			match(_t,ABSOLUTE_DSLASH);			_t = _t.getFirstChild();									RootNode root= new RootNode(context);						path.add(root);								{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case QNAME:			case WILDCARD:			case PREFIX_WILDCARD:			case FUNCTION:			case VARIABLE_REF:			case NCNAME:			case STRING_LITERAL:			case SLASH:			case DSLASH:			case LITERAL_text:			case LITERAL_node:			case SELF:			case AT:			case PARENT:			case LITERAL_child:			case LITERAL_self:			case LITERAL_attribute:			case LITERAL_descendant:			case 100:			case 101:			case LITERAL_parent:			case LITERAL_ancestor:			case 104:			case 105:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			{				step=pathExpr(_t,path);				_t = _retTree;												if (step instanceof LocationStep) {									LocationStep s= (LocationStep) step;									if (s.getAxis() == Constants.ATTRIBUTE_AXIS)										// combines descendant-or-self::node()/attribute:*										s.setAxis(Constants.DESCENDANT_ATTRIBUTE_AXIS);									else										s.setAxis(Constants.DESCENDANT_SELF_AXIS);								}											break;			}			case 3:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			_t = __t270;			_t = _t.getNextSibling();			break;		}		case LITERAL_to:		{			AST __t272 = _t;			AST tmp21_AST_in = (AST)_t;			match(_t,LITERAL_to);			_t = _t.getFirstChild();									PathExpr start = new PathExpr(context);						PathExpr end = new PathExpr(context);						List args = new ArrayList(2);						args.add(start);						args.add(end);								expr(_t,start);			_t = _retTree;			expr(_t,end);			_t = _retTree;									RangeExpression range = new RangeExpression(context);						range.setArguments(args);						path.addPath(range);								_t = __t272;			_t = _t.getNextSibling();			break;		}		case EQ:		case NEQ:		case GT:		case GTEQ:		case LT:		case LTEQ:		{			step=generalComp(_t,path);			_t = _retTree;			break;		}		case ANDEQ:		case OREQ:		{			step=fulltextComp(_t,path);			_t = _retTree;			break;		}		case QNAME:		case WILDCARD:		case PREFIX_WILDCARD:		case FUNCTION:		case VARIABLE_REF:		case NCNAME:		case STRING_LITERAL:		case SLASH:		case DSLASH:		case LITERAL_text:		case LITERAL_node:		case SELF:		case AT:		case PARENT:		case LITERAL_child:		case LITERAL_self:		case LITERAL_attribute:		case LITERAL_descendant:		case 100:		case 101:		case LITERAL_parent:		case LITERAL_ancestor:		case 104:		case 105:		case DOUBLE_LITERAL:		case DECIMAL_LITERAL:		case INTEGER_LITERAL:		{			step=pathExpr(_t,path);			_t = _retTree;			break;		}		case UNARY_MINUS:		case UNARY_PLUS:		case STAR:		case PLUS:		case MINUS:		case LITERAL_div:		case LITERAL_mod:		{			step=numericExpr(_t,path);			_t = _retTree;			break;		}		case ELEMENT:		case TEXT:		case LCURLY:		case XML_COMMENT:		case XML_PI:		{			step=constructor(_t,path);			_t = _retTree;			break;		}		default:		{			throw new NoViableAltException(_t);		}		}		_retTree = _t;	}