private static void getMatchingDataTypesReferencesFromDataAndSubData(
			Accumulator<LocationReference> accumulator, Data data, FieldMatcher fieldMatcher,
			Predicate<Data> dataMatcher, TaskMonitor monitor) throws CancelledException {

		if (dataMatcher.test(data)) {
			getMatchingDataTypesReferencesFromData(accumulator, data, fieldMatcher, monitor);
		}

		// We know that arrays are all the same element; we decided to just mark the beginning.
		// This will provide an immense speed-up for large arrays (like 10s-100s of thousands
		// of array elements).
		if (data.getBaseDataType() instanceof Array) {
			return;
		}

		int numComponents = data.getNumComponents();
		for (int i = 0; i < numComponents; i++) {
			monitor.checkCancelled();

			Data subData = data.getComponent(i);
			getMatchingDataTypesReferencesFromDataAndSubData(accumulator, subData, fieldMatcher,
				dataMatcher, monitor);
		}
	}
Searches defined data for types that match, according to the given predicate.

@param accumulator the results accumulator
@param program the program
@param dataMatcher the predicate that determines a successful match
@param fieldMatcher the field matcher; will be ignored if it contains null values
@param monitor the task monitor used to track progress and cancel the work
@throws CancelledException if the operation was cancelled
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/ReferenceUtils.java