docs: def consume_input(self, mystr, stack=[], state=1, curchar=0, depth=0):
          """
          Consumes an input and validates if it is accepted
          Args:
              mystr (str): the input string to be consumes
              stack (list): the stack of symbols
              state (int): the current state of the PDA
              curchar (int): the index of the consumed character
              depth (int): the depth of the function call in the stack
          Returns:
              bool: A value indicating the correct or erroneous execution
          """
          mystrsplit = mystr.split(' ')
          if self.s[state].type == 1:
              stack.append(self.s[state].sym)
              if len(self.s[state].trans) > 0:
                  state = self.s[state].trans[0]
                  if self.parse(
                          mystr,
                          stack=stack,
                          state=state,
                          curchar=curchar,
                          depth=depth + 1) == 1:
                      return True
              return False
          if self.s[state].type == 2:
              if len(stack) == 0:
                  return False
              sym = stack.pop()
              for key in self.s[state].trans:
                  if sym in self.s[state].trans[key]:
                      if self.parse(
                              mystr,
                              stack=stack,
                              state=key,
                              curchar=curchar,
                              depth=depth + 1) == 1:
                          return True
              return False
          if self.s[state].type == 3:
              for key in self.s[state].trans:
                  if mystrsplit[curchar] in self.s[state].trans[key]:
                      # print 'found '
                      if curchar + 1 == len(mystrsplit) \
                              and 'closing' in self.s[key].trans:
                          return True
                      elif curchar + 1 == len(mystrsplit):
                          return False
  
                      # print 'lets try as next state the state ' + repr(key)
                      if self.parse(
                              mystr,
                              stack=stack,
                              state=key,
                              curchar=curchar + 1,
                              depth=depth + 1) == 1:
                          return True
              return False