'Process the stream'

def process(self, stream):

    EOS_TTYPE = (T.Whitespace, T.Comment.Single)
    for (ttype, value) in stream:
        if (self.consume_ws and (ttype not in EOS_TTYPE)):
            (yield sql.Statement(self.tokens))
            self._reset()
        self.level += self._change_splitlevel(ttype, value)
        self.tokens.append(sql.Token(ttype, value))
        if ((self.level <= 0) and (ttype is T.Punctuation) and (value == ';')):
            self.consume_ws = True
    if self.tokens:
        (yield sql.Statement(self.tokens))
