def METHOD_NAME(self, params):
    pfx_re = '(%s)' % '|'.join(self.all_pfx)
    for n in params:
        fix_tmpl_refs(self.all_pre_gen, '%% '+n, "%% "+n+"  "+params[n])
    fix_tmpl_refs_re(self.all_post_gen,
                     '%' + pfx_re + '([^:]|$)', r'\1\2')
    # process %if ... [%else] ... %fi
    rmidx_l = []
    if_seq = False
    outcome = False  # unnecessary, but to appease lints
    for i in range(len(self.all_post_gen)):
        s = self.all_post_gen[i]
        if if_seq:
            a = s.split()
            if len(a) >= 1 and a[0] == '%fi':
                if_seq = False
                rmidx_l.append(i)
            elif len(a) >= 1 and a[0] == '%else':
                outcome = not outcome
                rmidx_l.append(i)
            else:
                if not outcome:
                    rmidx_l.append(i)
            continue
        if not s:
            continue
        a = s.split()
        if len(a) == 2 and a[0] == '%if':
            outcome = not a[1].startswith('%')  # not replaced -> false
            if_seq = True
            rmidx_l.append(i)
    rmidx_l.reverse()
    for i in rmidx_l:
        del self.all_post_gen[i]