AST __t206 = _t;
AST __t208 = _t;
	public final Expression  typeCastExpr(AST _t,		PathExpr path	) throws RecognitionException, PermissionDeniedException,EXistException,XPathException {		Expression step;				org.exist.xquery.parser.XQueryAST typeCastExpr_AST_in = (_t == ASTNULL) ? null : (org.exist.xquery.parser.XQueryAST)_t;		org.exist.xquery.parser.XQueryAST castAST = null;		org.exist.xquery.parser.XQueryAST t = null;		org.exist.xquery.parser.XQueryAST castableAST = null;		org.exist.xquery.parser.XQueryAST t2 = null;					step= null;			PathExpr expr= new PathExpr(context);			int cardinality= Cardinality.EXACTLY_ONE;						if (_t==null) _t=ASTNULL;		switch ( _t.getType()) {		case LITERAL_cast:		{			AST __t206 = _t;			castAST = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;			match(_t,LITERAL_cast);			_t = _t.getFirstChild();			step=expr(_t,expr);			_t = _retTree;			t = (org.exist.xquery.parser.XQueryAST)_t;			match(_t,ATOMIC_TYPE);			_t = _t.getNextSibling();			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case QUESTION:			{				org.exist.xquery.parser.XQueryAST tmp57_AST_in = (org.exist.xquery.parser.XQueryAST)_t;				match(_t,QUESTION);				_t = _t.getNextSibling();				cardinality= Cardinality.ZERO_OR_ONE;				break;			}			case 3:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}									QName qn= QName.parse(context, t.getText());						int code= Type.getType(qn);						CastExpression castExpr= new CastExpression(context, expr, code, cardinality);						castExpr.setASTNode(castAST);						path.add(castExpr);						step = castExpr;								_t = __t206;			_t = _t.getNextSibling();			break;		}		case LITERAL_castable:		{			AST __t208 = _t;			castableAST = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;			match(_t,LITERAL_castable);			_t = _t.getFirstChild();			step=expr(_t,expr);			_t = _retTree;			t2 = (org.exist.xquery.parser.XQueryAST)_t;			match(_t,ATOMIC_TYPE);			_t = _t.getNextSibling();			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case QUESTION:			{				org.exist.xquery.parser.XQueryAST tmp58_AST_in = (org.exist.xquery.parser.XQueryAST)_t;				match(_t,QUESTION);				_t = _t.getNextSibling();				cardinality= Cardinality.ZERO_OR_ONE;				break;			}			case 3:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}									QName qn= QName.parse(context, t2.getText());						int code= Type.getType(qn);						CastableExpression castExpr= new CastableExpression(context, expr, code, cardinality);						castExpr.setASTNode(castAST);						path.add(castExpr);						step = castExpr;								_t = __t208;			_t = _t.getNextSibling();			break;		}		default:		{			throw new NoViableAltException(_t);		}		}		_retTree = _t;		return step;	}