@Override
 public void reportContextSensitivity(
     @NotNull Parser recognizer,
     @NotNull DFA dfa,
     int startIndex,
     int stopIndex,
     @NotNull ATNConfigSet configs) {
   recognizer.notifyErrorListeners(
       "reportContextSensitivity d="
           + dfa.decision
           + ", input='"
           + recognizer.getTokenStream().getText(Interval.of(startIndex, stopIndex))
           + "'");
 }
 @Override
 public void reportContextSensitivity(
     @NotNull Parser recognizer,
     @NotNull DFA dfa,
     int startIndex,
     int stopIndex,
     int prediction,
     @NotNull ATNConfigSet configs) {
   String format = "reportContextSensitivity d=%s, input='%s'";
   String decision = getDecisionDescription(recognizer, dfa);
   String text = recognizer.getTokenStream().getText(Interval.of(startIndex, stopIndex));
   String message = String.format(format, decision, text);
   recognizer.notifyErrorListeners(message);
 }
 @Override
 public void reportAmbiguity(
     @NotNull Parser recognizer,
     DFA dfa,
     int startIndex,
     int stopIndex,
     @NotNull IntervalSet ambigAlts,
     @NotNull ATNConfigSet configs) {
   recognizer.notifyErrorListeners(
       "reportAmbiguity d="
           + dfa.decision
           + ": ambigAlts="
           + ambigAlts
           + ", input='"
           + recognizer.getTokenStream().getText(Interval.of(startIndex, stopIndex))
           + "'");
 }
  @Override
  public void reportAmbiguity(
      @NotNull Parser recognizer,
      @NotNull DFA dfa,
      int startIndex,
      int stopIndex,
      boolean exact,
      @Nullable BitSet ambigAlts,
      @NotNull ATNConfigSet configs) {
    if (exactOnly && !exact) {
      return;
    }

    String format = "reportAmbiguity d=%s: ambigAlts=%s, input='%s'";
    String decision = getDecisionDescription(recognizer, dfa);
    BitSet conflictingAlts = getConflictingAlts(ambigAlts, configs);
    String text = recognizer.getTokenStream().getText(Interval.of(startIndex, stopIndex));
    String message = String.format(format, decision, conflictingAlts, text);
    recognizer.notifyErrorListeners(message);
  }