"""
This type stub file was generated by pyright.
"""

import re
from typing import Any, Callable, TYPE_CHECKING
from docutils import nodes
from docutils.nodes import TextElement
from sphinx.config import Config

"""Utility functions common to the C and C++ domains."""
if TYPE_CHECKING:
    ...
logger = ...
StringifyTransform = Callable[[Any], str]
_whitespace_re = ...
anon_identifier_re = ...
identifier_re = ...
integer_literal_re = ...
octal_literal_re = ...
hex_literal_re = ...
binary_literal_re = ...
integers_literal_suffix_re = ...
float_literal_re = ...
float_literal_suffix_re = ...
char_literal_re = ...
def verify_description_mode(mode: str) -> None:
    ...

class NoOldIdError(Exception):
    ...


class ASTBaseBase:
    def __eq__(self, other: Any) -> bool:
        ...
    
    __hash__ = ...
    def clone(self) -> Any:
        ...
    
    def __str__(self) -> str:
        ...
    
    def get_display_string(self) -> str:
        ...
    
    def __repr__(self) -> str:
        ...
    


class ASTAttribute(ASTBaseBase):
    def describe_signature(self, signode: TextElement) -> None:
        ...
    


class ASTCPPAttribute(ASTAttribute):
    def __init__(self, arg: str) -> None:
        ...
    
    def describe_signature(self, signode: TextElement) -> None:
        ...
    


class ASTGnuAttribute(ASTBaseBase):
    def __init__(self, name: str, args: ASTBaseParenExprList | None) -> None:
        ...
    


class ASTGnuAttributeList(ASTAttribute):
    def __init__(self, attrs: list[ASTGnuAttribute]) -> None:
        ...
    
    def describe_signature(self, signode: TextElement) -> None:
        ...
    


class ASTIdAttribute(ASTAttribute):
    """For simple attributes defined by the user."""
    def __init__(self, id: str) -> None:
        ...
    
    def describe_signature(self, signode: TextElement) -> None:
        ...
    


class ASTParenAttribute(ASTAttribute):
    """For paren attributes defined by the user."""
    def __init__(self, id: str, arg: str) -> None:
        ...
    
    def describe_signature(self, signode: TextElement) -> None:
        ...
    


class ASTAttributeList(ASTBaseBase):
    def __init__(self, attrs: list[ASTAttribute]) -> None:
        ...
    
    def __len__(self) -> int:
        ...
    
    def __add__(self, other: ASTAttributeList) -> ASTAttributeList:
        ...
    
    def describe_signature(self, signode: TextElement) -> None:
        ...
    


class ASTBaseParenExprList(ASTBaseBase):
    ...


class UnsupportedMultiCharacterCharLiteral(Exception):
    ...


class DefinitionError(Exception):
    ...


class BaseParser:
    def __init__(self, definition: str, *, location: nodes.Node | tuple[str, int] | str, config: Config) -> None:
        ...
    
    @property
    def language(self) -> str:
        ...
    
    def status(self, msg: str) -> None:
        ...
    
    def fail(self, msg: str) -> None:
        ...
    
    def warn(self, msg: str) -> None:
        ...
    
    def match(self, regex: re.Pattern[str]) -> bool:
        ...
    
    def skip_string(self, string: str) -> bool:
        ...
    
    def skip_word(self, word: str) -> bool:
        ...
    
    def skip_ws(self) -> bool:
        ...
    
    def skip_word_and_ws(self, word: str) -> bool:
        ...
    
    def skip_string_and_ws(self, string: str) -> bool:
        ...
    
    @property
    def eof(self) -> bool:
        ...
    
    @property
    def current_char(self) -> str:
        ...
    
    @property
    def matched_text(self) -> str:
        ...
    
    def read_rest(self) -> str:
        ...
    
    def assert_end(self, *, allowSemicolon: bool = ...) -> None:
        ...
    
    @property
    def id_attributes(self):
        ...
    
    @property
    def paren_attributes(self):
        ...
    


