def _parse_postfix_expression(self) -> ASTPostfixExpr:
    prefixType = None
    prefix = None
    self.skip_ws()
    cast = None
    for c in _id_explicit_cast:
        if self.skip_word_and_ws(c):
            cast = c
            break
    if (cast is not None):
        prefixType = 'cast'
        if (not self.skip_string('<')):
            self.fail(("Expected '<' afer '%s'." % cast))
        typ = self._parse_type(False)
        self.skip_ws()
        if (not self.skip_string_and_ws('>')):
            self.fail(("Expected '>' after type in '%s'." % cast))
        if (not self.skip_string('(')):
            self.fail(("Expected '(' in '%s'." % cast))

        def parser() -> ASTExpression:
            return self._parse_expression()
        expr = self._parse_expression_fallback([')'], parser)
        self.skip_ws()
        if (not self.skip_string(')')):
            self.fail(("Expected ')' to end '%s'." % cast))
        prefix = ASTExplicitCast(cast, typ, expr)
    elif self.skip_word_and_ws('typeid'):
        prefixType = 'typeid'
        if (not self.skip_string_and_ws('(')):
            self.fail("Expected '(' after 'typeid'.")
        pos = self.pos
        try:
            typ = self._parse_type(False)
            prefix = ASTTypeId(typ, isType=True)
            if (not self.skip_string(')')):
                self.fail("Expected ')' to end 'typeid' of type.")
        except DefinitionError as eType:
            self.pos = pos
            try:

                def parser() -> ASTExpression:
                    return self._parse_expression()
                expr = self._parse_expression_fallback([')'], parser)
                prefix = ASTTypeId(expr, isType=False)
                if (not self.skip_string(')')):
                    self.fail("Expected ')' to end 'typeid' of expression.")
            except DefinitionError as eExpr:
                self.pos = pos
                header = "Error in 'typeid(...)'."
                header += ' Expected type or expression.'
                errors = []
                errors.append((eType, 'If type'))
                errors.append((eExpr, 'If expression'))
                raise self._make_multi_error(errors, header)
    else:
        pos = self.pos
        try:
            prefix = self._parse_primary_expression()
            prefixType = 'expr'
        except DefinitionError as eOuter:
            self.pos = pos
            try:
                prefix = self._parse_type(False, 'operatorCast')
                prefixType = 'typeOperatorCast'
                self.skip_ws()
                if ((self.current_char != '(') and (self.current_char != '{')):
                    self.fail("Expecting '(' or '{' after type in cast expression.")
            except DefinitionError as eInner:
                self.pos = pos
                header = 'Error in postfix expression,'
                header += ' expected primary expression or type.'
                errors = []
                errors.append((eOuter, 'If primary expression'))
                errors.append((eInner, 'If type'))
                raise self._make_multi_error(errors, header)
    postFixes = []
    while True:
        self.skip_ws()
        if (prefixType in ['expr', 'cast', 'typeid']):
            if self.skip_string_and_ws('['):
                expr = self._parse_expression()
                self.skip_ws()
                if (not self.skip_string(']')):
                    self.fail("Expected ']' in end of postfix expression.")
                postFixes.append(ASTPostfixArray(expr))
                continue
            if self.skip_string('.'):
                if self.skip_string('*'):
                    self.pos -= 2
                elif self.skip_string('..'):
                    self.pos -= 3
                else:
                    name = self._parse_nested_name()
                    postFixes.append(ASTPostfixMember(name))
                    continue
            if self.skip_string('->'):
                if self.skip_string('*'):
                    self.pos -= 3
                else:
                    name = self._parse_nested_name()
                    postFixes.append(ASTPostfixMemberOfPointer(name))
                    continue
            if self.skip_string('++'):
                postFixes.append(ASTPostfixInc())
                continue
            if self.skip_string('--'):
                postFixes.append(ASTPostfixDec())
                continue
        lst = self._parse_expression_list_or_braced_init_list()
        if (lst is not None):
            postFixes.append(ASTPostfixCallExpr(lst))
            continue
        break
    return ASTPostfixExpr(prefix, postFixes)
def _parse_postfix_expression(self) -> ASTPostfixExpr:
    prefixType = None
    prefix = None
    self.skip_ws()
    cast = None
    for c in _id_explicit_cast:
        if self.skip_word_and_ws(c):
            cast = c
            break
    if (cast is not None):
        prefixType = 'cast'
        if (not self.skip_string('<')):
            self.fail(("Expected '<' afer '%s'." % cast))
        typ = self._parse_type(False)
        self.skip_ws()
        if (not self.skip_string_and_ws('>')):
            self.fail(("Expected '>' after type in '%s'." % cast))
        if (not self.skip_string('(')):
            self.fail(("Expected '(' in '%s'." % cast))

        def parser() -> ASTExpression:
            return self._parse_expression()
        expr = self._parse_expression_fallback([')'], parser)
        self.skip_ws()
        if (not self.skip_string(')')):
            self.fail(("Expected ')' to end '%s'." % cast))
        prefix = ASTExplicitCast(cast, typ, expr)
    elif self.skip_word_and_ws('typeid'):
        prefixType = 'typeid'
        if (not self.skip_string_and_ws('(')):
            self.fail("Expected '(' after 'typeid'.")
        pos = self.pos
        try:
            typ = self._parse_type(False)
            prefix = ASTTypeId(typ, isType=True)
            if (not self.skip_string(')')):
                self.fail("Expected ')' to end 'typeid' of type.")
        except DefinitionError as eType:
            self.pos = pos
            try:

                def parser() -> ASTExpression:
                    return self._parse_expression()
                expr = self._parse_expression_fallback([')'], parser)
                prefix = ASTTypeId(expr, isType=False)
                if (not self.skip_string(')')):
                    self.fail("Expected ')' to end 'typeid' of expression.")
            except DefinitionError as eExpr:
                self.pos = pos
                header = "Error in 'typeid(...)'."
                header += ' Expected type or expression.'
                errors = []
                errors.append((eType, 'If type'))
                errors.append((eExpr, 'If expression'))
                raise self._make_multi_error(errors, header)
    else:
        pos = self.pos
        try:
            prefix = self._parse_primary_expression()
            prefixType = 'expr'
        except DefinitionError as eOuter:
            self.pos = pos
            try:
                prefix = self._parse_type(False, 'operatorCast')
                prefixType = 'typeOperatorCast'
                self.skip_ws()
                if ((self.current_char != '(') and (self.current_char != '{')):
                    self.fail("Expecting '(' or '{' after type in cast expression.")
            except DefinitionError as eInner:
                self.pos = pos
                header = 'Error in postfix expression,'
                header += ' expected primary expression or type.'
                errors = []
                errors.append((eOuter, 'If primary expression'))
                errors.append((eInner, 'If type'))
                raise self._make_multi_error(errors, header)
    postFixes = []
    while True:
        self.skip_ws()
        if (prefixType in ['expr', 'cast', 'typeid']):
            if self.skip_string_and_ws('['):
                expr = self._parse_expression()
                self.skip_ws()
                if (not self.skip_string(']')):
                    self.fail("Expected ']' in end of postfix expression.")
                postFixes.append(ASTPostfixArray(expr))
                continue
            if self.skip_string('.'):
                if self.skip_string('*'):
                    self.pos -= 2
                elif self.skip_string('..'):
                    self.pos -= 3
                else:
                    name = self._parse_nested_name()
                    postFixes.append(ASTPostfixMember(name))
                    continue
            if self.skip_string('->'):
                if self.skip_string('*'):
                    self.pos -= 3
                else:
                    name = self._parse_nested_name()
                    postFixes.append(ASTPostfixMemberOfPointer(name))
                    continue
            if self.skip_string('++'):
                postFixes.append(ASTPostfixInc())
                continue
            if self.skip_string('--'):
                postFixes.append(ASTPostfixDec())
                continue
        lst = self._parse_expression_list_or_braced_init_list()
        if (lst is not None):
            postFixes.append(ASTPostfixCallExpr(lst))
            continue
        break
    return ASTPostfixExpr(prefix, postFixes)