returnAST = elementWithAttributes_AST; } finally { traceOut("elementWithAttributes");
elementWithAttributes_AST.copyLexInfo(q_AST);
	public final void elementWithAttributes() throws RecognitionException, TokenStreamException {				traceIn("elementWithAttributes");		try { // debugging			returnAST = null;			ASTPair currentAST = new ASTPair();			org.exist.xquery.parser.XQueryAST elementWithAttributes_AST = null;			org.exist.xquery.parser.XQueryAST attrs_AST = null;			org.exist.xquery.parser.XQueryAST content_AST = null;			String name= null;						match(LT);			name=qName();			astFactory.addASTChild(currentAST, returnAST);			attributeList();			attrs_AST = (org.exist.xquery.parser.XQueryAST)returnAST;			astFactory.addASTChild(currentAST, returnAST);			{			switch ( LA(1)) {			case SLASH:			{				{				match(SLASH);				match(GT);				if ( inputState.guessing==0 ) {					elementWithAttributes_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;														if (!elementStack.isEmpty())										lexer.inElementContent= true;									//lexer.wsExplicit= false;									elementWithAttributes_AST= (org.exist.xquery.parser.XQueryAST)astFactory.make( (new ASTArray(2)).add((org.exist.xquery.parser.XQueryAST)astFactory.create(ELEMENT,name)).add(attrs_AST));													currentAST.root = elementWithAttributes_AST;					currentAST.child = elementWithAttributes_AST!=null &&elementWithAttributes_AST.getFirstChild()!=null ?						elementWithAttributes_AST.getFirstChild() : elementWithAttributes_AST;					currentAST.advanceChildToEnd();				}				}				break;			}			case GT:			{				{				match(GT);				if ( inputState.guessing==0 ) {														elementStack.push(name);									lexer.inElementContent= true;									//lexer.wsExplicit= false;												}				mixedElementContent();				content_AST = (org.exist.xquery.parser.XQueryAST)returnAST;				astFactory.addASTChild(currentAST, returnAST);				match(END_TAG_START);				name=qName();				match(GT);				if ( inputState.guessing==0 ) {					elementWithAttributes_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;														if (elementStack.isEmpty())										throw new RecognitionException("found closing tag without opening tag: " + name);									String prev= (String) elementStack.pop();									if (!prev.equals(name))										throw new RecognitionException("found closing tag: " + name + "; expected: " + prev);									elementWithAttributes_AST= (org.exist.xquery.parser.XQueryAST)astFactory.make( (new ASTArray(2)).add((org.exist.xquery.parser.XQueryAST)astFactory.create(ELEMENT,name)).add(attrs_AST));									if (!elementStack.isEmpty()) {										lexer.inElementContent= true;										//lexer.wsExplicit= false;									}													currentAST.root = elementWithAttributes_AST;					currentAST.child = elementWithAttributes_AST!=null &&elementWithAttributes_AST.getFirstChild()!=null ?						elementWithAttributes_AST.getFirstChild() : elementWithAttributes_AST;					currentAST.advanceChildToEnd();				}				}				break;			}			default:			{				throw new NoViableAltException(LT(1), getFilename());			}			}			}			elementWithAttributes_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;			returnAST = elementWithAttributes_AST;		} finally { // debugging			traceOut("elementWithAttributes");		}	}