void write(JsonArray results, AddressSetView set, TaskMonitor monitor)
			throws IOException, CancelledException {
		monitor.setMessage("Writing COMMENTS ...");

		if (set == null) {
			set = program.getMemory();
		}

		List<Pair<CodeUnit, Pair<String, String>>> request0 = new ArrayList<>();
		CodeUnitIterator iter = listing.getCodeUnitIterator(CodeUnit.COMMENT_PROPERTY, set, true);

		while (iter.hasNext()) {
			monitor.checkCancelled();
			CodeUnit cu = iter.next();
			for (CommentType type : CommentType.values()) {
				String[] comments = cu.getCommentAsArray(type);
				String typeStr = getCommentTypeString(type);
				for (String c : comments) {
					Pair<String, String> pair = new Pair<>(typeStr, c);
					request0.add(new Pair<CodeUnit, Pair<String, String>>(cu, pair));
				}
			}
		}

		writeAsSARIF0(request0, results);

		List<Pair<Address, Pair<String, String>>> request1 = new ArrayList<>();
		for (CommentType type : CommentType.values()) {
			AddressIterator aiter = listing.getCommentAddressIterator(type, set, true);
			while (aiter.hasNext()) {
				monitor.checkCancelled();
				Address a = aiter.next();
				CodeUnit cu = listing.getCodeUnitContaining(a);
				if (cu instanceof Instruction && !a.equals(cu.getMinAddress())) {
					String c = listing.getComment(type, a);
					Pair<String, String> pair = new Pair<>(getCommentTypeString(type), c);
					request1.add(new Pair<Address, Pair<String, String>>(a, pair));
				}
			}
		}

		writeAsSARIF1(request1, results);

	}
Write out the SARIF for the external entry points.

@param results writer for SARIF
@param set     address set that is either the entire program or a selection
@param monitor monitor that can be canceled should be written
@throws IOException
@throws CancelledException
Ghidra/Features/Sarif/src/main/java/sarif/managers/CommentsSarifMgr.java