protected String getDecisionDescription(Parser recognizer, DFA dfa) {
		int decision = dfa.decision;
		int ruleIndex = dfa.atnStartState.ruleIndex;

		String[] ruleNames = recognizer.getRuleNames();
		if (ruleIndex < 0 || ruleIndex >= ruleNames.length) {
			return String.valueOf(decision);
		}

		String ruleName = ruleNames[ruleIndex];
		if (ruleName == null || ruleName.isEmpty()) {
			return String.valueOf(decision);
		}

		return String.format("%d (%s)", decision, ruleName);
	}
Initializes a new instance of {@link DiagnosticErrorListener}, specifying
whether all ambiguities or only exact ambiguities are reported.

@param exactOnly {@code true} to report only exact ambiguities, otherwise
{@code false} to report all ambiguities.
runtime/Java/src/org/antlr/v4/runtime/DiagnosticErrorListener.java