public void addReplaceCompilerSpecExtension(String document, TaskMonitor monitor)
			throws LockException, SleighException, SAXException, XmlParseException {
		program.checkExclusiveAccess();
		monitor.setMessage("Testing validity of new document");
		DocInfo info = testExtensionDocument(document);
		monitor.setMessage("Installing " + info.getFormalName());
		Options specOptions = program.getOptions(SpecExtension.SPEC_EXTENSION);
		int progVersion = specOptions.getInt(SpecExtension.VERSION_COUNTER_OPTIONNAME, 0);
		progVersion = (progVersion + 1) % 0x40000000;	// Change the version number associated with the CompilerSpec
		specOptions.setString(info.getOptionName(), document);
		specOptions.setInt(SpecExtension.VERSION_COUNTER_OPTIONNAME, progVersion);
		specOptions.setInt(SpecExtension.FORMAT_VERSION_OPTIONNAME, SpecExtension.FORMAT_VERSION);
		program.installExtensions();
	}
Install or replace a spec extension to the program.  The extension is presented as
an XML document, from which a name is extracted.  If an extension previously existed
with the same name, it is overwritten.  Otherwise the document is treated as a new
extension.  Testing is performed before installation:
   - Document is parsed as XML and is verified against spec grammars
   - Internal p-code tags from InjectPayloads are compiled
   - Name collisions are checked for
@param document is the XML document describing the extension
@param monitor is a task monitor
@throws LockException if the caller does not exclusive access to the program
@throws XmlParseException for a badly formed extension document
@throws SAXException for parse errors in the extension document
@throws SleighException for a document that fails verification
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/SpecExtension.java