def _parse_declarator_name_suffix(self, named: Union[(bool, str)], paramMode: str, typed: bool) -> Union[(ASTDeclaratorNameParamQual, ASTDeclaratorNameBitField)]:
    if (named == 'maybe'):
        pos = self.pos
        try:
            declId = self._parse_nested_name()
        except DefinitionError:
            self.pos = pos
            declId = None
    elif (named == 'single'):
        if self.match(identifier_re):
            identifier = ASTIdentifier(self.matched_text)
            nne = ASTNestedNameElement(identifier, None)
            declId = ASTNestedName([nne], [False], rooted=False)
            self.skip_ws()
            if (self.current_char == ':'):
                self.fail("Unexpected ':' after identifier.")
        else:
            declId = None
    elif named:
        declId = self._parse_nested_name()
    else:
        declId = None
    arrayOps = []
    while 1:
        self.skip_ws()
        if (typed and self.skip_string('[')):
            self.skip_ws()
            if self.skip_string(']'):
                arrayOps.append(ASTArray(None))
                continue

            def parser() -> ASTExpression:
                return self._parse_expression()
            value = self._parse_expression_fallback([']'], parser)
            if (not self.skip_string(']')):
                self.fail("Expected ']' in end of array operator.")
            arrayOps.append(ASTArray(value))
            continue
        else:
            break
    paramQual = self._parse_parameters_and_qualifiers(paramMode)
    if ((paramQual is None) and (len(arrayOps) == 0)):
        if (named and (paramMode == 'type') and typed):
            self.skip_ws()
            if self.skip_string(':'):
                size = self._parse_constant_expression(inTemplate=False)
                return ASTDeclaratorNameBitField(declId=declId, size=size)
    return ASTDeclaratorNameParamQual(declId=declId, arrayOps=arrayOps, paramQual=paramQual)
def _parse_declarator_name_suffix(self, named: Union[(bool, str)], paramMode: str, typed: bool) -> Union[(ASTDeclaratorNameParamQual, ASTDeclaratorNameBitField)]:
    if (named == 'maybe'):
        pos = self.pos
        try:
            declId = self._parse_nested_name()
        except DefinitionError:
            self.pos = pos
            declId = None
    elif (named == 'single'):
        if self.match(identifier_re):
            identifier = ASTIdentifier(self.matched_text)
            nne = ASTNestedNameElement(identifier, None)
            declId = ASTNestedName([nne], [False], rooted=False)
            self.skip_ws()
            if (self.current_char == ':'):
                self.fail("Unexpected ':' after identifier.")
        else:
            declId = None
    elif named:
        declId = self._parse_nested_name()
    else:
        declId = None
    arrayOps = []
    while 1:
        self.skip_ws()
        if (typed and self.skip_string('[')):
            self.skip_ws()
            if self.skip_string(']'):
                arrayOps.append(ASTArray(None))
                continue

            def parser() -> ASTExpression:
                return self._parse_expression()
            value = self._parse_expression_fallback([']'], parser)
            if (not self.skip_string(']')):
                self.fail("Expected ']' in end of array operator.")
            arrayOps.append(ASTArray(value))
            continue
        else:
            break
    paramQual = self._parse_parameters_and_qualifiers(paramMode)
    if ((paramQual is None) and (len(arrayOps) == 0)):
        if (named and (paramMode == 'type') and typed):
            self.skip_ws()
            if self.skip_string(':'):
                size = self._parse_constant_expression(inTemplate=False)
                return ASTDeclaratorNameBitField(declId=declId, size=size)
    return ASTDeclaratorNameParamQual(declId=declId, arrayOps=arrayOps, paramQual=paramQual)