<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register_token(self, token_class, regexp=None):
 """Register a token class. Args: token_class (tdparser.Token):
 the token class to register regexp (optional str):
 the regexp for elements of that token. Defaults to the `regexp` attribute of the token class. """

        if regexp is None:
            regexp = token_class.regexp

        self.tokens.register(token_class, regexp)