def register_token(self, token_class, regexp=None):
if regexp is None:<EOL><INDENT>regexp = token_class.regexp<EOL><DEDENT>self.tokens.register(token_class, regexp)<EOL>
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.