void write(JsonArray results, AddressSetView addrs, TaskMonitor m) throws IOException, CancelledException {
		this.monitor = m;
		m.setMessage("Writing PROGRAM TREES ...");

		List<Pair<String, ProgramModule>> request = new ArrayList<>();
		String[] treeNames = listing.getTreeNames();

		for (String n : treeNames) {
			if (m.isCancelled()) {
				throw new CancelledException();
			}
			ProgramModule root = listing.getRootModule(n);
			request.add(new Pair<String, ProgramModule>(n, root));
		}

		writeAsSARIF(request, results);
	}
Write out the SARIF for the program trees.

@param results writer for SARIF
@param addrs   the addresses
@param m       monitor that can be canceled should be written
@throws CancelledException if cancelled
Ghidra/Features/Sarif/src/main/java/sarif/managers/ProgramTreeSarifMgr.java