# File lib/html5/tokenizer.rb, line 49
    def each
      @token_queue = []
      # Start processing. When EOF is reached @state will return false
      # instead of true and the loop will terminate.
      while send @state
        yield :type => :ParseError, :data => @stream.errors.shift until @stream.errors.empty?
        yield @token_queue.shift until @token_queue.empty?
      end
    end