code: def parse(self, tokenized):  # pylint: disable=invalid-name
          
          table, trees = _parse(tokenized, self.grammar)
          # Check if the parse succeeded.
          if all(r.lhs != self.start for r in table[(0, len(tokenized) - 1)]):
              raise ParseError('Parsing failed.')
          parse = trees[(0, len(tokenized) - 1)][self.start]
          return self._to_tree(revert_cnf(parse))
docs: Parses input, which is a list of tokens.