AST tmp49_AST_in = (AST)_t;
AST tmp54_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 c = null;		AST i = null;		AST dec = null;		AST dbl = null;		AST v = null;		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 STRING_LITERAL:		{			c = (AST)_t;			match(_t,STRING_LITERAL);			_t = _t.getNextSibling();								step= new LiteralValue(context, new StringValue(c.getText()));					path.add(step);							break;		}		case INTEGER_LITERAL:		{			i = (AST)_t;			match(_t,INTEGER_LITERAL);			_t = _t.getNextSibling();								step= new LiteralValue(context, new IntegerValue(Integer.parseInt(i.getText())));					path.add(step);							break;		}		case DOUBLE_LITERAL:		case DECIMAL_LITERAL:		{			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case DECIMAL_LITERAL:			{				dec = (AST)_t;				match(_t,DECIMAL_LITERAL);				_t = _t.getNextSibling();				step= new LiteralValue(context, new DoubleValue(Double.parseDouble(dec.getText())));				break;			}			case DOUBLE_LITERAL:			{				dbl = (AST)_t;				match(_t,DOUBLE_LITERAL);				_t = _t.getNextSibling();				step= new LiteralValue(context, new DoubleValue(Double.parseDouble(dbl.getText())));				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			path.add(step);			break;		}		case VARIABLE_REF:		{			v = (AST)_t;			match(_t,VARIABLE_REF);			_t = _t.getNextSibling();								step= new VariableReference(context, v.getText());					path.add(step);							break;		}		case FUNCTION:		{			step=functionCall(_t,path);			_t = _retTree;			break;		}		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 104:		case 105:		case LITERAL_parent:		case LITERAL_ancestor:		case 108:		case 109:		{			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case LITERAL_child:			case LITERAL_self:			case LITERAL_attribute:			case LITERAL_descendant:			case 104:			case 105:			case LITERAL_parent:			case LITERAL_ancestor:			case 108:			case 109:			{				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 __t286 = _t;				AST tmp41_AST_in = (AST)_t;				match(_t,PREFIX_WILDCARD);				_t = _t.getFirstChild();				nc1 = (AST)_t;				match(_t,NCNAME);				_t = _t.getNextSibling();				_t = __t286;				_t = _t.getNextSibling();											QName qname= new QName(nc1.getText(), null, null);							test= new NameTest(Type.ELEMENT, qname);										break;			}			case NCNAME:			{				AST __t287 = _t;				nc = _t==ASTNULL ? null :(AST)_t;				match(_t,NCNAME);				_t = _t.getFirstChild();				AST tmp42_AST_in = (AST)_t;				match(_t,WILDCARD);				_t = _t.getNextSibling();				_t = __t287;				_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 tmp43_AST_in = (AST)_t;				match(_t,WILDCARD);				_t = _t.getNextSibling();				test= new TypeTest(Type.ELEMENT);				break;			}			case LITERAL_node:			{				AST tmp44_AST_in = (AST)_t;				match(_t,LITERAL_node);				_t = _t.getNextSibling();				test= new AnyNodeTest();				break;			}			case LITERAL_text:			{				AST tmp45_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);							{			_loop289:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==PREDICATE)) {					predicate(_t,(LocationStep) step);					_t = _retTree;				}				else {					break _loop289;				}							} while (true);			}			break;		}		case AT:		{			AST tmp46_AST_in = (AST)_t;			match(_t,AT);			_t = _t.getNextSibling();			QName qname;			{			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 PREFIX_WILDCARD:			{				AST __t291 = _t;				AST tmp47_AST_in = (AST)_t;				match(_t,PREFIX_WILDCARD);				_t = _t.getFirstChild();				nc2 = (AST)_t;				match(_t,NCNAME);				_t = _t.getNextSibling();				_t = __t291;				_t = _t.getNextSibling();				qname= new QName(nc2.getText(), null, null);				break;			}			case NCNAME:			{				AST __t292 = _t;				nc3 = _t==ASTNULL ? null :(AST)_t;				match(_t,NCNAME);				_t = _t.getFirstChild();				AST tmp48_AST_in = (AST)_t;				match(_t,WILDCARD);				_t = _t.getNextSibling();				_t = __t292;				_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);			}			}			}								step= new LocationStep(context, Constants.ATTRIBUTE_AXIS, new NameTest(Type.ATTRIBUTE, qname));					path.add(step);							{			_loop294:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==PREDICATE)) {					predicate(_t,(LocationStep) step);					_t = _retTree;				}				else {					break _loop294;				}							} while (true);			}			break;		}		case SELF:		{			AST tmp49_AST_in = (AST)_t;			match(_t,SELF);			_t = _t.getNextSibling();								step= new LocationStep(context, Constants.SELF_AXIS, new TypeTest(Type.NODE));					path.add(step);							{			_loop296:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==PREDICATE)) {					predicate(_t,(LocationStep) step);					_t = _retTree;				}				else {					break _loop296;				}							} while (true);			}			break;		}		case PARENT:		{			AST tmp50_AST_in = (AST)_t;			match(_t,PARENT);			_t = _t.getNextSibling();								step= new LocationStep(context, Constants.PARENT_AXIS, new TypeTest(Type.NODE));					path.add(step);							{			_loop298:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==PREDICATE)) {					predicate(_t,(LocationStep) step);					_t = _retTree;				}				else {					break _loop298;				}							} while (true);			}			break;		}		case SLASH:		{			AST __t299 = _t;			AST tmp51_AST_in = (AST)_t;			match(_t,SLASH);			_t = _t.getFirstChild();			step=pathExpr(_t,path);			_t = _retTree;			{			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 104:			case 105:			case LITERAL_parent:			case LITERAL_ancestor:			case 108:			case 109:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			{				rightStep=pathExpr(_t,path);				_t = _retTree;												if (rightStep instanceof LocationStep && ((LocationStep) rightStep).getAxis() == -1)									 ((LocationStep) rightStep).setAxis(Constants.CHILD_AXIS);											break;			}			case 3:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			_t = __t299;			_t = _t.getNextSibling();								if (step instanceof LocationStep && ((LocationStep) step).getAxis() == -1)						 ((LocationStep) step).setAxis(Constants.CHILD_AXIS);							break;		}		case DSLASH:		{			AST __t301 = _t;			AST tmp52_AST_in = (AST)_t;			match(_t,DSLASH);			_t = _t.getFirstChild();			step=pathExpr(_t,path);			_t = _retTree;			{			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 104:			case 105:			case LITERAL_parent:			case LITERAL_ancestor:			case 108:			case 109:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			{				rightStep=pathExpr(_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);								}											break;			}			case 3:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			_t = __t301;			_t = _t.getNextSibling();								if (step instanceof LocationStep && ((LocationStep) rightStep).getAxis() == -1)						 ((LocationStep) step).setAxis(Constants.DESCENDANT_SELF_AXIS);							break;		}		default:		{			throw new NoViableAltException(_t);		}		}		_retTree = _t;		return step;	}