class_docstr: Parser for VT100 input stream.
  
  Feed the data through the `feed` method and the correct callbacks of the
  `input_processor` will be called.
  
  ::
  
      def callback(key):
          pass
      i = InputStream(callback)
      i.feed('data...')
  
  :attr input_processor: :class:`~prompt_toolkit.key_binding.InputProcessor` instance.
docstr: Coroutine (state machine) for the input parser.
docstr_tok: ["Coroutine","(","state","machine",")","for","the","input","parser","."]
code: def _input_parser_generator(self):
      """
      Coroutine (state machine) for the input parser.
      """
      prefix = ""
      retry = False
      flush = False
  
      while True:
          flush = False
  
          if retry:
              retry = False
          else:
              # Get next character.
              c = yield
  
              if c == _Flush:
                  flush = True
              else:
                  prefix += c
  
          # If we have some data, check for matches.
          if prefix:
              is_prefix_of_longer_match = (
                  _IS_PREFIX_OF_LONGER_MATCH_CACHE[prefix]
              )
              match = self._get_match(prefix)
  
              # Exact matches found, call handlers..
              if (flush or not is_prefix_of_longer_match) and match:
                  self._call_handler(match, prefix)
                  prefix = ""
  
              # No exact match found.
              elif (
                  flush or not is_prefix_of_longer_match
              ) and not match:
                  found = False
                  retry = True
  
                  # Loop over the input, try the longest match first and
                  # shift.
                  for i in range(len(prefix), 0, -1):
                      match = self._get_match(prefix[:i])
                      if match:
                          self._call_handler(match, prefix[:i])
                          prefix = prefix[i:]
                          found = True
  
                  if not found:
                      self._call_handler(prefix[0], prefix[0])
                      prefix = prefix[1:]
  
imports: from __future__ import unicode_literals
  import os
  import re
  import six
  import termios
  import tty
  from six.moves import range
  from ..keys import Keys
  from ..key_binding.input_processor import KeyPress
label_desc: Use image node_id 5 for calling the InputStream obj's underlying member method code with example usage: obj._input_parser_generator() without return types