def next_char(self):
    input_state = self.input_state
    if self.trace:
      print "Scanner: next:", " "*20, "[%d] %d" % (input_state, self.cur_pos),
    if input_state == 1:
      self.cur_pos = self.next_pos
      c = self.read_char()
      if c == '\n':
        self.cur_char = EOL
        self.input_state = 2
      elif not c:
        self.cur_char = EOL
        self.input_state = 4
      else:
        self.cur_char = c
    elif input_state == 2:
      self.cur_char = '\n'
      self.input_state = 3
    elif input_state == 3:
      self.cur_line = self.cur_line + 1
      self.cur_line_start = self.cur_pos = self.next_pos
      self.cur_char = BOL
      self.input_state = 1
    elif input_state == 4:
      self.cur_char = EOF
      self.input_state = 5
    else: # input_state = 5
      self.cur_char = ''
    if self.trace:
      print "--> [%d] %d %s" % (input_state, self.cur_pos, repr(self.cur_char))
    
#	def read_char(self):
#		"""
#    Get the next input character, filling the buffer if necessary.
#    Returns '' at end of file.
#    """
#		next_pos = self.next_pos
#		buf_index = next_pos - self.buf_start_pos
#		if buf_index == len(self.buffer):
#			discard = self.start_pos - self.buf_start_pos
#			data = self.stream.read(0x1000)
#			self.buffer = self.buffer[discard:] + data
#			self.buf_start_pos = self.buf_start_pos + discard
#			buf_index = buf_index - discard
#			if not data:
#				return ''
#		c = self.buffer[buf_index]
#		self.next_pos = next_pos + 1
#		return c
dataset/ETHPy150Open ardekantur/pyglet/contrib/layout/layout/Plex/Scanners.py/Scanner.next_char/original