'Split ``text`` into (tokentype, text) pairs.
``stack`` is the inital stack (default: ``[\'root\']``)'

def get_tokens_unprocessed(self, text, stack=('root',)):

    self.pos = 0
    tokendefs = self._tokens
    self.statestack = list(stack)
    statetokens = tokendefs[self.statestack[(-1)]]
    while 1:
        for (rexmatch, action, new_state) in statetokens:
            self.m = m = rexmatch(text, self.pos)
            if m:
                if (type(action) is _TokenType):
                    (yield (self.pos, action, m.group()))
                else:
                    for item in action(self, m):
                        (yield item)
                self.pos = m.end()
                if (new_state is not None):
                    if isinstance(new_state, tuple):
                        for state in new_state:
                            if (state == '#pop'):
                                self.statestack.pop()
                            elif (state == '#push'):
                                self.statestack.append(self.statestack[(-1)])
                            else:
                                self.statestack.append(state)
                    elif isinstance(new_state, int):
                        del self.statestack[new_state:]
                    elif (new_state == '#push'):
                        self.statestack.append(self.statestack[(-1)])
                    else:
                        assert False, ('wrong    state    def:    %r' % new_state)
                    statetokens = tokendefs[self.statestack[(-1)]]
                break
        else:
            try:
                if (text[self.pos] == '\n'):
                    self.pos += 1
                    self.statestack = ['root']
                    statetokens = tokendefs['root']
                    (yield (self.pos, Text, u'\n'))
                    continue
                (yield (self.pos, Error, text[self.pos]))
                self.pos += 1
            except IndexError:
                break
