AST __t177 = _t;
AST __t181 = _t;
	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 __t161 = _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 = __t161;			_t = _t.getNextSibling();			break;		}		case LITERAL_return:		{			AST __t162 = _t;			AST tmp4_AST_in = (AST)_t;			match(_t,LITERAL_return);			_t = _t.getFirstChild();									List clauses= new ArrayList();						Expression action= new PathExpr(context);						PathExpr whereExpr= null;								{			int _cnt172=0;			_loop172:			do {				if (_t==null) _t=ASTNULL;				switch ( _t.getType()) {				case LITERAL_for:				{					AST __t164 = _t;					AST tmp5_AST_in = (AST)_t;					match(_t,LITERAL_for);					_t = _t.getFirstChild();					{					int _cnt167=0;					_loop167:					do {						if (_t==null) _t=ASTNULL;						if ((_t.getType()==VARIABLE_BINDING)) {							AST __t166 = _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 = __t166;							_t = _t.getNextSibling();						}						else {							if ( _cnt167>=1 ) { break _loop167; } else {throw new NoViableAltException(_t);}						}												_cnt167++;					} while (true);					}					_t = __t164;					_t = _t.getNextSibling();					break;				}				case LITERAL_let:				{					AST __t168 = _t;					AST tmp6_AST_in = (AST)_t;					match(_t,LITERAL_let);					_t = _t.getFirstChild();					{					int _cnt171=0;					_loop171:					do {						if (_t==null) _t=ASTNULL;						if ((_t.getType()==VARIABLE_BINDING)) {							AST __t170 = _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 = __t170;							_t = _t.getNextSibling();						}						else {							if ( _cnt171>=1 ) { break _loop171; } else {throw new NoViableAltException(_t);}						}												_cnt171++;					} while (true);					}					_t = __t168;					_t = _t.getNextSibling();					break;				}				default:				{					if ( _cnt172>=1 ) { break _loop172; } else {throw new NoViableAltException(_t);}				}				}				_cnt172++;			} while (true);			}			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case LITERAL_where:			{				AST tmp7_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 COMMA:			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 PLUS:			case MINUS:			case STAR:			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 76:			case 77:			case LITERAL_parent:			case LITERAL_ancestor:			case 80:			case 81:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			case XML_PI:			case LCURLY:			{				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;							}							action= expr;						}						path.add(action);								_t = __t162;			_t = _t.getNextSibling();			break;		}		case LITERAL_or:		{			AST __t174 = _t;			AST tmp8_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 = __t174;			_t = _t.getNextSibling();								OpOr or= new OpOr(context);					or.add(left);					or.add(right);					path.addPath(or);							break;		}		case LITERAL_and:		{			AST __t175 = _t;			AST tmp9_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 = __t175;			_t = _t.getNextSibling();								OpAnd and= new OpAnd(context);					and.add(left);					and.add(right);					path.addPath(and);							break;		}		case PARENTHESIZED:		{			AST __t176 = _t;			AST tmp10_AST_in = (AST)_t;			match(_t,PARENTHESIZED);			_t = _t.getFirstChild();									PathExpr expr= new PathExpr(context);						path.addPath(expr);								expr(_t,expr);			_t = _retTree;			_t = __t176;			_t = _t.getNextSibling();			break;		}		case UNION:		{			AST __t177 = _t;			AST tmp11_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 = __t177;			_t = _t.getNextSibling();								Union union= new Union(context, left, right);					path.addPath(union);							break;		}		case ABSOLUTE_SLASH:		{			AST __t178 = _t;			AST tmp12_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 COMMA:			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 PLUS:			case MINUS:			case STAR:			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 76:			case 77:			case LITERAL_parent:			case LITERAL_ancestor:			case 80:			case 81:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			case XML_PI:			case LCURLY:			{				expr(_t,path);				_t = _retTree;				break;			}			case 3:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			_t = __t178;			_t = _t.getNextSibling();			break;		}		case ABSOLUTE_DSLASH:		{			AST __t180 = _t;			AST tmp13_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 76:			case 77:			case LITERAL_parent:			case LITERAL_ancestor:			case 80:			case 81:			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 = __t180;			_t = _t.getNextSibling();			break;		}		case LITERAL_to:		{			AST __t182 = _t;			AST tmp14_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 = __t182;			_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 76:		case 77:		case LITERAL_parent:		case LITERAL_ancestor:		case 80:		case 81:		case DOUBLE_LITERAL:		case DECIMAL_LITERAL:		case INTEGER_LITERAL:		{			step=pathExpr(_t,path);			_t = _retTree;			break;		}		case UNARY_MINUS:		case UNARY_PLUS:		case PLUS:		case MINUS:		case STAR:		case LITERAL_div:		case LITERAL_mod:		{			step=numericExpr(_t,path);			_t = _retTree;			break;		}		case ELEMENT:		case TEXT:		case XML_COMMENT:		case XML_PI:		case LCURLY:		{			step=constructor(_t,path);			_t = _retTree;			break;		}		default:		{			throw new NoViableAltException(_t);		}		}		_retTree = _t;	}