*************************************************************************/
final public QuantifiedExpr parseQuantifiedExpr() throws ParseException, XQueryException {
final QuantifiedExpr outermost;
boolean isEveryQuantifier = false;
QualifiedName varName;
QuantifiedVariable var;
Type varType = null;
XQExpression valueExpr;
final XQExpression condExpr;
currentModule.pushVarScope();
switch(jj_nt.kind) {
case Some:
currentToken = jj_consume_token(Some);
break;
case Every:
currentToken = jj_consume_token(Every);
isEveryQuantifier = true;
break;
default:
jj_la1[83] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
currentToken = jj_consume_token(VarName);
varName = QNameUtil.parse(currentToken.image, namespaceContext, currentModule.getNamespace());
var = new QuantifiedVariable(varName);
currentModule.putVariable(varName, var);
switch(jj_nt.kind) {
case As:
currentToken = jj_consume_token(As);
varType = parseSequenceType();
var.setType(varType);
break;
default:
jj_la1[84] = jj_gen;
;
}
currentToken = jj_consume_token(In);
valueExpr = parseExprSingle();
var.setValue(valueExpr);
outermost = new QuantifiedExpr(isEveryQuantifier, var);
QuantifiedExpr outer = outermost;
label_13: while(true) {
switch(jj_nt.kind) {
case Comma:
;
break;
default:
jj_la1[85] = jj_gen;
break label_13;
}
currentToken = jj_consume_token(Comma);
currentToken = jj_consume_token(VariableIndicator);
currentToken = jj_consume_token(VarName);
varName = QNameUtil.parse(currentToken.image, namespaceContext, currentModule.getNamespace());
var = new QuantifiedVariable(varName);
currentModule.putVariable(varName, var);
switch(jj_nt.kind) {
case As:
currentToken = jj_consume_token(As);
varType = parseSequenceType();
var.setType(varType);
break;
default:
jj_la1[86] = jj_gen;
;
}
currentToken = jj_consume_token(In);
valueExpr = parseExprSingle();
var.setValue(valueExpr);
QuantifiedExpr inner = new QuantifiedExpr(isEveryQuantifier, var);
outer.setCondExpr(inner);
outer = inner;
}
currentToken = jj_consume_token(Satisfies);