def _parse_template_declaration_prefix(self, objectType: str) -> ASTTemplateDeclarationPrefix:
    templates = []
    while 1:
        self.skip_ws()
        params = None
        pos = self.pos
        if self.skip_word('template'):
            try:
                params = self._parse_template_parameter_list()
            except DefinitionError as e:
                if ((objectType == 'member') and (len(templates) == 0)):
                    return ASTTemplateDeclarationPrefix(None)
                else:
                    raise e
        else:
            params = self._parse_template_introduction()
            if (not params):
                break
        if ((objectType == 'concept') and (len(templates) > 0)):
            self.pos = pos
            self.fail('More than 1 template parameter list for concept.')
        templates.append(params)
    if ((len(templates) == 0) and (objectType == 'concept')):
        self.fail('Missing template parameter list for concept.')
    if (len(templates) == 0):
        return None
    else:
        return ASTTemplateDeclarationPrefix(templates)
def _parse_template_declaration_prefix(self, objectType: str) -> ASTTemplateDeclarationPrefix:
    templates = []
    while 1:
        self.skip_ws()
        params = None
        pos = self.pos
        if self.skip_word('template'):
            try:
                params = self._parse_template_parameter_list()
            except DefinitionError as e:
                if ((objectType == 'member') and (len(templates) == 0)):
                    return ASTTemplateDeclarationPrefix(None)
                else:
                    raise e
        else:
            params = self._parse_template_introduction()
            if (not params):
                break
        if ((objectType == 'concept') and (len(templates) > 0)):
            self.pos = pos
            self.fail('More than 1 template parameter list for concept.')
        templates.append(params)
    if ((len(templates) == 0) and (objectType == 'concept')):
        self.fail('Missing template parameter list for concept.')
    if (len(templates) == 0):
        return None
    else:
        return ASTTemplateDeclarationPrefix(templates)