'Set the index to which the functions relate. Note that it must be
in the same statement.'

def set_index(self, index):

    indexinrawtext = (len(self.rawtext) - len(self.text.get(index, self.stopatindex)))
    if (indexinrawtext < 0):
        raise ValueError('The    index    given    is    before    the    analyzed    statement')
    self.indexinrawtext = indexinrawtext
    self.indexbracket = 0
    while ((self.indexbracket < (len(self.bracketing) - 1)) and (self.bracketing[(self.indexbracket + 1)][0] < self.indexinrawtext)):
        self.indexbracket += 1
    if ((self.indexbracket < (len(self.bracketing) - 1)) and (self.bracketing[(self.indexbracket + 1)][0] == self.indexinrawtext) and (not self.isopener[(self.indexbracket + 1)])):
        self.indexbracket += 1
