'Return an unused terminal name'

def nextTerminalName(self, name):

    name2 = name
    i = 1
    while (name2 in self.terminals):
        name2 = ('%s.%d' % (name, i))
        i += 1
    return name2
