@Test
	public void testImportLeftRecursiveGrammar(@TempDir Path tempDir) {
		String tempDirPath = tempDir.toString();
		String slave =
			"grammar Java;\n" +
			"e : '(' e ')'\n" +
			"  | e '=' e\n" +
			"  | ID\n" +
			"  ;\n" +
			"ID : [a-z]+ ;\n";
		String master =
			"grammar T;\n" +
			"import Java;\n" +
			"s : e ;\n";

		FileUtils.mkdir(tempDirPath);
		writeFile(tempDirPath, "Java.g4", slave);
		ExecutedState executedState = execParser(
				"T.g4", master, "TParser", "TLexer", "s", "a=b", debug,
				tempDir);
		assertEquals("", executedState.output);
		assertEquals("", executedState.errors);
	}
This is a regression test for antlr/antlr4#670 "exception when importing
grammar".
https://github.com/antlr/antlr4/issues/670
tool-testsuite/test/org/antlr/v4/test/tool/TestCompositeGrammars.java