public void setLanguageAndCompiler(String languageId, String compilerSpecId)
			throws InvalidInputException {
		if (languageId == null && compilerSpecId == null) {
			return;
		}
		if (languageId == null) {
			throw new InvalidInputException("Compiler spec specified without specifying language.");
		}
		try {
			language =
				DefaultLanguageService.getLanguageService().getLanguage(new LanguageID(languageId));
			if (compilerSpecId == null) {
				compilerSpec = language.getDefaultCompilerSpec();
			}
			else {
				compilerSpec = language.getCompilerSpecByID(new CompilerSpecID(compilerSpecId));
			}
		}
		catch (LanguageNotFoundException e) {
			language = null;
			compilerSpec = null;
			throw new InvalidInputException("Unsupported language: " + languageId);
		}
		catch (CompilerSpecNotFoundException e) {
			language = null;
			compilerSpec = null;
			throw new InvalidInputException("Compiler spec \"" + compilerSpecId +
				"\" is not supported for language \"" + languageId + "\"");
		}
	}
Sets the language and compiler spec from the provided input. Any null value will attempt
a "best-guess" if possible.

@param languageId The language to set.
@param compilerSpecId The compiler spec to set.
@throws InvalidInputException if the language and compiler spec combination is not valid.
Ghidra/Features/Base/src/main/java/ghidra/app/util/headless/HeadlessOptions.java