private List<DtPiece> parseModifiers(String dataTypeModifiers) throws InvalidDataTypeException {

		int arrayStartIndex = -1;
		List<DtPiece> modifiers = new ArrayList<>();
		boolean terminalModifier = false;
		for (String piece : splitDataTypeModifiers(dataTypeModifiers)) {
			piece = piece.trim();
			if (terminalModifier) {
				throw new InvalidDataTypeException("Invalid data type modifier");
			}
			if (piece.startsWith("*")) {
				modifiers.add(new PointerSpecPiece(piece));
				arrayStartIndex = -1;
			}
			else if (piece.startsWith("[")) {
				// group of array specifications are reversed for proper data-type creation order
				ArraySpecPiece arraySpec = new ArraySpecPiece(piece);
				if (arrayStartIndex >= 0) {
					modifiers.add(arrayStartIndex, arraySpec);
				}
				else {
					arrayStartIndex = modifiers.size();
					modifiers.add(arraySpec);
				}
			}
			else if (piece.startsWith(":")) {
				terminalModifier = true;
				modifiers.add(new BitfieldSpecPiece(piece));
			}
			else if (piece.startsWith("{")) {
				// # indicates the size of an array element when the base data type is dynamic.
				modifiers.add(new ElementSizeSpecPiece(piece));
				arrayStartIndex = -1;
			}
		}
		return modifiers;
	}
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