}
return new JfpDef(tfpdefName, typeDef);
case JJTONLYKEYWORDARG2:
case JJTDEFAULTARG2:
DefaultArg defaultArg;
JfpDef jfpDef;
if (arity == 1) {
jfpDef = (JfpDef) stack.popNode();
defaultArg = new DefaultArg(jfpDef.nameNode, null, jfpDef.typeDef, n.getId());
} else if (arity == 2) {
exprType defaultValue = (exprType) stack.popNode();
jfpDef = (JfpDef) stack.popNode();
defaultArg = new DefaultArg(jfpDef.nameNode, defaultValue, jfpDef.typeDef, n.getId());
} else {
throw new RuntimeException("Unexpected arity: " + arity);
}
return defaultArg;
case JJTONLYKEYWORDARG:
case JJTDEFAULTARG:
//no type definition in this case
if (arity == 1) {
return new DefaultArg(((exprType) stack.popNode()), null, null, n.getId());
}
exprType parameter = (exprType) stack.popNode();
return new DefaultArg((exprType) stack.popNode(), parameter, null, n.getId());
case JJTEXTRAARGLIST:
if (arity == 0) {
//nothing here (just '*')
return new ExtraArg(null, JJTEXTRAARGLIST, null);
}