'Recursive function to extract strings from a parse tree'

def parseList(self, entry, tmpstr):

    if isinstance(entry, list):
        id = entry[0]
        value = entry[1]
        if isinstance(value, list):
            parseList = self.parseList
            for element in entry:
                parseList(element, tmpstr)
        elif (token.tok_name[id] == 'STRING'):
            tmpstr.append(value)
