Main function of compression.

def compress(self):
        """Main function of compression."""
        for ast_token in self.ast_tokens:
            if type(ast_token) in self.dispatcher:  # pylint: disable=unidiomatic-typecheck
                self.dispatcher[type(ast_token)](ast_token)
            else:
                self.dispatcher['default'](ast_token)