}
// Parameters
eat("(");
List<TypeSignature> paramList = new ArrayList<TypeSignature>();
while (!maybeEat(")")) {
FieldTypeSignature fsig = parseFieldTypeSignature(true);
if (fsig != null) {
paramList.add(fsig);
} else {
paramList.add(new GenericSignature.BaseTypeSignature(eatIdentifier()));
}
}
TypeSignature[] params = new TypeSignature[paramList.size()];
paramList.toArray(params);
// return type
returnType = parseFieldTypeSignature(true);
if (returnType == null)
returnType = new GenericSignature.BaseTypeSignature(eatIdentifier());
// throws
List<FieldTypeSignature> throwsList = new ArrayList<FieldTypeSignature>();
while (maybeEat("^")) {
FieldTypeSignature fsig = parseFieldTypeSignature(false);
throwsList.add(fsig);
}
FieldTypeSignature[] throwsSigs = new FieldTypeSignature[throwsList.size()];
throwsList.toArray(throwsSigs);
return new GenericSignature.MethodTypeSignature(formals, params, returnType, throwsSigs);