_t = __t294;
_t = __t299;
	public final Expression  expr(AST _t,		PathExpr path	) throws RecognitionException, PermissionDeniedException,EXistException,XPathException {		Expression step;				AST expr_AST_in = (AST)_t;		AST t = null;		AST someVarName = null;		AST everyVarName = null;		AST varName = null;		AST posVar = null;		AST letVarName = null;					step= null;						if (_t==null) _t=ASTNULL;		switch ( _t.getType()) {		case LITERAL_cast:		{			AST __t274 = _t;			AST tmp3_AST_in = (AST)_t;			match(_t,LITERAL_cast);			_t = _t.getFirstChild();									PathExpr expr= new PathExpr(context);						int cardinality= Cardinality.EXACTLY_ONE;								step=expr(_t,expr);			_t = _retTree;			t = (AST)_t;			match(_t,ATOMIC_TYPE);			_t = _t.getNextSibling();			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case QUESTION:			{				AST tmp4_AST_in = (AST)_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);						path.add(castExpr);						step = castExpr;								_t = __t274;			_t = _t.getNextSibling();			break;		}		case COMMA:		{			AST __t276 = _t;			AST tmp5_AST_in = (AST)_t;			match(_t,COMMA);			_t = _t.getFirstChild();									PathExpr left= new PathExpr(context);						PathExpr right= new PathExpr(context);								step=expr(_t,left);			_t = _retTree;			step=expr(_t,right);			_t = _retTree;									SequenceConstructor sc= new SequenceConstructor(context);						sc.addExpression(left);						sc.addExpression(right);						path.add(sc);						step = sc;								_t = __t276;			_t = _t.getNextSibling();			break;		}		case LITERAL_if:		{			AST __t277 = _t;			AST tmp6_AST_in = (AST)_t;			match(_t,LITERAL_if);			_t = _t.getFirstChild();									PathExpr testExpr= new PathExpr(context);						PathExpr thenExpr= new PathExpr(context);						PathExpr elseExpr= new PathExpr(context);								step=expr(_t,testExpr);			_t = _retTree;			step=expr(_t,thenExpr);			_t = _retTree;			step=expr(_t,elseExpr);			_t = _retTree;									ConditionalExpression cond= new ConditionalExpression(context, testExpr, thenExpr, elseExpr);						path.add(cond);						step = cond;								_t = __t277;			_t = _t.getNextSibling();			break;		}		case LITERAL_some:		{			AST __t278 = _t;			AST tmp7_AST_in = (AST)_t;			match(_t,LITERAL_some);			_t = _t.getFirstChild();									List clauses= new ArrayList();						PathExpr satisfiesExpr = new PathExpr(context);								{			_loop283:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==VARIABLE_BINDING)) {					AST __t280 = _t;					someVarName = _t==ASTNULL ? null :(AST)_t;					match(_t,VARIABLE_BINDING);					_t = _t.getFirstChild();															ForLetClause clause= new ForLetClause();										PathExpr inputSequence = new PathExpr(context);														{					if (_t==null) _t=ASTNULL;					switch ( _t.getType()) {					case LITERAL_as:					{						AST __t282 = _t;						AST tmp8_AST_in = (AST)_t;						match(_t,LITERAL_as);						_t = _t.getFirstChild();						sequenceType(_t,clause.sequenceType);						_t = _retTree;						_t = __t282;						_t = _t.getNextSibling();						break;					}					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 BEFORE:					case AFTER:					case NCNAME:					case STRING_LITERAL:					case EQ:					case LCURLY:					case COMMA:					case STAR:					case PLUS:					case LITERAL_some:					case LITERAL_every:					case LITERAL_if:					case LITERAL_return:					case LITERAL_or:					case LITERAL_and:					case LITERAL_cast:					case LT:					case GT:					case LITERAL_eq:					case LITERAL_ne:					case LITERAL_lt:					case LITERAL_le:					case LITERAL_gt:					case LITERAL_ge:					case NEQ:					case GTEQ:					case LTEQ:					case LITERAL_is:					case LITERAL_isnot:					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 120:					case 121:					case LITERAL_parent:					case LITERAL_ancestor:					case 124:					case 125:					case DOUBLE_LITERAL:					case DECIMAL_LITERAL:					case INTEGER_LITERAL:					case XML_PI:					{						break;					}					default:					{						throw new NoViableAltException(_t);					}					}					}					step=expr(_t,inputSequence);					_t = _retTree;															clause.varName= someVarName.getText();										clause.inputSequence= inputSequence;										clauses.add(clause);														_t = __t280;					_t = _t.getNextSibling();				}				else {					break _loop283;				}							} while (true);			}			step=expr(_t,satisfiesExpr);			_t = _retTree;									Expression action = satisfiesExpr;						for (int i= clauses.size() - 1; i >= 0; i--) {							ForLetClause clause= (ForLetClause) clauses.get(i);							BindingExpression expr = new QuantifiedExpression(context, QuantifiedExpression.SOME);							expr.setVariable(clause.varName);							expr.setSequenceType(clause.sequenceType);							expr.setInputSequence(clause.inputSequence);							expr.setReturnExpression(action);							satisfiesExpr= null;							action= expr;						}						path.add(action);						step = action;								_t = __t278;			_t = _t.getNextSibling();			break;		}		case LITERAL_every:		{			AST __t284 = _t;			AST tmp9_AST_in = (AST)_t;			match(_t,LITERAL_every);			_t = _t.getFirstChild();									List clauses= new ArrayList();						PathExpr satisfiesExpr = new PathExpr(context);								{			_loop289:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==VARIABLE_BINDING)) {					AST __t286 = _t;					everyVarName = _t==ASTNULL ? null :(AST)_t;					match(_t,VARIABLE_BINDING);					_t = _t.getFirstChild();															ForLetClause clause= new ForLetClause();										PathExpr inputSequence = new PathExpr(context);														{					if (_t==null) _t=ASTNULL;					switch ( _t.getType()) {					case LITERAL_as:					{						AST __t288 = _t;						AST tmp10_AST_in = (AST)_t;						match(_t,LITERAL_as);						_t = _t.getFirstChild();						sequenceType(_t,clause.sequenceType);						_t = _retTree;						_t = __t288;						_t = _t.getNextSibling();						break;					}					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 BEFORE:					case AFTER:					case NCNAME:					case STRING_LITERAL:					case EQ:					case LCURLY:					case COMMA:					case STAR:					case PLUS:					case LITERAL_some:					case LITERAL_every:					case LITERAL_if:					case LITERAL_return:					case LITERAL_or:					case LITERAL_and:					case LITERAL_cast:					case LT:					case GT:					case LITERAL_eq:					case LITERAL_ne:					case LITERAL_lt:					case LITERAL_le:					case LITERAL_gt:					case LITERAL_ge:					case NEQ:					case GTEQ:					case LTEQ:					case LITERAL_is:					case LITERAL_isnot:					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 120:					case 121:					case LITERAL_parent:					case LITERAL_ancestor:					case 124:					case 125:					case DOUBLE_LITERAL:					case DECIMAL_LITERAL:					case INTEGER_LITERAL:					case XML_PI:					{						break;					}					default:					{						throw new NoViableAltException(_t);					}					}					}					step=expr(_t,inputSequence);					_t = _retTree;															clause.varName= everyVarName.getText();										clause.inputSequence= inputSequence;										clauses.add(clause);														_t = __t286;					_t = _t.getNextSibling();				}				else {					break _loop289;				}							} while (true);			}			step=expr(_t,satisfiesExpr);			_t = _retTree;									Expression action = satisfiesExpr;						for (int i= clauses.size() - 1; i >= 0; i--) {							ForLetClause clause= (ForLetClause) clauses.get(i);							BindingExpression expr = new QuantifiedExpression(context, QuantifiedExpression.EVERY);							expr.setVariable(clause.varName);							expr.setSequenceType(clause.sequenceType);							expr.setInputSequence(clause.inputSequence);							expr.setReturnExpression(action);							satisfiesExpr= null;							action= expr;						}						path.add(action);						step = action;								_t = __t284;			_t = _t.getNextSibling();			break;		}		case LITERAL_return:		{			AST __t290 = _t;			AST tmp11_AST_in = (AST)_t;			match(_t,LITERAL_return);			_t = _t.getFirstChild();									List clauses= new ArrayList();						Expression action= new PathExpr(context);						PathExpr whereExpr= null;						List orderBy= null;								{			int _cnt305=0;			_loop305:			do {				if (_t==null) _t=ASTNULL;				switch ( _t.getType()) {				case LITERAL_for:				{					AST __t292 = _t;					AST tmp12_AST_in = (AST)_t;					match(_t,LITERAL_for);					_t = _t.getFirstChild();					{					int _cnt298=0;					_loop298:					do {						if (_t==null) _t=ASTNULL;						if ((_t.getType()==VARIABLE_BINDING)) {							AST __t294 = _t;							varName = _t==ASTNULL ? null :(AST)_t;							match(_t,VARIABLE_BINDING);							_t = _t.getFirstChild();																					ForLetClause clause= new ForLetClause();														PathExpr inputSequence= new PathExpr(context);																				{							if (_t==null) _t=ASTNULL;							switch ( _t.getType()) {							case LITERAL_as:							{								AST __t296 = _t;								AST tmp13_AST_in = (AST)_t;								match(_t,LITERAL_as);								_t = _t.getFirstChild();								clause.sequenceType= new SequenceType();								sequenceType(_t,clause.sequenceType);								_t = _retTree;								_t = __t296;								_t = _t.getNextSibling();								break;							}							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 POSITIONAL_VAR:							case BEFORE:							case AFTER:							case NCNAME:							case STRING_LITERAL:							case EQ:							case LCURLY:							case COMMA:							case STAR:							case PLUS:							case LITERAL_some:							case LITERAL_every:							case LITERAL_if:							case LITERAL_return:							case LITERAL_or:							case LITERAL_and:							case LITERAL_cast:							case LT:							case GT:							case LITERAL_eq:							case LITERAL_ne:							case LITERAL_lt:							case LITERAL_le:							case LITERAL_gt:							case LITERAL_ge:							case NEQ:							case GTEQ:							case LTEQ:							case LITERAL_is:							case LITERAL_isnot:							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 120:							case 121:							case LITERAL_parent:							case LITERAL_ancestor:							case 124:							case 125:							case DOUBLE_LITERAL:							case DECIMAL_LITERAL:							case INTEGER_LITERAL:							case XML_PI:							{								break;							}							default:							{								throw new NoViableAltException(_t);							}							}							}							{							if (_t==null) _t=ASTNULL;							switch ( _t.getType()) {							case POSITIONAL_VAR:							{								posVar = (AST)_t;								match(_t,POSITIONAL_VAR);								_t = _t.getNextSibling();								clause.posVar= posVar.getText();								break;							}							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 BEFORE:							case AFTER:							case NCNAME:							case STRING_LITERAL:							case EQ:							case LCURLY:							case COMMA:							case STAR:							case PLUS:							case LITERAL_some:							case LITERAL_every:							case LITERAL_if:							case LITERAL_return:							case LITERAL_or:							case LITERAL_and:							case LITERAL_cast:							case LT:							case GT:							case LITERAL_eq:							case LITERAL_ne:							case LITERAL_lt:							case LITERAL_le:							case LITERAL_gt:							case LITERAL_ge:							case NEQ:							case GTEQ:							case LTEQ:							case LITERAL_is:							case LITERAL_isnot:							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 120:							case 121:							case LITERAL_parent:							case LITERAL_ancestor:							case 124:							case 125:							case DOUBLE_LITERAL:							case DECIMAL_LITERAL:							case INTEGER_LITERAL:							case XML_PI:							{								break;							}							default:							{								throw new NoViableAltException(_t);							}							}							}							step=expr(_t,inputSequence);							_t = _retTree;																					clause.varName= varName.getText();														clause.inputSequence= inputSequence;														clauses.add(clause);																				_t = __t294;							_t = _t.getNextSibling();						}						else {							if ( _cnt298>=1 ) { break _loop298; } else {throw new NoViableAltException(_t);}						}												_cnt298++;					} while (true);					}					_t = __t292;					_t = _t.getNextSibling();					break;				}				case LITERAL_let:				{					AST __t299 = _t;					AST tmp14_AST_in = (AST)_t;					match(_t,LITERAL_let);					_t = _t.getFirstChild();					{					int _cnt304=0;					_loop304:					do {						if (_t==null) _t=ASTNULL;						if ((_t.getType()==VARIABLE_BINDING)) {							AST __t301 = _t;							letVarName = _t==ASTNULL ? null :(AST)_t;							match(_t,VARIABLE_BINDING);							_t = _t.getFirstChild();																					ForLetClause clause= new ForLetClause();														clause.isForClause= false;														PathExpr inputSequence= new PathExpr(context);																				{							if (_t==null) _t=ASTNULL;							switch ( _t.getType()) {							case LITERAL_as:							{								AST __t303 = _t;								AST tmp15_AST_in = (AST)_t;								match(_t,LITERAL_as);								_t = _t.getFirstChild();								clause.sequenceType= new SequenceType();								sequenceType(_t,clause.sequenceType);								_t = _retTree;								_t = __t303;								_t = _t.getNextSibling();								break;							}							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 BEFORE:							case AFTER:							case NCNAME:							case STRING_LITERAL:							case EQ:							case LCURLY:							case COMMA:							case STAR:							case PLUS:							case LITERAL_some:							case LITERAL_every:							case LITERAL_if:							case LITERAL_return:							case LITERAL_or:							case LITERAL_and:							case LITERAL_cast:							case LT:							case GT:							case LITERAL_eq:							case LITERAL_ne:							case LITERAL_lt:							case LITERAL_le:							case LITERAL_gt:							case LITERAL_ge:							case NEQ:							case GTEQ:							case LTEQ:							case LITERAL_is:							case LITERAL_isnot:							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 120:							case 121:							case LITERAL_parent:							case LITERAL_ancestor:							case 124:							case 125:							case DOUBLE_LITERAL:							case DECIMAL_LITERAL:							case INTEGER_LITERAL:							case XML_PI:							{								break;							}							default:							{								throw new NoViableAltException(_t);							}							}							}							step=expr(_t,inputSequence);							_t = _retTree;																					clause.varName= letVarName.getText();														clause.inputSequence= inputSequence;														clauses.add(clause);																				_t = __t301;							_t = _t.getNextSibling();						}						else {							if ( _cnt304>=1 ) { break _loop304; } else {throw new NoViableAltException(_t);}						}												_cnt304++;					} while (true);					}					_t = __t299;					_t = _t.getNextSibling();					break;				}				default:				{					if ( _cnt305>=1 ) { break _loop305; } else {throw new NoViableAltException(_t);}				}				}				_cnt305++;			} while (true);			}			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case LITERAL_where:			{				AST tmp16_AST_in = (AST)_t;				match(_t,LITERAL_where);				_t = _t.getNextSibling();				whereExpr= new PathExpr(context);				step=expr(_t,whereExpr);				_t = _retTree;				break;			}			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 ORDER_BY:			case BEFORE:			case AFTER:			case NCNAME:			case STRING_LITERAL:			case EQ:			case LCURLY:			case COMMA:			case STAR:			case PLUS:			case LITERAL_some:			case LITERAL_every:			case LITERAL_if:			case LITERAL_return:			case LITERAL_or:			case LITERAL_and:			case LITERAL_cast:			case LT:			case GT:			case LITERAL_eq:			case LITERAL_ne:			case LITERAL_lt:			case LITERAL_le:			case LITERAL_gt:			case LITERAL_ge:			case NEQ:			case GTEQ:			case LTEQ:			case LITERAL_is:			case LITERAL_isnot:			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 120:			case 121:			case LITERAL_parent:			case LITERAL_ancestor:			case 124:			case 125:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			case XML_PI:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case ORDER_BY:			{				AST __t308 = _t;				AST tmp17_AST_in = (AST)_t;				match(_t,ORDER_BY);				_t = _t.getFirstChild();				orderBy= new ArrayList(3);				{				int _cnt314=0;				_loop314:				do {					if (_t==null) _t=ASTNULL;					if ((_tokenSet_0.member(_t.getType()))) {						PathExpr orderSpecExpr= new PathExpr(context);						step=expr(_t,orderSpecExpr);						_t = _retTree;																		OrderSpec orderSpec= new OrderSpec(orderSpecExpr);												int modifiers= 0;												orderBy.add(orderSpec);																	{						if (_t==null) _t=ASTNULL;						switch ( _t.getType()) {						case LITERAL_ascending:						case LITERAL_descending:						{							{							if (_t==null) _t=ASTNULL;							switch ( _t.getType()) {							case LITERAL_ascending:							{								AST tmp18_AST_in = (AST)_t;								match(_t,LITERAL_ascending);								_t = _t.getNextSibling();								break;							}							case LITERAL_descending:							{								AST tmp19_AST_in = (AST)_t;								match(_t,LITERAL_descending);								_t = _t.getNextSibling();																								modifiers= OrderSpec.DESCENDING_ORDER;																orderSpec.setModifiers(modifiers);																							break;							}							default:							{								throw new NoViableAltException(_t);							}							}							}							break;						}						case 3:						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 BEFORE:						case AFTER:						case NCNAME:						case STRING_LITERAL:						case EQ:						case LCURLY:						case COMMA:						case LITERAL_empty:						case STAR:						case PLUS:						case LITERAL_some:						case LITERAL_every:						case LITERAL_if:						case LITERAL_return:						case LITERAL_or:						case LITERAL_and:						case LITERAL_cast:						case LT:						case GT:						case LITERAL_eq:						case LITERAL_ne:						case LITERAL_lt:						case LITERAL_le:						case LITERAL_gt:						case LITERAL_ge:						case NEQ:						case GTEQ:						case LTEQ:						case LITERAL_is:						case LITERAL_isnot:						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 120:						case 121:						case LITERAL_parent:						case LITERAL_ancestor:						case 124:						case 125:						case DOUBLE_LITERAL:						case DECIMAL_LITERAL:						case INTEGER_LITERAL:						case XML_PI:						{							break;						}						default:						{							throw new NoViableAltException(_t);						}						}						}						{						if (_t==null) _t=ASTNULL;						switch ( _t.getType()) {						case LITERAL_empty:						{							AST tmp20_AST_in = (AST)_t;							match(_t,LITERAL_empty);							_t = _t.getNextSibling();							{							if (_t==null) _t=ASTNULL;							switch ( _t.getType()) {							case LITERAL_greatest:							{								AST tmp21_AST_in = (AST)_t;								match(_t,LITERAL_greatest);								_t = _t.getNextSibling();								break;							}							case LITERAL_least:							{								AST tmp22_AST_in = (AST)_t;								match(_t,LITERAL_least);								_t = _t.getNextSibling();																								modifiers |= OrderSpec.EMPTY_LEAST;																orderSpec.setModifiers(modifiers);																							break;							}							default:							{								throw new NoViableAltException(_t);							}							}							}							break;						}						case 3:						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 BEFORE:						case AFTER:						case NCNAME:						case STRING_LITERAL:						case EQ:						case LCURLY:						case COMMA:						case STAR:						case PLUS:						case LITERAL_some:						case LITERAL_every:						case LITERAL_if:						case LITERAL_return:						case LITERAL_or:						case LITERAL_and:						case LITERAL_cast:						case LT:						case GT:						case LITERAL_eq:						case LITERAL_ne:						case LITERAL_lt:						case LITERAL_le:						case LITERAL_gt:						case LITERAL_ge:						case NEQ:						case GTEQ:						case LTEQ:						case LITERAL_is:						case LITERAL_isnot:						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 120:						case 121:						case LITERAL_parent:						case LITERAL_ancestor:						case 124:						case 125:						case DOUBLE_LITERAL:						case DECIMAL_LITERAL:						case INTEGER_LITERAL:						case XML_PI:						{							break;						}						default:						{							throw new NoViableAltException(_t);						}						}						}					}					else {						if ( _cnt314>=1 ) { break _loop314; } else {throw new NoViableAltException(_t);}					}										_cnt314++;				} while (true);				}				_t = __t308;				_t = _t.getNextSibling();				break;			}			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 BEFORE:			case AFTER:			case NCNAME:			case STRING_LITERAL:			case EQ:			case LCURLY:			case COMMA:			case STAR:			case PLUS:			case LITERAL_some:			case LITERAL_every:			case LITERAL_if:			case LITERAL_return:			case LITERAL_or:			case LITERAL_and:			case LITERAL_cast:			case LT:			case GT:			case LITERAL_eq:			case LITERAL_ne:			case LITERAL_lt:			case LITERAL_le:			case LITERAL_gt:			case LITERAL_ge:			case NEQ:			case GTEQ:			case LTEQ:			case LITERAL_is:			case LITERAL_isnot:			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 120:			case 121:			case LITERAL_parent:			case LITERAL_ancestor:			case 124:			case 125:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			case XML_PI:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			step=expr(_t,(PathExpr) action);			_t = _retTree;									for (int i= clauses.size() - 1; i >= 0; i--) {							ForLetClause clause= (ForLetClause) clauses.get(i);							BindingExpression expr;							if (clause.isForClause)								expr= new ForExpr(context);							else								expr= new LetExpr(context);							expr.setVariable(clause.varName);							expr.setSequenceType(clause.sequenceType);							expr.setInputSequence(clause.inputSequence);							expr.setReturnExpression(action);							if (clause.isForClause)								 ((ForExpr) expr).setPositionalVariable(clause.posVar);							if (whereExpr != null) {								expr.setWhereExpression(whereExpr);								whereExpr= null;							}							if (orderBy != null) {								OrderSpec orderSpecs[]= new OrderSpec[orderBy.size()];								int k= 0;								for (Iterator j= orderBy.iterator(); j.hasNext(); k++) {									OrderSpec orderSpec= (OrderSpec) j.next();									orderSpecs[k]= orderSpec;								}								expr.setOrderSpecs(orderSpecs);								orderBy = null;							}							action= expr;						}						path.add(action);						step = action;								_t = __t290;			_t = _t.getNextSibling();			break;		}		case LITERAL_or:		{			AST __t315 = _t;			AST tmp23_AST_in = (AST)_t;			match(_t,LITERAL_or);			_t = _t.getFirstChild();									PathExpr left= new PathExpr(context);						PathExpr right= new PathExpr(context);								step=expr(_t,left);			_t = _retTree;			step=expr(_t,right);			_t = _retTree;			_t = __t315;			_t = _t.getNextSibling();								OpOr or= new OpOr(context);					or.add(left);					or.add(right);					path.addPath(or);					step = or;							break;		}		case LITERAL_and:		{			AST __t316 = _t;			AST tmp24_AST_in = (AST)_t;			match(_t,LITERAL_and);			_t = _t.getFirstChild();									PathExpr left= new PathExpr(context);						PathExpr right= new PathExpr(context);								step=expr(_t,left);			_t = _retTree;			step=expr(_t,right);			_t = _retTree;			_t = __t316;			_t = _t.getNextSibling();								OpAnd and= new OpAnd(context);					and.add(left);					and.add(right);					path.addPath(and);					step = and;							break;		}		case UNION:		{			AST __t317 = _t;			AST tmp25_AST_in = (AST)_t;			match(_t,UNION);			_t = _t.getFirstChild();									PathExpr left= new PathExpr(context);						PathExpr right= new PathExpr(context);								step=expr(_t,left);			_t = _retTree;			step=expr(_t,right);			_t = _retTree;			_t = __t317;			_t = _t.getNextSibling();								Union union= new Union(context, left, right);					path.add(union);					step = union;							break;		}		case LITERAL_intersect:		{			AST __t318 = _t;			AST tmp26_AST_in = (AST)_t;			match(_t,LITERAL_intersect);			_t = _t.getFirstChild();									PathExpr left = new PathExpr(context);						PathExpr right = new PathExpr(context);								step=expr(_t,left);			_t = _retTree;			step=expr(_t,right);			_t = _retTree;			_t = __t318;			_t = _t.getNextSibling();								Intersection intersect = new Intersection(context, left, right);					path.add(intersect);					step = intersect;							break;		}		case LITERAL_except:		{			AST __t319 = _t;			AST tmp27_AST_in = (AST)_t;			match(_t,LITERAL_except);			_t = _t.getFirstChild();									PathExpr left = new PathExpr(context);						PathExpr right = new PathExpr(context);								step=expr(_t,left);			_t = _retTree;			step=expr(_t,right);			_t = _retTree;			_t = __t319;			_t = _t.getNextSibling();								Except intersect = new Except(context, left, right);					path.add(intersect);					step = intersect;							break;		}		case ABSOLUTE_SLASH:		{			AST __t320 = _t;			AST tmp28_AST_in = (AST)_t;			match(_t,ABSOLUTE_SLASH);			_t = _t.getFirstChild();									RootNode root= new RootNode(context);						path.add(root);								{			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 BEFORE:			case AFTER:			case NCNAME:			case STRING_LITERAL:			case EQ:			case LCURLY:			case COMMA:			case STAR:			case PLUS:			case LITERAL_some:			case LITERAL_every:			case LITERAL_if:			case LITERAL_return:			case LITERAL_or:			case LITERAL_and:			case LITERAL_cast:			case LT:			case GT:			case LITERAL_eq:			case LITERAL_ne:			case LITERAL_lt:			case LITERAL_le:			case LITERAL_gt:			case LITERAL_ge:			case NEQ:			case GTEQ:			case LTEQ:			case LITERAL_is:			case LITERAL_isnot:			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 120:			case 121:			case LITERAL_parent:			case LITERAL_ancestor:			case 124:			case 125:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			case XML_PI:			{				step=expr(_t,path);				_t = _retTree;				break;			}			case 3:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			_t = __t320;			_t = _t.getNextSibling();			break;		}		case ABSOLUTE_DSLASH:		{			AST __t322 = _t;			AST tmp29_AST_in = (AST)_t;			match(_t,ABSOLUTE_DSLASH);			_t = _t.getFirstChild();									RootNode root= new RootNode(context);						path.add(root);								{			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 BEFORE:			case AFTER:			case NCNAME:			case STRING_LITERAL:			case EQ:			case LCURLY:			case COMMA:			case STAR:			case PLUS:			case LITERAL_some:			case LITERAL_every:			case LITERAL_if:			case LITERAL_return:			case LITERAL_or:			case LITERAL_and:			case LITERAL_cast:			case LT:			case GT:			case LITERAL_eq:			case LITERAL_ne:			case LITERAL_lt:			case LITERAL_le:			case LITERAL_gt:			case LITERAL_ge:			case NEQ:			case GTEQ:			case LTEQ:			case LITERAL_is:			case LITERAL_isnot:			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 120:			case 121:			case LITERAL_parent:			case LITERAL_ancestor:			case 124:			case 125:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			case XML_PI:			{				step=expr(_t,path);				_t = _retTree;												if (step instanceof LocationStep) {									LocationStep s= (LocationStep) step;									if (s.getAxis() == Constants.ATTRIBUTE_AXIS)										// combines descendant-or-self::node()/attribute:*										s.setAxis(Constants.DESCENDANT_ATTRIBUTE_AXIS);									else										s.setAxis(Constants.DESCENDANT_SELF_AXIS);								} else									step.setPrimaryAxis(Constants.DESCENDANT_SELF_AXIS);											break;			}			case 3:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			_t = __t322;			_t = _t.getNextSibling();			break;		}		case LITERAL_to:		{			AST __t324 = _t;			AST tmp30_AST_in = (AST)_t;			match(_t,LITERAL_to);			_t = _t.getFirstChild();									PathExpr start= new PathExpr(context);						PathExpr end= new PathExpr(context);						List args= new ArrayList(2);						args.add(start);						args.add(end);								step=expr(_t,start);			_t = _retTree;			step=expr(_t,end);			_t = _retTree;									RangeExpression range= new RangeExpression(context);						range.setArguments(args);						path.addPath(range);						step = range;								_t = __t324;			_t = _t.getNextSibling();			break;		}		case EQ:		case LT:		case GT:		case NEQ:		case GTEQ:		case LTEQ:		{			step=generalComp(_t,path);			_t = _retTree;			break;		}		case LITERAL_eq:		case LITERAL_ne:		case LITERAL_lt:		case LITERAL_le:		case LITERAL_gt:		case LITERAL_ge:		{			step=valueComp(_t,path);			_t = _retTree;			break;		}		case BEFORE:		case AFTER:		case LITERAL_is:		case LITERAL_isnot:		{			step=nodeComp(_t,path);			_t = _retTree;			break;		}		case ANDEQ:		case OREQ:		{			step=fulltextComp(_t,path);			_t = _retTree;			break;		}		case PARENTHESIZED:		case FUNCTION:		case VARIABLE_REF:		case ELEMENT:		case TEXT:		case STRING_LITERAL:		case LCURLY:		case XML_COMMENT:		case DOUBLE_LITERAL:		case DECIMAL_LITERAL:		case INTEGER_LITERAL:		case XML_PI:		{			step=primaryExpr(_t,path);			_t = _retTree;			break;		}		case QNAME:		case WILDCARD:		case PREFIX_WILDCARD:		case NCNAME:		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 120:		case 121:		case LITERAL_parent:		case LITERAL_ancestor:		case 124:		case 125:		{			step=pathExpr(_t,path);			_t = _retTree;			break;		}		case UNARY_MINUS:		case UNARY_PLUS:		case STAR:		case PLUS:		case MINUS:		case LITERAL_div:		case LITERAL_idiv:		case LITERAL_mod:		{			step=numericExpr(_t,path);			_t = _retTree;			break;		}		default:		{			throw new NoViableAltException(_t);		}		}		_retTree = _t;		return step;	}