public boolean writeQueryFile(File queryTextFile) throws Exception {

		PrintWriter writer = new PrintWriter(queryTextFile);
		writeHeader(writer);

		for (TaintLabel mark : sources) {
			if (mark.isActive()) {
				writeRule(writer, mark, true);
			}
		}

		for (TaintLabel mark : sinks) {
			if (mark.isActive()) {
				// CAREFUL note the "false"
				writeRule(writer, mark, false);
			}
		}

		if (!gates.isEmpty()) {
			for (TaintLabel mark : gates) {
				if (mark.isActive()) {
					writeGate(writer, mark);
				}
			}
		}

		writeFooter(writer);
		
		writer.flush();
		writer.close();

		plugin.consoleMessage("Wrote Query File: " + queryTextFile);

		return true;
	}
Write the datalog query file that the engine will use to generate results.

<p>
The artifacts (e.g., sources) that are used in the datalog query are those
selected by the user via the menu.

@param queryTextFile - file containing the query
@return success
@throws Exception - on write
Ghidra/Features/DecompilerDependent/src/main/java/ghidra/app/plugin/core/decompiler/taint/AbstractTaintState.java