private DataType parseDataTypeModifiers(DataType namedDataType, String dataTypeModifiers)
			throws InvalidDataTypeException {

		List<DtPiece> modifiers = parseModifiers(dataTypeModifiers);
		DataType dt = namedDataType;
		int elementLength = dt.getLength();
		try {
			for (DtPiece modifier : modifiers) {
				if (modifier instanceof PointerSpecPiece) {
					int pointerSize = ((PointerSpecPiece) modifier).getPointerSize();
					dt = new PointerDataType(dt, pointerSize, destinationDataTypeManager);
					elementLength = dt.getLength();
				}
				else if (modifier instanceof ElementSizeSpecPiece) {
					if (elementLength <= 0) {
						elementLength = ((ElementSizeSpecPiece) modifier).getElementSize();
					}
				}
				else if (modifier instanceof ArraySpecPiece) {
					int elementCount = ((ArraySpecPiece) modifier).getElementCount();
					dt = createArrayDataType(dt, elementLength, elementCount);
					elementLength = dt.getLength();
				}
				else if (modifier instanceof BitfieldSpecPiece) {
					if (allowedTypes != AllowedDataTypes.SIZABLE_DYNAMIC_AND_BITFIELD) {
						throw new InvalidDataTypeException("Bitfield not permitted");
					}
					if (destinationDataTypeManager == null) {
						throw new AssertException(
							"Bitfields require destination datatype manager to be specified");
					}
					int bitSize = ((BitfieldSpecPiece) modifier).getBitSize();
					dt = new ProxyBitFieldDataType(dt.clone(destinationDataTypeManager), bitSize);
				}
			}
		}
		catch (IllegalArgumentException e) {
			throw new InvalidDataTypeException(e.getMessage());
		}
		ensureIsAllowableType(dt, allowedTypes);
		return dt;
	}
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