static SimpleLanguageTranslator getSimpleLanguageTranslator(String translatorSpecSource,
			Element languageTranslationElement) throws SAXException {

		if (!"language_translation".equals(languageTranslationElement.getName())) {
			throw new SAXNotRecognizedException("Expected language_translation document");
		}

		LanguageID fromLanguageID = null;
		LanguageID toLanguageID = null;
		int fromLanguageVersion = -1;
		int toLanguageVersion = -1;

		Map<String, String> spaceMap = new HashMap<String, String>();
		Map<String, String> registerMap = new HashMap<String, String>();
		Map<String, BigInteger> contextSettings = new HashMap<String, BigInteger>();
		Map<String, String> compilerSpecMap = new HashMap<String, String>();
		boolean clearAllContext = false;
		Class<? extends LanguagePostUpgradeInstructionHandler> postUpgradeInstructionHandlerClass =
			null;

		HashSet<String> newSpacesMapped = new HashSet<String>();
		Iterator<?> iter = languageTranslationElement.getChildren().iterator();
		while (iter.hasNext()) {
			Element element = (Element) iter.next();
			String elementName = element.getName();
			if ("from_language".equals(elementName)) {
				if (fromLanguageID != null) {
					throw new SAXException("only one 'from_language' element permitted");
				}
				fromLanguageVersion = parseIntAttribute(element, "version");
				fromLanguageID = getLanguageId(element.getText());
			}
			else if ("to_language".equals(elementName)) {
				if (toLanguageID != null) {
					throw new SAXException("only one 'to_language' element permitted");
				}
				toLanguageVersion = parseIntAttribute(element, "version");
				toLanguageID = getLanguageId(element.getText());
			}
			else if ("map_space".equals(elementName)) {
				parseMapEntry(element, spaceMap, newSpacesMapped);
			}
			else if ("delete_space".equals(elementName)) {
				parseDeleteEntry(element, spaceMap);
			}
			else if ("map_register".equals(elementName)) {
				parseMapEntry(element, registerMap, null);
			}
			else if ("set_context".equals(elementName)) {
				parseSetContext(element, contextSettings);
			}
			else if ("clear_all_context".equals(elementName)) {
				clearAllContext = true;
			}
			else if ("map_compiler_spec".equals(elementName)) {
				parseMapEntry(element, compilerSpecMap, null);
			}
			else if ("post_upgrade_handler".equals(elementName)) {
				if (postUpgradeInstructionHandlerClass != null) {
					throw new SAXException("Only a single post_upgrade_analzer may be specified");
				}
				postUpgradeInstructionHandlerClass = parsePostUpgradeHandlerEntry(element);
			}
			else {
				throw new SAXException(
					"Unsupported language translator element '" + elementName + "'");
			}
		}

		if (fromLanguageID == null || fromLanguageID.getIdAsString().trim().length() == 0) {
			throw new SAXException("Missing valid 'from_language' element");
		}
		if (toLanguageID == null || toLanguageID.getIdAsString().trim().length() == 0) {
			throw new SAXException("Missing valid 'to_language' element");
		}
		if (fromLanguageID.equals(toLanguageID) && fromLanguageVersion >= toLanguageVersion) {
			throw new SAXException("Invalid language translator versions: " + fromLanguageVersion +
				" -> " + toLanguageVersion);
		}

		SimpleLanguageTranslator translator = new SimpleLanguageTranslator(translatorSpecSource,
			fromLanguageID, fromLanguageVersion, toLanguageID, toLanguageVersion);
		translator.spaceNameMap.putAll(spaceMap);
		translator.registerNameMap.putAll(registerMap);
		translator.contextSettings.putAll(contextSettings);
		translator.compilerSpecMap.putAll(compilerSpecMap);
		translator.clearAllContext = clearAllContext;
		translator.postUpgradeInstructionHandlerClass = postUpgradeInstructionHandlerClass;
		return translator;
	}
Generate a simple language translator from XML source

@param translatorSpecSource
@param languageTranslationElement
@return simple language translator
@throws SAXException
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/util/SimpleLanguageTranslator.java