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

from typing import Any, TYPE_CHECKING, TypeVar, Union
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx.directives import ObjectDescription
from sphinx.domains import Domain
from sphinx.roles import SphinxRole, XRefRole
from sphinx.transforms import SphinxTransform
from sphinx.util.cfamily import ASTAttributeList, ASTBaseBase, ASTBaseParenExprList, BaseParser
from sphinx.util.docutils import SphinxDirective
from collections.abc import Iterator
from docutils.nodes import Element, Node, TextElement, system_message
from sphinx.addnodes import pending_xref
from sphinx.application import Sphinx
from sphinx.builders import Builder
from sphinx.environment import BuildEnvironment
from sphinx.util.typing import OptionSpec

"""The C language domain."""
if TYPE_CHECKING:
    ...
logger = ...
T = TypeVar('T')
DeclarationType = Union["ASTStruct", "ASTUnion", "ASTEnum", "ASTEnumerator", "ASTType", "ASTTypeWithInit", "ASTMacro",]
_keywords = ...
_macroKeywords = ...
_expression_bin_ops = ...
_expression_unary_ops = ...
_expression_assignment_ops = ...
_max_id = ...
_id_prefix = ...
_string_re = ...
_simple_type_specifiers_re = ...
class _DuplicateSymbolError(Exception):
    def __init__(self, symbol: Symbol, declaration: ASTDeclaration) -> None:
        ...
    
    def __str__(self) -> str:
        ...
    


class ASTBase(ASTBaseBase):
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTIdentifier(ASTBaseBase):
    def __init__(self, identifier: str) -> None:
        ...
    
    def __eq__(self, other: Any) -> bool:
        ...
    
    def is_anon(self) -> bool:
        ...
    
    def __str__(self) -> str:
        ...
    
    def get_display_string(self) -> str:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, prefix: str, symbol: Symbol) -> None:
        ...
    


class ASTNestedName(ASTBase):
    def __init__(self, names: list[ASTIdentifier], rooted: bool) -> None:
        ...
    
    @property
    def name(self) -> ASTNestedName:
        ...
    
    def get_id(self, version: int) -> str:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTExpression(ASTBase):
    ...


class ASTLiteral(ASTExpression):
    ...


class ASTBooleanLiteral(ASTLiteral):
    def __init__(self, value: bool) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTNumberLiteral(ASTLiteral):
    def __init__(self, data: str) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTCharLiteral(ASTLiteral):
    def __init__(self, prefix: str, data: str) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTStringLiteral(ASTLiteral):
    def __init__(self, data: str) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTIdExpression(ASTExpression):
    def __init__(self, name: ASTNestedName) -> None:
        ...
    
    def get_id(self, version: int) -> str:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTParenExpr(ASTExpression):
    def __init__(self, expr) -> None:
        ...
    
    def get_id(self, version: int) -> str:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTPostfixOp(ASTBase):
    ...


class ASTPostfixCallExpr(ASTPostfixOp):
    def __init__(self, lst: ASTParenExprList | ASTBracedInitList) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTPostfixArray(ASTPostfixOp):
    def __init__(self, expr: ASTExpression) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTPostfixInc(ASTPostfixOp):
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTPostfixDec(ASTPostfixOp):
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTPostfixMemberOfPointer(ASTPostfixOp):
    def __init__(self, name) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTPostfixExpr(ASTExpression):
    def __init__(self, prefix: ASTExpression, postFixes: list[ASTPostfixOp]) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTUnaryOpExpr(ASTExpression):
    def __init__(self, op: str, expr: ASTExpression) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTSizeofType(ASTExpression):
    def __init__(self, typ) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTSizeofExpr(ASTExpression):
    def __init__(self, expr: ASTExpression) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTAlignofExpr(ASTExpression):
    def __init__(self, typ: ASTType) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTCastExpr(ASTExpression):
    def __init__(self, typ: ASTType, expr: ASTExpression) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTBinOpExpr(ASTBase):
    def __init__(self, exprs: list[ASTExpression], ops: list[str]) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTAssignmentExpr(ASTExpression):
    def __init__(self, exprs: list[ASTExpression], ops: list[str]) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTFallbackExpr(ASTExpression):
    def __init__(self, expr: str) -> None:
        ...
    
    def get_id(self, version: int) -> str:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTTrailingTypeSpec(ASTBase):
    ...


class ASTTrailingTypeSpecFundamental(ASTTrailingTypeSpec):
    def __init__(self, names: list[str]) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTTrailingTypeSpecName(ASTTrailingTypeSpec):
    def __init__(self, prefix: str, nestedName: ASTNestedName) -> None:
        ...
    
    @property
    def name(self) -> ASTNestedName:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTFunctionParameter(ASTBase):
    def __init__(self, arg: ASTTypeWithInit | None, ellipsis: bool = ...) -> None:
        ...
    
    def get_id(self, version: int, objectType: str, symbol: Symbol) -> str:
        ...
    
    def describe_signature(self, signode: Any, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTParameters(ASTBase):
    def __init__(self, args: list[ASTFunctionParameter], attrs: ASTAttributeList) -> None:
        ...
    
    @property
    def function_params(self) -> list[ASTFunctionParameter]:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTDeclSpecsSimple(ASTBaseBase):
    def __init__(self, storage: str, threadLocal: str, inline: bool, restrict: bool, volatile: bool, const: bool, attrs: ASTAttributeList) -> None:
        ...
    
    def mergeWith(self, other: ASTDeclSpecsSimple) -> ASTDeclSpecsSimple:
        ...
    
    def describe_signature(self, modifiers: list[Node]) -> None:
        ...
    


class ASTDeclSpecs(ASTBase):
    def __init__(self, outer: str, leftSpecs: ASTDeclSpecsSimple, rightSpecs: ASTDeclSpecsSimple, trailing: ASTTrailingTypeSpec) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTArray(ASTBase):
    def __init__(self, static: bool, const: bool, volatile: bool, restrict: bool, vla: bool, size: ASTExpression) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTDeclarator(ASTBase):
    @property
    def name(self) -> ASTNestedName:
        ...
    
    @property
    def function_params(self) -> list[ASTFunctionParameter]:
        ...
    
    def require_space_after_declSpecs(self) -> bool:
        ...
    


class ASTDeclaratorNameParam(ASTDeclarator):
    def __init__(self, declId: ASTNestedName, arrayOps: list[ASTArray], param: ASTParameters) -> None:
        ...
    
    @property
    def name(self) -> ASTNestedName:
        ...
    
    @property
    def function_params(self) -> list[ASTFunctionParameter]:
        ...
    
    def require_space_after_declSpecs(self) -> bool:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTDeclaratorNameBitField(ASTDeclarator):
    def __init__(self, declId: ASTNestedName, size: ASTExpression) -> None:
        ...
    
    @property
    def name(self) -> ASTNestedName:
        ...
    
    def require_space_after_declSpecs(self) -> bool:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTDeclaratorPtr(ASTDeclarator):
    def __init__(self, next: ASTDeclarator, restrict: bool, volatile: bool, const: bool, attrs: ASTAttributeList) -> None:
        ...
    
    @property
    def name(self) -> ASTNestedName:
        ...
    
    @property
    def function_params(self) -> list[ASTFunctionParameter]:
        ...
    
    def require_space_after_declSpecs(self) -> bool:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTDeclaratorParen(ASTDeclarator):
    def __init__(self, inner: ASTDeclarator, next: ASTDeclarator) -> None:
        ...
    
    @property
    def name(self) -> ASTNestedName:
        ...
    
    @property
    def function_params(self) -> list[ASTFunctionParameter]:
        ...
    
    def require_space_after_declSpecs(self) -> bool:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTParenExprList(ASTBaseParenExprList):
    def __init__(self, exprs: list[ASTExpression]) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTBracedInitList(ASTBase):
    def __init__(self, exprs: list[ASTExpression], trailingComma: bool) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTInitializer(ASTBase):
    def __init__(self, value: ASTBracedInitList | ASTExpression, hasAssign: bool = ...) -> None:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTType(ASTBase):
    def __init__(self, declSpecs: ASTDeclSpecs, decl: ASTDeclarator) -> None:
        ...
    
    @property
    def name(self) -> ASTNestedName:
        ...
    
    def get_id(self, version: int, objectType: str, symbol: Symbol) -> str:
        ...
    
    @property
    def function_params(self) -> list[ASTFunctionParameter]:
        ...
    
    def get_type_declaration_prefix(self) -> str:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTTypeWithInit(ASTBase):
    def __init__(self, type: ASTType, init: ASTInitializer) -> None:
        ...
    
    @property
    def name(self) -> ASTNestedName:
        ...
    
    def get_id(self, version: int, objectType: str, symbol: Symbol) -> str:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTMacroParameter(ASTBase):
    def __init__(self, arg: ASTNestedName | None, ellipsis: bool = ..., variadic: bool = ...) -> None:
        ...
    
    def describe_signature(self, signode: Any, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTMacro(ASTBase):
    def __init__(self, ident: ASTNestedName, args: list[ASTMacroParameter] | None) -> None:
        ...
    
    @property
    def name(self) -> ASTNestedName:
        ...
    
    def get_id(self, version: int, objectType: str, symbol: Symbol) -> str:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTStruct(ASTBase):
    def __init__(self, name: ASTNestedName) -> None:
        ...
    
    def get_id(self, version: int, objectType: str, symbol: Symbol) -> str:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTUnion(ASTBase):
    def __init__(self, name: ASTNestedName) -> None:
        ...
    
    def get_id(self, version: int, objectType: str, symbol: Symbol) -> str:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTEnum(ASTBase):
    def __init__(self, name: ASTNestedName) -> None:
        ...
    
    def get_id(self, version: int, objectType: str, symbol: Symbol) -> str:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTEnumerator(ASTBase):
    def __init__(self, name: ASTNestedName, init: ASTInitializer | None, attrs: ASTAttributeList) -> None:
        ...
    
    def get_id(self, version: int, objectType: str, symbol: Symbol) -> str:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, symbol: Symbol) -> None:
        ...
    


class ASTDeclaration(ASTBaseBase):
    def __init__(self, objectType: str, directiveType: str | None, declaration: DeclarationType | ASTFunctionParameter, semicolon: bool = ...) -> None:
        ...
    
    def clone(self) -> ASTDeclaration:
        ...
    
    @property
    def name(self) -> ASTNestedName:
        ...
    
    @property
    def function_params(self) -> list[ASTFunctionParameter] | None:
        ...
    
    def get_id(self, version: int, prefixed: bool = ...) -> str:
        ...
    
    def get_newest_id(self) -> str:
        ...
    
    def describe_signature(self, signode: TextElement, mode: str, env: BuildEnvironment, options: dict) -> None:
        ...
    


class SymbolLookupResult:
    def __init__(self, symbols: Iterator[Symbol], parentSymbol: Symbol, ident: ASTIdentifier) -> None:
        ...
    


class LookupKey:
    def __init__(self, data: list[tuple[ASTIdentifier, str]]) -> None:
        ...
    
    def __str__(self) -> str:
        ...
    


class Symbol:
    debug_indent = ...
    debug_indent_string = ...
    debug_lookup = ...
    debug_show_tree = ...
    def __copy__(self):
        ...
    
    def __deepcopy__(self, memo): # -> Symbol:
        ...
    
    @staticmethod
    def debug_print(*args: Any) -> None:
        ...
    
    def __setattr__(self, key: str, value: Any) -> None:
        ...
    
    def __init__(self, parent: Symbol, ident: ASTIdentifier, declaration: ASTDeclaration | None, docname: str | None, line: int | None) -> None:
        ...
    
    def remove(self) -> None:
        ...
    
    def clear_doc(self, docname: str) -> None:
        ...
    
    def get_all_symbols(self) -> Iterator[Symbol]:
        ...
    
    @property
    def children(self) -> Iterator[Symbol]:
        ...
    
    @property
    def children_recurse_anon(self) -> Iterator[Symbol]:
        ...
    
    def get_lookup_key(self) -> LookupKey:
        ...
    
    def get_full_nested_name(self) -> ASTNestedName:
        ...
    
    def merge_with(self, other: Symbol, docnames: list[str], env: BuildEnvironment) -> None:
        ...
    
    def add_name(self, nestedName: ASTNestedName) -> Symbol:
        ...
    
    def add_declaration(self, declaration: ASTDeclaration, docname: str, line: int) -> Symbol:
        ...
    
    def find_identifier(self, ident: ASTIdentifier, matchSelf: bool, recurseInAnon: bool, searchInSiblings: bool) -> Symbol | None:
        ...
    
    def direct_lookup(self, key: LookupKey) -> Symbol | None:
        ...
    
    def find_declaration(self, nestedName: ASTNestedName, typ: str, matchSelf: bool, recurseInAnon: bool) -> Symbol | None:
        ...
    
    def to_string(self, indent: int) -> str:
        ...
    
    def dump(self, indent: int) -> str:
        ...
    


class DefinitionParser(BaseParser):
    @property
    def language(self) -> str:
        ...
    
    @property
    def id_attributes(self): # -> Any:
        ...
    
    @property
    def paren_attributes(self): # -> Any:
        ...
    
    def parse_declaration(self, objectType: str, directiveType: str) -> ASTDeclaration:
        ...
    
    def parse_namespace_object(self) -> ASTNestedName:
        ...
    
    def parse_xref_object(self) -> ASTNestedName:
        ...
    
    def parse_expression(self) -> ASTExpression | ASTType:
        ...
    


class CObject(ObjectDescription[ASTDeclaration]):
    """
    Description of a C language object.
    """
    option_spec: OptionSpec = ...
    def add_target_and_index(self, ast: ASTDeclaration, sig: str, signode: TextElement) -> None:
        ...
    
    @property
    def object_type(self) -> str:
        ...
    
    @property
    def display_object_type(self) -> str:
        ...
    
    def get_index_text(self, name: str) -> str:
        ...
    
    def parse_definition(self, parser: DefinitionParser) -> ASTDeclaration:
        ...
    
    def describe_signature(self, signode: TextElement, ast: ASTDeclaration, options: dict) -> None:
        ...
    
    def run(self) -> list[Node]:
        ...
    
    def handle_signature(self, sig: str, signode: TextElement) -> ASTDeclaration:
        ...
    
    def before_content(self) -> None:
        ...
    
    def after_content(self) -> None:
        ...
    


class CMemberObject(CObject):
    object_type = ...
    @property
    def display_object_type(self) -> str:
        ...
    


_function_doc_field_types = ...
class CFunctionObject(CObject):
    object_type = ...
    doc_field_types = ...


class CMacroObject(CObject):
    object_type = ...
    doc_field_types = ...


class CStructObject(CObject):
    object_type = ...


class CUnionObject(CObject):
    object_type = ...


class CEnumObject(CObject):
    object_type = ...


class CEnumeratorObject(CObject):
    object_type = ...


class CTypeObject(CObject):
    object_type = ...


class CNamespaceObject(SphinxDirective):
    """
    This directive is just to tell Sphinx that we're documenting stuff in
    namespace foo.
    """
    has_content = ...
    required_arguments = ...
    optional_arguments = ...
    final_argument_whitespace = ...
    option_spec: OptionSpec = ...
    def run(self) -> list[Node]:
        ...
    


class CNamespacePushObject(SphinxDirective):
    has_content = ...
    required_arguments = ...
    optional_arguments = ...
    final_argument_whitespace = ...
    option_spec: OptionSpec = ...
    def run(self) -> list[Node]:
        ...
    


class CNamespacePopObject(SphinxDirective):
    has_content = ...
    required_arguments = ...
    optional_arguments = ...
    final_argument_whitespace = ...
    option_spec: OptionSpec = ...
    def run(self) -> list[Node]:
        ...
    


class AliasNode(nodes.Element):
    def __init__(self, sig: str, aliasOptions: dict, document: Any, env: BuildEnvironment | None = ..., parentKey: LookupKey | None = ...) -> None:
        ...
    
    def copy(self) -> AliasNode:
        ...
    


class AliasTransform(SphinxTransform):
    default_priority = ...
    def apply(self, **kwargs: Any) -> None:
        ...
    


class CAliasObject(ObjectDescription):
    option_spec: OptionSpec = ...
    def run(self) -> list[Node]:
        """
        On purpose this doesn't call the ObjectDescription version, but is based on it.
        Each alias signature may expand into multiple real signatures if 'noroot'.
        The code is therefore based on the ObjectDescription version.
        """
        ...
    


class CXRefRole(XRefRole):
    def process_link(self, env: BuildEnvironment, refnode: Element, has_explicit_title: bool, title: str, target: str) -> tuple[str, str]:
        ...
    


class CExprRole(SphinxRole):
    def __init__(self, asCode: bool) -> None:
        ...
    
    def run(self) -> tuple[list[Node], list[system_message]]:
        ...
    


class CDomain(Domain):
    """C language domain."""
    name = ...
    label = ...
    object_types = ...
    directives = ...
    roles = ...
    initial_data: dict[str, Symbol | dict[str, tuple[str, str, str]]] = ...
    def clear_doc(self, docname: str) -> None:
        ...
    
    def process_doc(self, env: BuildEnvironment, docname: str, document: nodes.document) -> None:
        ...
    
    def process_field_xref(self, pnode: pending_xref) -> None:
        ...
    
    def merge_domaindata(self, docnames: list[str], otherdata: dict) -> None:
        ...
    
    def resolve_xref(self, env: BuildEnvironment, fromdocname: str, builder: Builder, typ: str, target: str, node: pending_xref, contnode: Element) -> Element | None:
        ...
    
    def resolve_any_xref(self, env: BuildEnvironment, fromdocname: str, builder: Builder, target: str, node: pending_xref, contnode: Element) -> list[tuple[str, Element]]:
        ...
    
    def get_objects(self) -> Iterator[tuple[str, str, str, str, str, int]]:
        ...
    


def setup(app: Sphinx) -> dict[str, Any]:
    ...

