private ParameterDefinition[] extractArguments(String newSignatureText)
			throws ParseException, CancelledException {
		int startIndex = newSignatureText.indexOf('(');
		int endIndex = newSignatureText.indexOf(')');
		if (startIndex < 0 || endIndex < 0 || startIndex >= endIndex) {
			throw new ParseException("Can't parse function arguments");
		}
		String trailingText = newSignatureText.substring(endIndex + 1);
		if (trailingText.trim().length() > 0) {
			throw new ParseException(
				"Unexpected trailing text at end of function: " + trailingText);
		}

		String argString = newSignatureText.substring(startIndex + 1, endIndex).trim();
		if (argString.length() == 0) {
			return new ParameterDefinition[0];
		}
		if ("void".equalsIgnoreCase(argString)) {
			return new ParameterDefinition[0];
		}

		List<ParameterDefinition> parameterList = new ArrayList<>();
		String[] split = argString.split(",");

		for (String arg : split) {
			addParameter(parameterList, arg.trim());
		}
		return parameterList.toArray(new ParameterDefinition[parameterList.size()]);
	}
Parse the given function signature text into a FunctionDefinitionDataType.

@param originalSignature the function signature before editing. This may be
                         null if the user is entering a new signature instead
                         of editing an existing one.
@param signatureText     the text to be parsed into a function signature.
@return the FunctionDefinitionDataType resulting from parsing.
@throws ParseException if the text could not be parsed.
@throws CancelledException if parse cancelled by user
Ghidra/Features/Base/src/main/java/ghidra/app/util/parser/FunctionSignatureParser.java