code: def scan(self, string):
      result = []
      append = result.append
      match = self.scanner.scanner(string).match
      i = 0
      while True:
          m = match()
          if not m:
              break
          j = m.end()
          if i == j:
              break
          action = self.lexicon[m.lastindex - 1][1]
          if callable(action):
              self.match = m
              action = action(self, m.group())
          if action is not None:
              append(action)
          i = j
      return result, string[i:]
  
imports: import enum
  from .None import _compiler, _parser
  import functools
  import copyreg
label_desc: Use image node_id 2 for calling the Scanner obj's underlying member method code with example usage: obj.scan(string) and returns: result,  string