/** A formal parameter for a method or closure. */
public final void parameterDeclaration() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
AST parameterDeclaration_AST = null;
AST pm_AST = null;
AST t_AST = null;
Token id = null;
AST id_AST = null;
AST exp_AST = null;
Token first = LT(1);boolean spreadParam = false;
parameterModifiersOpt();
pm_AST = (AST)returnAST;
{
if ((_tokenSet_24.member(LA(1))) && (_tokenSet_72.member(LA(2)))) {
typeSpec(false);
t_AST = (AST)returnAST;
}
else if ((LA(1)==IDENT||LA(1)==TRIPLE_DOT) && (_tokenSet_73.member(LA(2)))) {
}
else {
throw new NoViableAltException(LT(1), getFilename());
}
}
{
switch ( LA(1)) {
case TRIPLE_DOT:
{
match(TRIPLE_DOT);
if ( inputState.guessing==0 ) {
spreadParam = true;
}
break;
}
case IDENT:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
id = LT(1);
id_AST = astFactory.create(id);
match(IDENT);
{
switch ( LA(1)) {
case ASSIGN:
{
varInitializer();
exp_AST = (AST)returnAST;
break;
}
case COMMA:
case RPAREN:
case CLOSABLE_BLOCK_OP:
case NLS:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
if ( inputState.guessing==0 ) {
parameterDeclaration_AST = (AST)currentAST.root;
if (spreadParam) {
parameterDeclaration_AST = (AST)astFactory.make( (new ASTArray(5)).add(create(VARIABLE_PARAMETER_DEF,"VARIABLE_PARAMETER_DEF",first,LT(1))).add(pm_AST).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t_AST))).add(id_AST).add(exp_AST));
} else {
parameterDeclaration_AST = (AST)astFactory.make( (new ASTArray(5)).add(create(PARAMETER_DEF,"PARAMETER_DEF",first,LT(1))).add(pm_AST).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t_AST))).add(id_AST).add(exp_AST));
}
currentAST.root = parameterDeclaration_AST;
currentAST.child = parameterDeclaration_AST!=null &¶meterDeclaration_AST.getFirstChild()!=null ?
parameterDeclaration_AST.getFirstChild() : parameterDeclaration_AST;
currentAST.advanceChildToEnd();
}
returnAST = parameterDeclaration_AST;
}