/************************************************************************
[111] CompAttrConstructor ::= (("attribute" QName "{") | ("attribute" "{" Expr "}" "{")) Expr? "}"
************************************************************************/
final public AttributeConstructor parseCompAttrConstructor() throws ParseException,
XQueryException {
final AttributeConstructor ac;
XQExpression nameExpr = null;
XQExpression valueExpr = null;
switch(jj_nt.kind) {
case AttributeQNameLbrace:
currentToken = jj_consume_token(AttributeQNameLbrace);
QualifiedName name = QNameUtil.parse(currentToken.image.substring(10, currentToken.image.length() - 1).trim(), namespaceContext, staticContext.getDefaultElementNamespace());
ac = new AttributeConstructor(name);
break;
case AttributeLbrace:
currentToken = jj_consume_token(AttributeLbrace);
nameExpr = parseExpr();
ac = new AttributeConstructor(nameExpr);
currentToken = jj_consume_token(Rbrace);
currentToken = jj_consume_token(LbraceExprEnclosure);
break;
default:
jj_la1[176] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
switch(jj_nt.kind) {
case DecimalLiteral:
case DotDot:
case Dot:
case DoubleLiteral:
case IntegerLiteral:
case Some:
case Every:
case XmlCommentStart:
case ProcessingInstructionStart:
case StartTagOpenRoot:
case ValidateLbrace:
case ValidateSchemaMode:
case TypeswitchLpar:
case ElementLbrace:
case AttributeLbrace:
case AttributeQNameLbrace:
case ElementQNameLbrace:
case DocumentLbrace:
case TextLbrace:
case PILbrace:
case PINCNameLbrace:
case CommentLbrace:
case OrderedOpen:
case UnorderedOpen:
case ExecuteAt:
case IfLpar:
case AxisAncestorOrSelf:
case AxisAncestor:
case AxisAttribute:
case AxisChild:
case AxisDescendantOrSelf:
case AxisDescendant:
case AxisFollowingSibling:
case AxisFollowing:
case AxisParent:
case AxisPrecedingSibling:
case AxisPreceding:
case AxisSelf:
case At:
case ElementType:
case AttributeType:
case SchemaElementType:
case SchemaAttributeType:
case CommentLparRpar:
case TextLparRpar:
case NodeLparRpar:
case DocumentLpar:
case ProcessingInstructionLpar:
case NCNameColonStar:
case StarColonNCName:
case QNameLpar:
case ForVariable:
case LetVariable:
case Plus:
case SlashSlash:
case Slash:
case StringLiteral:
case Star:
case VariableIndicator:
case Minus:
case PragmaOpen:
case Lpar:
case ElementTypeForKindTest:
case AttributeTypeForKindTest:
case SchemaElementTypeForKindTest:
case SchemaAttributeTypeForKindTest:
case CommentLparRparForKindTest:
case TextLparRparForKindTest:
case NodeLparRparForKindTest:
case DocumentLparForKindTest:
case ProcessingInstructionLparForKindTest:
case ElementTypeForDocumentTest:
case SchemaElementTypeForDocumentTest:
case QName:
case XmlCommentStartForElementContent:
case ProcessingInstructionStartForElementContent:
case StartTagOpen:
valueExpr = parseExpr();
ac.addValue(valueExpr);
break;
default:
jj_la1[177] = jj_gen;
;
}