AST tmp61_AST_in = (AST)_t;
AST tmp63_AST_in = (AST)_t;
	public final Expression  pathExpr(AST _t,		PathExpr path	) throws RecognitionException, PermissionDeniedException,EXistException,XPathException {		Expression step;				AST pathExpr_AST_in = (AST)_t;		AST qn = null;		AST nc1 = null;		AST nc = null;		AST attr = null;		AST nc2 = null;		AST nc3 = null;					Expression rightStep= null;			step= null;			int axis= Constants.CHILD_AXIS;						if (_t==null) _t=ASTNULL;		switch ( _t.getType()) {		case QNAME:		case WILDCARD:		case PREFIX_WILDCARD:		case NCNAME:		case LITERAL_text:		case LITERAL_node:		case LITERAL_child:		case LITERAL_self:		case LITERAL_attribute:		case LITERAL_descendant:		case 113:		case 114:		case LITERAL_parent:		case LITERAL_ancestor:		case 117:		case 118:		{			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case LITERAL_child:			case LITERAL_self:			case LITERAL_attribute:			case LITERAL_descendant:			case 113:			case 114:			case LITERAL_parent:			case LITERAL_ancestor:			case 117:			case 118:			{				axis=forwardAxis(_t);				_t = _retTree;				break;			}			case QNAME:			case WILDCARD:			case PREFIX_WILDCARD:			case NCNAME:			case LITERAL_text:			case LITERAL_node:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			NodeTest test;			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case QNAME:			{				qn = (AST)_t;				match(_t,QNAME);				_t = _t.getNextSibling();											QName qname= QName.parse(context, qn.getText());							test= new NameTest(Type.ELEMENT, qname);										break;			}			case PREFIX_WILDCARD:			{				AST __t810 = _t;				AST tmp60_AST_in = (AST)_t;				match(_t,PREFIX_WILDCARD);				_t = _t.getFirstChild();				nc1 = (AST)_t;				match(_t,NCNAME);				_t = _t.getNextSibling();				_t = __t810;				_t = _t.getNextSibling();											QName qname= new QName(nc1.getText(), null, null);							test= new NameTest(Type.ELEMENT, qname);										break;			}			case NCNAME:			{				AST __t811 = _t;				nc = _t==ASTNULL ? null :(AST)_t;				match(_t,NCNAME);				_t = _t.getFirstChild();				AST tmp61_AST_in = (AST)_t;				match(_t,WILDCARD);				_t = _t.getNextSibling();				_t = __t811;				_t = _t.getNextSibling();											String namespaceURI= context.getURIForPrefix(nc.getText());							QName qname= new QName(null, namespaceURI, null);							test= new NameTest(Type.ELEMENT, qname);										break;			}			case WILDCARD:			{				AST tmp62_AST_in = (AST)_t;				match(_t,WILDCARD);				_t = _t.getNextSibling();				test= new TypeTest(Type.ELEMENT);				break;			}			case LITERAL_node:			{				AST tmp63_AST_in = (AST)_t;				match(_t,LITERAL_node);				_t = _t.getNextSibling();				test= new AnyNodeTest();				break;			}			case LITERAL_text:			{				AST tmp64_AST_in = (AST)_t;				match(_t,LITERAL_text);				_t = _t.getNextSibling();				test= new TypeTest(Type.TEXT);				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}								step= new LocationStep(context, axis, test);					path.add(step);							{			_loop813:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==PREDICATE)) {					predicate(_t,(LocationStep) step);					_t = _retTree;				}				else {					break _loop813;				}							} while (true);			}			break;		}		case AT:		{			AST tmp65_AST_in = (AST)_t;			match(_t,AT);			_t = _t.getNextSibling();			QName qname= null;			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case QNAME:			{				attr = (AST)_t;				match(_t,QNAME);				_t = _t.getNextSibling();				qname= QName.parseAttribute(context, attr.getText());				break;			}			case WILDCARD:			{				AST tmp66_AST_in = (AST)_t;				match(_t,WILDCARD);				_t = _t.getNextSibling();				break;			}			case PREFIX_WILDCARD:			{				AST __t815 = _t;				AST tmp67_AST_in = (AST)_t;				match(_t,PREFIX_WILDCARD);				_t = _t.getFirstChild();				nc2 = (AST)_t;				match(_t,NCNAME);				_t = _t.getNextSibling();				_t = __t815;				_t = _t.getNextSibling();				qname= new QName(nc2.getText(), null, null);				break;			}			case NCNAME:			{				AST __t816 = _t;				nc3 = _t==ASTNULL ? null :(AST)_t;				match(_t,NCNAME);				_t = _t.getFirstChild();				AST tmp68_AST_in = (AST)_t;				match(_t,WILDCARD);				_t = _t.getNextSibling();				_t = __t816;				_t = _t.getNextSibling();											String namespaceURI= context.getURIForPrefix(nc3.getText());							if (namespaceURI == null)								throw new EXistException("No namespace defined for prefix " + nc.getText());							qname= new QName(null, namespaceURI, null);										break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}								NodeTest test= qname == null ? new TypeTest(Type.ATTRIBUTE) : new NameTest(Type.ATTRIBUTE, qname);					step= new LocationStep(context, Constants.ATTRIBUTE_AXIS, test);					path.add(step);							{			_loop818:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==PREDICATE)) {					predicate(_t,(LocationStep) step);					_t = _retTree;				}				else {					break _loop818;				}							} while (true);			}			break;		}		case SELF:		{			AST tmp69_AST_in = (AST)_t;			match(_t,SELF);			_t = _t.getNextSibling();								step= new LocationStep(context, Constants.SELF_AXIS, new TypeTest(Type.NODE));					path.add(step);							{			_loop820:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==PREDICATE)) {					predicate(_t,(LocationStep) step);					_t = _retTree;				}				else {					break _loop820;				}							} while (true);			}			break;		}		case PARENT:		{			AST tmp70_AST_in = (AST)_t;			match(_t,PARENT);			_t = _t.getNextSibling();								step= new LocationStep(context, Constants.PARENT_AXIS, new TypeTest(Type.NODE));					path.add(step);							{			_loop822:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==PREDICATE)) {					predicate(_t,(LocationStep) step);					_t = _retTree;				}				else {					break _loop822;				}							} while (true);			}			break;		}		case SLASH:		{			AST __t823 = _t;			AST tmp71_AST_in = (AST)_t;			match(_t,SLASH);			_t = _t.getFirstChild();			step=expr(_t,path);			_t = _retTree;			{			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 LITERAL_cast:			case LITERAL_eq:			case LITERAL_ne:			case LITERAL_lt:			case LITERAL_le:			case LITERAL_gt:			case LITERAL_ge:			case NEQ:			case GT:			case GTEQ:			case LT:			case LTEQ:			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 SELF:			case XML_COMMENT:			case AT:			case PARENT:			case LITERAL_child:			case LITERAL_self:			case LITERAL_attribute:			case LITERAL_descendant:			case 113:			case 114:			case LITERAL_parent:			case LITERAL_ancestor:			case 117:			case 118:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			case XML_PI:			{				rightStep=expr(_t,path);				_t = _retTree;												if (rightStep instanceof LocationStep) {									if(((LocationStep) rightStep).getAxis() == -1)										((LocationStep) rightStep).setAxis(Constants.CHILD_AXIS);								} else {									//rightStep = new SimpleStep(context, Constants.CHILD_AXIS, rightStep);									rightStep.setPrimaryAxis(Constants.CHILD_AXIS);									//path.replaceLastExpression(rightStep);								}											break;			}			case 3:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			_t = __t823;			_t = _t.getNextSibling();								if (step instanceof LocationStep && ((LocationStep) step).getAxis() == -1)						 ((LocationStep) step).setAxis(Constants.CHILD_AXIS);							break;		}		case DSLASH:		{			AST __t825 = _t;			AST tmp72_AST_in = (AST)_t;			match(_t,DSLASH);			_t = _t.getFirstChild();			step=expr(_t,path);			_t = _retTree;			{			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 LITERAL_cast:			case LITERAL_eq:			case LITERAL_ne:			case LITERAL_lt:			case LITERAL_le:			case LITERAL_gt:			case LITERAL_ge:			case NEQ:			case GT:			case GTEQ:			case LT:			case LTEQ:			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 SELF:			case XML_COMMENT:			case AT:			case PARENT:			case LITERAL_child:			case LITERAL_self:			case LITERAL_attribute:			case LITERAL_descendant:			case 113:			case 114:			case LITERAL_parent:			case LITERAL_ancestor:			case 117:			case 118:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			case XML_PI:			{				rightStep=expr(_t,path);				_t = _retTree;												if (rightStep instanceof LocationStep) {									LocationStep rs= (LocationStep) rightStep;									if (rs.getAxis() == Constants.ATTRIBUTE_AXIS)										rs.setAxis(Constants.DESCENDANT_ATTRIBUTE_AXIS);									else										rs.setAxis(Constants.DESCENDANT_SELF_AXIS);								} else {									rightStep.setPrimaryAxis(Constants.DESCENDANT_SELF_AXIS);								}											break;			}			case 3:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			_t = __t825;			_t = _t.getNextSibling();								if (step instanceof LocationStep && ((LocationStep) step).getAxis() == -1)						 ((LocationStep) step).setAxis(Constants.DESCENDANT_SELF_AXIS);							break;		}		default:		{			throw new NoViableAltException(_t);		}		}		_retTree = _t;		return step;	}