public void setFormat(String formatName) {
		STGroupFile loadedFormat;

		synchronized (loadedFormats) {
			loadedFormat = loadedFormats.get(formatName);
			if (loadedFormat == null) {
				String fileName = FORMATS_DIR + formatName + STGroup.GROUP_FILE_EXTENSION;
				ClassLoader cl = Thread.currentThread().getContextClassLoader();
				URL url = cl.getResource(fileName);
				if (url == null) {
					cl = ErrorManager.class.getClassLoader();
					url = cl.getResource(fileName);
				}
				if (url == null && formatName.equals("antlr")) {
					rawError("ANTLR installation corrupted; cannot find ANTLR messages format file " + fileName);
					panic();
				}
				else if (url == null) {
					rawError("no such message format file " + fileName + " retrying with default ANTLR format");
					setFormat("antlr"); // recurse on this rule, trying the default message format
					return;
				}
				loadedFormat = new STGroupFile(url, "UTF-8", '<', '>');
				loadedFormat.load();

				loadedFormats.put(formatName, loadedFormat);
			}
		}

		this.formatName = formatName;
		this.format = loadedFormat;

		if (!initSTListener.errors.isEmpty()) {
			rawError("ANTLR installation corrupted; can't load messages format file:\n" +
					initSTListener.toString());
			panic();
		}

		boolean formatOK = verifyFormat();
		if (!formatOK && formatName.equals("antlr")) {
			rawError("ANTLR installation corrupted; ANTLR messages format file " + formatName + ".stg incomplete");
			panic();
		}
		else if (!formatOK) {
			setFormat("antlr"); // recurse on this rule, trying the default message format
		}
	}
The format gets reset either from the Tool if the user supplied a command line option to that effect
 Otherwise we just use the default "antlr".
tool/src/org/antlr/v4/tool/ErrorManager.java