case LPAREN: case NCNAME: case LITERAL_module: case LITERAL_namespace: case STRING_LITERAL: case XQUERY: case VERSION: case LITERAL_default: case LITERAL_function: case LITERAL_variable: case LITERAL_element: case DOLLAR: case LITERAL_import: case LITERAL_at: case LITERAL_as: case LITERAL_empty: case STAR: case LITERAL_item: case LITERAL_for: case LITERAL_let: case LITERAL_some: case LITERAL_every: case LITERAL_if: case LITERAL_return: case LITERAL_order: case LITERAL_by: case LITERAL_then: case LITERAL_else: case LITERAL_or: case LITERAL_and: case LITERAL_cast: case LT: case LITERAL_is: case LITERAL_isnot: case LITERAL_to: case LITERAL_div: case LITERAL_mod: case LITERAL_union: case LITERAL_intersect: case LITERAL_except: case SLASH: case DSLASH: case LITERAL_text: case LITERAL_node: case SELF: case XML_COMMENT: case XML_PI: case AT: case PARENT: case LITERAL_child: case LITERAL_self: case LITERAL_attribute: case LITERAL_descendant: case 124: case 125: case LITERAL_following: case LITERAL_parent: case LITERAL_ancestor: case 129: case 130: case DOUBLE_LITERAL: case DECIMAL_LITERAL: case INTEGER_LITERAL: case LITERAL_comment: case 135: case 136: case LITERAL_document: case LITERAL_collection: case LITERAL_preceding: { unionExpr(); astFactory.addASTChild(currentAST, returnAST); unaryExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root; break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } returnAST = unaryExpr_AST;
	public final void unaryExpr() throws RecognitionException, TokenStreamException {				traceIn("unaryExpr");		try { // debugging			returnAST = null;			ASTPair currentAST = new ASTPair();			org.exist.xquery.parser.XQueryAST unaryExpr_AST = null;			Token  m = null;			org.exist.xquery.parser.XQueryAST m_AST = null;			org.exist.xquery.parser.XQueryAST expr_AST = null;			Token  p = null;			org.exist.xquery.parser.XQueryAST p_AST = null;			org.exist.xquery.parser.XQueryAST expr2_AST = null;						switch ( LA(1)) {			case MINUS:			{				m = LT(1);				m_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(m);				astFactory.addASTChild(currentAST, m_AST);				match(MINUS);				unionExpr();				expr_AST = (org.exist.xquery.parser.XQueryAST)returnAST;				astFactory.addASTChild(currentAST, returnAST);				if ( inputState.guessing==0 ) {					unaryExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;										unaryExpr_AST= (org.exist.xquery.parser.XQueryAST)astFactory.make( (new ASTArray(2)).add((org.exist.xquery.parser.XQueryAST)astFactory.create(UNARY_MINUS,"-")).add(expr_AST));					unaryExpr_AST.copyLexInfo(m_AST);										currentAST.root = unaryExpr_AST;					currentAST.child = unaryExpr_AST!=null &&unaryExpr_AST.getFirstChild()!=null ?						unaryExpr_AST.getFirstChild() : unaryExpr_AST;					currentAST.advanceChildToEnd();				}				unaryExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;				break;			}			case PLUS:			{				p = LT(1);				p_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(p);				astFactory.addASTChild(currentAST, p_AST);				match(PLUS);				unionExpr();				expr2_AST = (org.exist.xquery.parser.XQueryAST)returnAST;				astFactory.addASTChild(currentAST, returnAST);				if ( inputState.guessing==0 ) {					unaryExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;										unaryExpr_AST= (org.exist.xquery.parser.XQueryAST)astFactory.make( (new ASTArray(2)).add((org.exist.xquery.parser.XQueryAST)astFactory.create(UNARY_PLUS,"+")).add(expr2_AST));					unaryExpr_AST.copyLexInfo(p_AST);										currentAST.root = unaryExpr_AST;					currentAST.child = unaryExpr_AST!=null &&unaryExpr_AST.getFirstChild()!=null ?						unaryExpr_AST.getFirstChild() : unaryExpr_AST;					currentAST.advanceChildToEnd();				}				unaryExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;				break;			}			case LPAREN:			case NCNAME:			case LITERAL_module:			case LITERAL_namespace:			case STRING_LITERAL:			case XQUERY:			case VERSION:			case LITERAL_default:			case LITERAL_function:			case LITERAL_variable:			case LITERAL_element:			case DOLLAR:			case LITERAL_import:			case LITERAL_at:			case LITERAL_as:			case LITERAL_empty:			case STAR:			case LITERAL_item:			case LITERAL_for:			case LITERAL_let:			case LITERAL_some:			case LITERAL_every:			case LITERAL_if:			case LITERAL_return:			case LITERAL_order:			case LITERAL_by:			case LITERAL_then:			case LITERAL_else:			case LITERAL_or:			case LITERAL_and:			case LITERAL_cast:			case LT:			case LITERAL_is:			case LITERAL_isnot:			case LITERAL_to:			case LITERAL_div:			case LITERAL_mod:			case LITERAL_union:			case LITERAL_intersect:			case LITERAL_except:			case SLASH:			case DSLASH:			case LITERAL_text:			case LITERAL_node:			case SELF:			case XML_COMMENT:			case XML_PI:			case AT:			case PARENT:			case LITERAL_child:			case LITERAL_self:			case LITERAL_attribute:			case LITERAL_descendant:			case 124:			case 125:			case LITERAL_following:			case LITERAL_parent:			case LITERAL_ancestor:			case 129:			case 130:			case DOUBLE_LITERAL:			case DECIMAL_LITERAL:			case INTEGER_LITERAL:			case LITERAL_comment:			case 135:			case 136:			case LITERAL_document:			case LITERAL_collection:			case LITERAL_preceding:			{				unionExpr();				astFactory.addASTChild(currentAST, returnAST);				unaryExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;				break;			}			default:			{				throw new NoViableAltException(LT(1), getFilename());			}			}			returnAST = unaryExpr_AST;		} finally { // debugging			traceOut("unaryExpr");		}	}