def get_tokens(self):
try:<EOL><INDENT>while True:<EOL><INDENT>token = self.lexer.token()<EOL>if not token:<EOL><INDENT>break<EOL><DEDENT>yield token<EOL><DEDENT><DEDENT>except QasmError as e:<EOL><INDENT>print('<STR_LIT>', e.msg)<EOL><DEDENT>
Returns a generator of the tokens.