("," "$" VarName TypeDeclaration? ":=" ExprSingle)*
[110] TypeDeclaration ::= "as" SequenceType
************************************************************************/
final public List<Binding> parseLetClause() throws ParseException, XQueryException {
final List<Binding> lets;
LetVariable var;
LetClause clause;
Type varType = null;
XQExpression expr = null;
currentToken = jj_consume_token(LetVariable);
currentToken = jj_consume_token(VarName);
QualifiedName varName = QNameUtil.parse(currentToken.image, namespaceContext, currentModule.getNamespace());
var = new LetVariable(varName);
currentModule.putVariable(varName, var);
clause = new LetClause(var);
locate(clause);
switch(jj_nt.kind) {
case As:
currentToken = jj_consume_token(As);
varType = parseSequenceType();
var.setType(varType);
break;
default:
jj_la1[70] = jj_gen;
;
}
currentToken = jj_consume_token(ColonEquals);
expr = parseExprSingle();
var.setValue(expr);
lets = new LinkedList<Binding>();
lets.add(clause);
label_10: while(true) {
switch(jj_nt.kind) {
case Comma:
;
break;
default:
jj_la1[71] = jj_gen;
break label_10;
}
//("," "$" VarName TypeDeclaration? ":=" ExprSingle)*
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 LetVariable(varName);
currentModule.putVariable(varName, var);
clause = new LetClause(var);
switch(jj_nt.kind) {
case As:
currentToken = jj_consume_token(As);
varType = parseSequenceType();
var.setType(varType);
break;
default:
jj_la1[72] = jj_gen;
;
}
currentToken = jj_consume_token(ColonEquals);
expr = parseExprSingle();
var.setValue(expr);
lets.add(clause);
}
{
if(true)
return lets;