axis=axis_spec();
{ switch ( LA(1)) { case LITERAL_descendant: case 37: case LITERAL_child: case LITERAL_parent: case LITERAL_self: case LITERAL_attribute: case LITERAL_ancestor: case 43: case 44: case 45: { axis=axis_spec(); break; } case NCNAME: case CONST: case LITERAL_doctype: case LITERAL_document: case STAR: case LITERAL_collection: case LITERAL_xcollection: case INT: case AT: case ATTRIB_STAR: case LITERAL_node: case PARENT: case SELF: case LITERAL_text: case 49: case 50: case LITERAL_contains: case LITERAL_match: case LITERAL_near: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } }
	public final Expression  regularexpr(		PathExpr expr	) throws RecognitionException, TokenStreamException, PermissionDeniedException,EXistException {		Expression result;				result = null; 			Predicate pred = null;			int axis = Constants.CHILD_AXIS;						switch ( LA(1)) {		case LITERAL_descendant:		case 43:		case LITERAL_child:		case LITERAL_parent:		case LITERAL_self:		case LITERAL_attribute:		case LITERAL_ancestor:		case 49:		case 50:		case 51:		{			axis=axis_spec();			result=step(expr);			if ( inputState.guessing==0 ) {										if(result instanceof Step && ((Step)result).getAxis() == -1)				((Step)result).setAxis(axis);							}			{			_loop52:			do {				if ((LA(1)==LPPAREN)) {					pred=predicate(expr);					if ( inputState.guessing==0 ) {														expr.addPredicate(pred);												}				}				else {					break _loop52;				}							} while (true);			}			break;		}		case NCNAME:		case CONST:		case STAR:		case INT:		case LITERAL_text:		case 29:		case 30:		case LITERAL_contains:		case LITERAL_match:		case LITERAL_near:		case AT:		case ATTRIB_STAR:		case LITERAL_node:		case PARENT:		case SELF:		{			result=step(expr);			if ( inputState.guessing==0 ) {										if(result instanceof Step && ((Step)result).getAxis() == -1)				((Step)result).setAxis(Constants.CHILD_AXIS);							}			{			_loop54:			do {				if ((LA(1)==LPPAREN)) {					pred=predicate(expr);					if ( inputState.guessing==0 ) {														  expr.addPredicate(pred);												}				}				else {					break _loop54;				}							} while (true);			}			break;		}		case SLASH:		{			match(SLASH);			result=regularexpr(expr);			if ( inputState.guessing==0 ) {										if(result instanceof Step && ((Step)result).getAxis() == -1)							((Step)result).setAxis(Constants.CHILD_AXIS);							}			break;		}		case DSLASH:		{			match(DSLASH);			result=regularexpr(expr);			if ( inputState.guessing==0 ) {										if(result instanceof Step)							((Step)result).setAxis(Constants.DESCENDANT_SELF_AXIS);							}			break;		}		default:		{			throw new NoViableAltException(LT(1), getFilename());		}		}		return result;	}