<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def process(self, chars):
 """ Consume a string of and advance the state as necessary. """


        while len(chars) > 0:
            self.consume(chars[0])
            chars = chars[1:]