def exitRule(self, listener: ParseTreeListener):
    if hasattr(listener, 'exitProgram'):
        listener.exitProgram(self)
def exitRule(self, listener: ParseTreeListener):
    if hasattr(listener, 'exitProgram'):
        listener.exitProgram(self)