public final static String formatAsObjectiveC(FunctionSignature signature,
			ObjectiveC_MethodType methodType, boolean appendSemicolon)
			throws IllegalStateException {
		int colonCount = StringUtilities.countOccurrences(signature.getName(), ':');

		StringTokenizer tokenizer = new StringTokenizer(signature.getName(), ":");
		StringBuffer buffer = new StringBuffer();
		buffer.append(methodType.getIndicator());
		buffer.append(' ');
		buffer.append('(' + signature.getReturnType().getDisplayName() + ')');
		buffer.append(' ');
		ParameterDefinition[] arguments = signature.getArguments();
		int argumentIndex = 2;//skip ID and SEL

		if (arguments.length - 2 != colonCount - 1 && arguments.length - 2 != colonCount) {
			throw new IllegalStateException("Invalid amount of arguments.");
		}
		List<String> tokenList = new ArrayList<String>();
		while (tokenizer.hasMoreTokens()) {
			tokenList.add(tokenizer.nextToken());
		}
		while (tokenList.size() < colonCount) {
			tokenList.add("");
		}
		for (String token : tokenList) {
			buffer.append(token);
			if (argumentIndex < arguments.length) {
				buffer.append(':');
				buffer.append('(' + arguments[argumentIndex].getDataType().getDisplayName() + ')');
				buffer.append("arg" + argumentIndex);
				++argumentIndex;
				if (argumentIndex < arguments.length) {
					buffer.append(' ');
				}
			}
		}
		if (appendSemicolon) {
			buffer.append(';');
		}
		return buffer.toString();
	}
Creates a namespace hierarchy using the list of strings specified in namespacePath.
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/objectiveC/ObjectiveC1_Utilities.java