def analyze(self, text, blkpath = None):
        '''
        Analyze the text to establish blocks.

        @param text: Text to be analyzed.
        @type text: str
        @param blkpath: Block path to the text.
        @type blkpath: list

        @return: Content which blocks are replaced with symbols.
        @rtype: str

        @raise TemplateError: If symbol reassignment occurs.
        '''

        if blkpath is None: blkpath = []

        result = text

        while True:
            matobj = Template.blkpat.search(result)
            if matobj is None: break
            blkname = matobj.group('blkname')
            symbol = string.join(blkpath + [blkname], '.')
            blkbody = matobj.group('blkbody')
            (result, _) = Template.blkpat.subn(
                '[[:%s:]]' % symbol, result, 1
            )
            value = self.analyze(blkbody, blkpath + [blkname])

            if symbol not in self.symtab.keys():
                self.symtab[symbol] = value
            else:
                raise TemplateError, \
                'Reassigning the same symbol (%s).' % symbol

        return result

        Analyze the text to establish blocks.

        @param text: Text to be analyzed.
        @type text: str
        @param blkpath: Block path to the text.
        @type blkpath: list

        @return: Content which blocks are replaced with symbols.
        @rtype: str

        @raise TemplateError: If symbol reassignment occurs.
        
recipes/Python/231512_Efficient_Comfortable_HTMLTemplate/recipe-231512.py