public FunctionDefinitionDataType parse(FunctionSignature originalSignature,
			String signatureText) throws ParseException, CancelledException {
		dtMap.clear();
		nameMap.clear();
		if (dtmService != null) {
			dtmService.clearCache(); // clear datatype selection cache
		}

		if (originalSignature != null) {
			initDataTypeMap(originalSignature);
			signatureText = cleanUpSignatureText(signatureText, originalSignature);
		}

		String functionName = extractFunctionName(signatureText);
		FunctionDefinitionDataType function =
			new FunctionDefinitionDataType(functionName, destDataTypeManager);

		function.setReturnType(extractReturnType(signatureText));
		function.setArguments(extractArguments(signatureText));
		function.setVarArgs(hasVarArgs(signatureText));

		return function;
	}
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