def METHOD_NAME(self, recognizer, dfa, startIndex,
                   stopIndex, exact, ambigAlts, configs):
    if self.exactOnly and not exact:
        return
    with StringIO() as buf:
        buf.write(u"reportAmbiguity d=")
        buf.write(self.getDecisionDescription(recognizer, dfa))
        buf.write(u": ambigAlts=")
        buf.write(str_set(self.getConflictingAlts(ambigAlts, configs)))
        buf.write(u", input='")
        buf.write(recognizer.getTokenStream().getText(startIndex, stopIndex))
        buf.write(u"'")
        recognizer.notifyErrorListeners(buf.getvalue())