protected JavaCompiledState compileJavaParser(boolean leftRecursive) throws IOException {
        String grammarFileName = leftRecursive ? "JavaLR.g4"    : "Java.g4";
        String parserName      = leftRecursive ? "JavaLRParser" : "JavaParser";
        String lexerName       = leftRecursive ? "JavaLRLexer"  : "JavaLexer";
        String body = load(grammarFileName);
        List<String> extraOptions = new ArrayList<String>();
		extraOptions.add("-Werror");
        if (FORCE_ATN) {
            extraOptions.add("-Xforce-atn");
        }
        if (EXPORT_ATN_GRAPHS) {
            extraOptions.add("-atn");
        }
		if (DEBUG_TEMPLATES) {
			extraOptions.add("-XdbgST");
			if (DEBUG_TEMPLATES_WAIT) {
				extraOptions.add("-XdbgSTWait");
			}
		}
        String[] extraOptionsArray = extraOptions.toArray(new String[0]);

		RunOptions runOptions = createOptionsForJavaToolTests(grammarFileName, body, parserName, lexerName,
				false, true, null, null,
				false, false, Stage.Compile);
		try (RuntimeRunner runner = new JavaRunner()) {
			return (JavaCompiledState) runner.run(runOptions);
		}
    }
This method is separate from {@link #parse1} so the first pass can be distinguished when analyzing
 profiler results.
tool-testsuite/test/org/antlr/v4/test/tool/TestPerformance.java