_loop333:
_loop109:
	public final Expression  pathExpr(AST _t,		PathExpr path	) throws RecognitionException, PermissionDeniedException,EXistException {		Expression step;				AST pathExpr_AST_in = (AST)_t;		AST c = null;		AST i = null;		AST dec = null;		AST dbl = 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 Literal(c.getText());						path.add(step);								break;		}		case INTEGER_LITERAL:		{			i = (AST)_t;			match(_t,INTEGER_LITERAL);			_t = _t.getNextSibling();									step = new IntNumber(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 IntNumber(Double.parseDouble(dec.getText()));											break;			}			case DOUBLE_LITERAL:			{				dbl = (AST)_t;				match(_t,DOUBLE_LITERAL);				_t = _t.getNextSibling();												step = new IntNumber(Double.parseDouble(dbl.getText()));											break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}									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 51:		case 52:		case LITERAL_parent:		case LITERAL_ancestor:		case 55:		case 56:		{			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case LITERAL_child:			case LITERAL_self:			case LITERAL_attribute:			case LITERAL_descendant:			case 51:			case 52:			case LITERAL_parent:			case LITERAL_ancestor:			case 55:			case 56:			{				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(Constants.ELEMENT_NODE, qname);											break;			}			case PREFIX_WILDCARD:			{				AST __t330 = _t;				AST tmp9_AST_in = (AST)_t;				match(_t,PREFIX_WILDCARD);				_t = _t.getFirstChild();				nc1 = (AST)_t;				match(_t,NCNAME);				_t = _t.getNextSibling();				_t = __t330;				_t = _t.getNextSibling();												QName qname = new QName(nc1.getText(), null, null);								test = new NameTest(Constants.ELEMENT_NODE, qname);											break;			}			case NCNAME:			{				AST __t331 = _t;				nc = _t==ASTNULL ? null :(AST)_t;				match(_t,NCNAME);				_t = _t.getFirstChild();				AST tmp10_AST_in = (AST)_t;				match(_t,WILDCARD);				_t = _t.getNextSibling();				_t = __t331;				_t = _t.getNextSibling();												String namespaceURI = context.getURIForPrefix(nc.getText());								QName qname = new QName(null, namespaceURI, null);								test = new NameTest(Constants.ELEMENT_NODE, qname);											break;			}			case WILDCARD:			{				AST tmp11_AST_in = (AST)_t;				match(_t,WILDCARD);				_t = _t.getNextSibling();												test = new TypeTest(Constants.ELEMENT_NODE);											break;			}			case LITERAL_node:			{				AST tmp12_AST_in = (AST)_t;				match(_t,LITERAL_node);				_t = _t.getNextSibling();												test = new AnyNodeTest();											break;			}			case LITERAL_text:			{				AST tmp13_AST_in = (AST)_t;				match(_t,LITERAL_text);				_t = _t.getNextSibling();												test = new TypeTest(Constants.TEXT_NODE);											break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}										step = new LocationStep(pool, axis, test);							path.add(step);									{			_loop333:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==PREDICATE)) {					predicate(_t,(LocationStep)step);					_t = _retTree;				}				else {					break _loop333;				}							} while (true);			}			break;		}		case AT:		{			AST tmp14_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.parse(context, attr.getText());											break;			}			case PREFIX_WILDCARD:			{				AST __t335 = _t;				AST tmp15_AST_in = (AST)_t;				match(_t,PREFIX_WILDCARD);				_t = _t.getFirstChild();				nc2 = (AST)_t;				match(_t,NCNAME);				_t = _t.getNextSibling();				_t = __t335;				_t = _t.getNextSibling();												qname = new QName(nc2.getText(), null, null);											break;			}			case NCNAME:			{				AST __t336 = _t;				nc3 = _t==ASTNULL ? null :(AST)_t;				match(_t,NCNAME);				_t = _t.getFirstChild();				AST tmp16_AST_in = (AST)_t;				match(_t,WILDCARD);				_t = _t.getNextSibling();				_t = __t336;				_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(pool, Constants.ATTRIBUTE_AXIS, 								new NameTest(Constants.ATTRIBUTE_NODE, qname));						path.add(step);								{			_loop338:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==PREDICATE)) {					predicate(_t,(LocationStep)step);					_t = _retTree;				}				else {					break _loop338;				}							} while (true);			}			break;		}		case SELF:		{			AST tmp17_AST_in = (AST)_t;			match(_t,SELF);			_t = _t.getNextSibling();									step = 							new LocationStep(pool, Constants.SELF_AXIS, new TypeTest(Constants.NODE_TYPE));						path.add(step);								{			_loop340:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==PREDICATE)) {					predicate(_t,(LocationStep)step);					_t = _retTree;				}				else {					break _loop340;				}							} while (true);			}			break;		}		case PARENT:		{			AST tmp18_AST_in = (AST)_t;			match(_t,PARENT);			_t = _t.getNextSibling();									step =							new LocationStep(pool, Constants.PARENT_AXIS, new TypeTest(Constants.NODE_TYPE));						path.add(step);								{			_loop342:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==PREDICATE)) {					predicate(_t,(LocationStep)step);					_t = _retTree;				}				else {					break _loop342;				}							} while (true);			}			break;		}		case SLASH:		{			AST __t343 = _t;			AST tmp19_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 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 51:			case 52:			case LITERAL_parent:			case LITERAL_ancestor:			case 55:			case 56:			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 = __t343;			_t = _t.getNextSibling();									if(rightStep instanceof LocationStep && ((LocationStep)rightStep).getAxis() == -1)							((LocationStep)step).setAxis(Constants.CHILD_AXIS);								break;		}		case DSLASH:		{			AST __t345 = _t;			AST tmp20_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 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 51:			case 52:			case LITERAL_parent:			case LITERAL_ancestor:			case 55:			case 56:			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 = __t345;			_t = _t.getNextSibling();									if(step instanceof LocationStep)							((LocationStep)step).setAxis(Constants.DESCENDANT_SELF_AXIS);								break;		}		default:		{			throw new NoViableAltException(_t);		}		}		_retTree = _t;		return step;	}