private static String getBaseString(String dataTypeString) {
		int nextIndex = 0;
		int templateCount = 0;
		while (nextIndex < dataTypeString.length()) {
			char c = dataTypeString.charAt(nextIndex);
			if (c == '<') {
				templateCount++;
			}
			else if (c == '>') {
				templateCount--;
			}

			if (templateCount != 0) {
				++nextIndex;
				continue;
			}

			char n = nextIndex + 1 < dataTypeString.length() ? dataTypeString.charAt(nextIndex + 1)
					: '\0';
			if (c == ':' && n == ':') {
				nextIndex += 2;
				continue;
			}

			if (c == '*' || c == '[' || c == ':' || c == '{') {
				return dataTypeString.substring(0, nextIndex).trim();
			}
			++nextIndex;
		}
		return dataTypeString;
	}
Throws exception if the data type does not match the specified {@link AllowedDataTypes}.

@param dt {@link DataType} to check
@param allowedTypes {@link AllowedDataTypes enum} specifying what category of data types are ok
@throws InvalidDataTypeException if dt violates the specified allowedTypes
Ghidra/Features/Base/src/main/java/ghidra/util/data/DataTypeParser.java