@Test public void testInvalidEscapeSequences() {
		String grammar =
			"lexer grammar A;\n" +
			"RULE : 'Foo \\uAABG \\x \\u';\n";
		String expected =
			"error(" + ErrorType.INVALID_ESCAPE_SEQUENCE.code + "): A.g4:2:12: invalid escape sequence \\uAABG\n" +
			"error(" + ErrorType.INVALID_ESCAPE_SEQUENCE.code + "): A.g4:2:19: invalid escape sequence \\x\n" +
			"error(" + ErrorType.INVALID_ESCAPE_SEQUENCE.code + "): A.g4:2:22: invalid escape sequence \\u\n";

		String[] pair = new String[] {
			grammar,
			expected
		};

		testErrors(pair, true);
	}
This is a regression test for antlr/antlr4#507 "NullPointerException When
Generating Code from Grammar".
https://github.com/antlr/antlr4/issues/507
tool-testsuite/test/org/antlr/v4/test/tool/TestToolSyntaxErrors.java