class_docstr: A Scanner is used to read tokens from a stream of characters
  using the token set specified by a Plex.Lexicon.
  
  Constructor:
  
    Scanner(lexicon, stream, name = '')
  
      See the docstring of the __init__ method for details.
  
  Methods:
  
    See the docstrings of the individual methods for more
    information.
  
    read() --> (value, text)
      Reads the next lexical token from the stream.
  
    position() --> (name, line, col)
      Returns the position of the last token read using the
      read() method.
  
    begin(state_name)
      Causes scanner to change state.
  
    produce(value [, text])
      Causes return of a token value to the caller of the
      Scanner.
code: def next_char(self):
      input_state = self.input_state
      if self.trace:
          print(
              "Scanner: next: %s [%d] %d"
              % (" " * 20, 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 += 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 %r"
              % (input_state, self.cur_pos, self.cur_char)
          )
  
file_path: catboost/contrib/tools/cython/Cython/Plex/Scanners.py
imports: from __future__ import absolute_import
  import cython
  from .None import Errors
  from .Regexps import BOL, EOL, EOF
label_desc: Use image node_id 5 for calling the Scanner obj's underlying member method code with example usage: obj.next_char() without return types