
    -Ph H                       U d Z ddlmZ ddlZddlmZ erddlmZmZ  ej	        d          Z
 ej	        dej                  Z ej	        d          Z ej	        d	ej                  Z ej	        d
ej                  Z eh d          Zded<    ej	        dej                  ZdZdZded<   ddddddddddd
Zdddddd d!Zi d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCi dDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdnZi doddpddqddrdsdtdudvdwdxdydzd{d|d}d~dddddddddddddddi dddddddddddddddd dd ddddddddddddddddi ddddddddddddddddddddddddddddddddddddiZi d"dd$dd&dd(dd*dddd,dd.dd0dd2dÓd4dēd6dœddœd8dǓddǓd:dɓddɓi d<d˓d>d̓d@d͓dBdΓdDdϓdFdГdHdѓddѓdJdӓddӓdLdՓddՓdNdדdPdؓdRdٓdTdړdVdۓi dXdܓddܓdZdޓd\dߓd^dd`ddddbddddddddddddddddddddddddddZddddddddddd
Zddd{dydwdZded <   g dZded<   g dZded<   g dZ ded<   ddd	d
dZ!dS (  a'  Important note on ids
----------------------------------------------------------------------------

Multiple id generation schemes are used due to backwards compatibility.
- v1: 1.2.3 <= version < 1.3
      The style used before the rewrite.
      It is not the actual old code, but a replication of the behaviour.
- v2: 1.3 <= version < now
      Standardised mangling scheme from
      https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling
      though not completely implemented.
All versions are generated and attached to elements. The newest is used for
the index. All of the versions should work as permalinks.


Signature Nodes and Tagnames
----------------------------------------------------------------------------

Each signature is in a desc_signature node, where all children are
desc_signature_line nodes. Each of these lines will have the attribute
'sphinx_line_type' set to one of the following (prioritized):
- 'declarator', if the line contains the name of the declared object.
- 'templateParams', if the line starts a template parameter list,
- 'templateParams', if the line has template parameters
  Note: such lines might get a new tag in the future.
- 'templateIntroduction, if the line is on the form 'conceptName{...}'
No other desc_signature nodes should exist (so far).


Grammar
----------------------------------------------------------------------------

See https://www.nongnu.org/hcb/ for the grammar,
and https://github.com/cplusplus/draft/blob/master/source/grammar.tex,
and https://github.com/cplusplus/concepts-ts
for the newest grammar.

common grammar things:
    template-declaration ->
        "template" "<" template-parameter-list ">" declaration
    template-parameter-list ->
          template-parameter
        | template-parameter-list "," template-parameter
    template-parameter ->
          type-parameter
        | parameter-declaration # i.e., same as a function argument

    type-parameter ->
          "class"    "..."[opt] identifier[opt]
        | "class"               identifier[opt] "=" type-id
        | "typename" "..."[opt] identifier[opt]
        | "typename"            identifier[opt] "=" type-id
        | "template" "<" template-parameter-list ">"
            "class"  "..."[opt] identifier[opt]
        | "template" "<" template-parameter-list ">"
            "class"             identifier[opt] "=" id-expression
        # also, from C++17 we can have "typename" in template templates
    templateDeclPrefix ->
        "template" "<" template-parameter-list ">"

    simple-declaration ->
        attribute-specifier-seq[opt] decl-specifier-seq[opt]
            init-declarator-list[opt] ;
    # Make the semicolon optional.
    # For now: drop the attributes (TODO).
    # Use at most 1 init-declarator.
    -> decl-specifier-seq init-declarator
    -> decl-specifier-seq declarator initializer

    decl-specifier ->
          storage-class-specifier ->
             (  "static" (only for member_object and function_object)
              | "extern" (only for member_object and function_object)
              | "register"
             )
             thread_local[opt] (only for member_object)
                               (it can also appear before the others)

        | type-specifier -> trailing-type-specifier
        | function-specifier -> "inline" | "virtual" | "explicit" (only
          for function_object)
        | "friend" (only for function_object)
        | "constexpr" (only for member_object and function_object)
    trailing-type-specifier ->
          simple-type-specifier
        | elaborated-type-specifier
        | typename-specifier
        | cv-qualifier -> "const" | "volatile"
    stricter grammar for decl-specifier-seq (with everything, each object
    uses a subset):
        visibility storage-class-specifier function-specifier "friend"
        "constexpr" "volatile" "const" trailing-type-specifier
        # where trailing-type-specifier can no be cv-qualifier
    # Inside e.g., template parameters a strict subset is used
    # (see type-specifier-seq)
    trailing-type-specifier ->
          simple-type-specifier ->
            ::[opt] nested-name-specifier[opt] type-name
          | ::[opt] nested-name-specifier "template" simple-template-id
          | "char" | "bool" | etc.
          | decltype-specifier
        | elaborated-type-specifier ->
            class-key attribute-specifier-seq[opt] ::[opt]
            nested-name-specifier[opt] identifier
          | class-key ::[opt] nested-name-specifier[opt] template[opt]
            simple-template-id
          | "enum" ::[opt] nested-name-specifier[opt] identifier
        | typename-specifier ->
            "typename" ::[opt] nested-name-specifier identifier
          | "typename" ::[opt] nested-name-specifier template[opt]
            simple-template-id
    class-key -> "class" | "struct" | "union"
    type-name ->* identifier | simple-template-id
    # ignoring attributes and decltype, and then some left-factoring
    trailing-type-specifier ->
        rest-of-trailing
        ("class" | "struct" | "union" | "typename") rest-of-trailing
        built-in -> "char" | "bool" | etc.
        decltype-specifier
    rest-of-trailing -> (with some simplification)
        "::"[opt] list-of-elements-separated-by-::
    element ->
        "template"[opt] identifier ("<" template-argument-list ">")[opt]
    template-argument-list ->
          template-argument "..."[opt]
        | template-argument-list "," template-argument "..."[opt]
    template-argument ->
          constant-expression
        | type-specifier-seq abstract-declarator
        | id-expression


    declarator ->
          ptr-declarator
        | noptr-declarator parameters-and-qualifiers trailing-return-type
    ptr-declarator ->
          noptr-declarator
        | ptr-operator ptr-declarator
    noptr-declarator ->
          declarator-id attribute-specifier-seq[opt] ->
                "..."[opt] id-expression
              | rest-of-trailing
        | noptr-declarator parameters-and-qualifiers
        | noptr-declarator "[" constant-expression[opt] "]"
          attribute-specifier-seq[opt]
        | "(" ptr-declarator ")"
    ptr-operator ->
          "*"  attribute-specifier-seq[opt] cv-qualifier-seq[opt]
        | "&   attribute-specifier-seq[opt]
        | "&&" attribute-specifier-seq[opt]
        | "::"[opt] nested-name-specifier "*" attribute-specifier-seq[opt]
            cv-qualifier-seq[opt]
    # function_object must use a parameters-and-qualifiers, the others may
    # use it (e.g., function pointers)
    parameters-and-qualifiers ->
        "(" parameter-clause ")" attribute-specifier-seq[opt]
        cv-qualifier-seq[opt] ref-qualifier[opt]
        exception-specification[opt]
    ref-qualifier -> "&" | "&&"
    exception-specification ->
        "noexcept" ("(" constant-expression ")")[opt]
        "throw" ("(" type-id-list ")")[opt]
    # TODO: we don't implement attributes
    # member functions can have initializers, but we fold them into here
    memberFunctionInit -> "=" "0"
    # (note: only "0" is allowed as the value, according to the standard,
    # right?)

    enum-head ->
        enum-key attribute-specifier-seq[opt] nested-name-specifier[opt]
            identifier enum-base[opt]
    enum-key -> "enum" | "enum struct" | "enum class"
    enum-base ->
        ":" type
    enumerator-definition ->
          identifier
        | identifier "=" constant-expression

We additionally add the possibility for specifying the visibility as the
first thing.

concept_object:
    goal:
        just a declaration of the name (for now)

    grammar: only a single template parameter list, and the nested name
        may not have any template argument lists

        "template" "<" template-parameter-list ">"
        nested-name-specifier

type_object:
    goal:
        either a single type (e.g., "MyClass:Something_T" or a typedef-like
        thing (e.g. "Something Something_T" or "int I_arr[]"
    grammar, single type: based on a type in a function parameter, but
    without a name:
           parameter-declaration
        -> attribute-specifier-seq[opt] decl-specifier-seq
           abstract-declarator[opt]
        # Drop the attributes
        -> decl-specifier-seq abstract-declarator[opt]
    grammar, typedef-like: no initializer
        decl-specifier-seq declarator
    Can start with a templateDeclPrefix.

member_object:
    goal: as a type_object which must have a declarator, and optionally
    with a initializer
    grammar:
        decl-specifier-seq declarator initializer
    Can start with a templateDeclPrefix.

function_object:
    goal: a function declaration, TODO: what about templates? for now: skip
    grammar: no initializer
       decl-specifier-seq declarator
    Can start with a templateDeclPrefix.

class_object:
    goal: a class declaration, but with specification of a base class
    grammar:
          attribute-specifier-seq[opt]
              nested-name "final"[opt] (":" base-specifier-list)[opt]
        base-specifier-list ->
          base-specifier "..."[opt]
        | base-specifier-list, base-specifier "..."[opt]
        base-specifier ->
          base-type-specifier
        | "virtual" access-spe"cifier[opt]    base-type-specifier
        | access-specifier[opt] "virtual"[opt] base-type-specifier
    Can start with a templateDeclPrefix.

enum_object:
    goal: an unscoped enum or a scoped enum, optionally with the underlying
          type specified
    grammar:
        ("class" | "struct")[opt] visibility[opt]
            attribute-specifier-seq[opt] nested-name (":" type)[opt]
enumerator_object:
    goal: an element in a scoped or unscoped enum. The name should be
          injected according to the scopedness.
    grammar:
        nested-name ("=" constant-expression)

namespace_object:
    goal: a directive to put all following declarations in a specific scope
    grammar:
        nested-name
    )annotationsN)TYPE_CHECKING)SequenceSetz[a-zA-Z_][a-zA-Z0-9_]*\bz>[LuU8]?('([^'\\]*(?:\\.[^'\\]*)*)'|"([^"\\]*(?:\\.[^"\\]*)*)")z\b(public|private|protected)\bz
        \[\s*\]
    |   \(\s*\)
    |   \+\+ | --
    |   ->\*? | \,
    |   (<<|>>)=? | && | \|\|
    |   <=>
    |   [!<>=/*%+|&^~-]=?
    |   (\b(and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|xor|xor_eq)\b)
    zx
        ->\*    |    \.\*    |    \,
    |   (<<|>>)=?    |    &&    |    \|\|
    |   !=
    |   [<>=/*%+|&^~-]=?
    >Y   doiforandasmforintnewnottryxorautoboolcasecharelseenumgotolongthistruevoidbitorbreakcatchclasscomplconstfalsefloator_eqshortthrowunionusingwhileand_eqbitanddeletedoubleexportexternfriendinlinenot_eqpublicreturnsignedsizeofstaticstructswitchtypeidxor_eqalignasalignofchar8_tconceptdefaultmutablenullptrprivatetypedefvirtualwchar_tchar16_tchar32_tcontinuedecltypeexplicitnoexceptoperatorregisterrequirestemplatetypenameunsignedvolatile	consteval	constexpr	constinit	namespace	protected
const_caststatic_castdynamic_castthread_localstatic_assertreinterpret_castzSet[str]	_keywordsa  
    \b(
    auto|void|bool
    |signed|unsigned
    |short|long
    |char|wchar_t|char(8|16|32)_t
    |int
    |__int(64|128)  # extension
    |float|double
    |__float80|_Float64x|__float128|_Float128  # extension
    |_Complex|_Imaginary  # extension
    )\b
       ) rb   _CPPv2_CPPv3_CPPv4zSequence[str]
_id_prefixcCiUlLb)
r   signed charunsigned charr   
signed intunsigned intr   signed longunsigned longr   ssosisiosvm)zstd::stringzstd::ostreamzstd::istreamzstd::iostreamzstd::vectorzstd::mapr   znew-operatorznew[]znew-array-operatorr-   zdelete-operatorzdelete[]zdelete-array-operator~zinv-operator+zadd-operator-zsub-operator*zmul-operator/zdiv-operator%zmod-operator&zand-operator|zor-operator^zxor-operator=zassign-operator+=zadd-assign-operator-=zsub-assign-operator*=zmul-assign-operator/=zdiv-assign-operator%=zmod-assign-operator&=zand-assign-operator|=zor-assign-operator^=zxor-assign-operator<<zlshift-operator>>zrshift-operator<<=zlshift-assign-operator>>=zrshift-assign-operator==zeq-operator!=zneq-operator<zlt-operator>zgt-operator<=zlte-operator>=zgte-operator!znot-operator&&zsand-operatorzsor-operatorzinc-operatorzdec-operatorzcomma-operatorzpointer-by-pointer-operatorzpointer-operatorzcall-operatorzsubscript-operator)||++--,->*->()[]r   r   r   rn   aro   hrG   wrI   DirH   Dsr?   Dur&   sz	short intzsigned shortzsigned short intzunsigned shorttzunsigned short intr   r6   rp   rS   jrq   r   zlong intrr   zsigned long intrs   zunsigned long intz	long longxzlong long intzsigned long longzsigned long long int__int64zunsigned long longyzunsigned long long int__int128nzsigned __int128zunsigned __int128or$   fr.   dzlong doublee	__float80	_Float64x
__float128g	_Float128z_Complex floatCfz_Complex doubleCdz_Complex long doubleCez_Imaginary floatz_Imaginary doublez_Imaginary long doubler   Dazdecltype(auto)Dczstd::nullptr_tDnnwnadldacor!   plmimldvrmanr,   r	   r   eor   aSpLmImLdVrMaNr+   oRr%   eOr<   lsrslSrSeqner3   ltgtlege<=>ntr   aar
   r   oor   ppr   mmr   cmr   pmptclixdsqu)r   r   r   .*?pp_mm_deadpsng)
r   r   r}   r   r{   r|   r   r   rz   r!   )Nu8urj   rl   zdict[str | None, str]_id_char_from_prefix))r   r	   )r   r
   )r   r   )r   r   )r   r,   )r   r   r3   )r   r   r   r   r   )r   r   )r{   r|   )r}   r~   r   )r   r   zSequence[tuple[str, ...]]_expression_bin_ops_expression_unary_ops)r   r   r   r   r   r   r   r   r   r+   r   r   r<   r%   _expression_assignment_opsdcscccrc)r\   r[   rZ   r_   )"__doc__
__future__r   retypingr   collections.abcr   r   compileudl_identifier_reDOTALL
_string_re_visibility_reVERBOSE_operator_re_fold_operator_re	frozensetr`   __annotations___simple_type_specifiers_re_max_idrf   _id_fundamental_v1_id_shorthands_v1_id_operator_v1_id_fundamental_v2_id_operator_v2_id_operator_unary_v2r   r   r   r   _id_explicit_cast     W/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/sphinx/domains/cpp/_ids.py<module>r     s!
  y y yv # " " " " " 				             .--------BJ   RZ$I 

 =>>rz	 J  BJ J    i ! ! !  	    8 (RZ J  " B
 B B B B      0	>0!0 0 '	0 0 0 0 0 0 0  !0" #0$ %0& 	'0( 	
)0* 	
+0, 	
-0 0. 	
/00 	
102 	
304 	
506 	
708 	
90: 	
;0< 
#=0> 
#?0@ 	-A0B 	.C0D E0F G0H 	.I0J 	.K0L M0N 	/O0 0P 

	(


_0 0 0l6
C6 C6 C	6
 36 S6 s6 6 6 t6 S6 6 C6 6 c6  #!6" 
3#6$ c%6 6& #'6( )6* C+6, C-6. /60 3162 s364 S566 768 96: S;6< =6> C?6@ sA6B #C6D cE6F G6 6 6H sI6J K6L SM6N cO6P 3Q6R S6T U6V #W6X Y6Z d[6\ t]6^ D_6` a6b c6d ce6f Dg6h di6 6j dk6 6 n?	4?T? d? 	? ? T? ? ? ?  !?" #?$ %?& d'?( )?* T+?, -?. 
4/? ?0 1?2 	$3?4 	$5?6 	$7?8 	$9?: 	$;?< 	$=?> d??@ 	$A?B TC?D 	$E?F dG?H 	$I?J 	$K?L 
4M?N 
4O?P 	$Q? ? ?R 	$S?T dU?V W?X Y?Z 	$[?\ 	$]?^ 
4_?` a?b 
4c?d 	$e?f 
4g?h 	$i?j 	$k?l 	$m?n 	$o?p q?r 
4s? ?t 


	}? ? ?B 
						   
			/ /     2 2 2     ( ( (     - - -     " 	    r  