
    (Vhk                    G   d Z ddlmZmZmZ ddl ddlZddlZ	ddl
Z
 G d de      Zd Z ee      Zi Z G d d	e      Z G d
 de      Z G d d      Z G d de      Z G d de      Z G d de      Z G d d      Z G d d      Z G d d      Z G d d      Z G d d      Z G d de      Z ed       e_          ed!      e_!         ed"      e_"         ed#      e_#         ed$      e_$         ed%      e_%         ed&      e_&         ed'      e_'         ed(      e_(         ed)      e_)         ed*      e_*         ed+      e_+         ed,      e_,         ed-      e_-         ed.      e_.         ed/      e_/         ed0      e_0         ed1      e_1         ed2      e_2         ed3      e_3         ed4      e_4         ed5      e_5         ed6      e_6         ed7      e_7         ed8      e_8         ed9      e_9         ed:      e_:         ed;      e_;         ed<      e_<         ed=      e_=         ed>      e_>         ed?      e_?         ed@      e_@         edA      e_A         edB      e_B         edC      e_C         edD      e_D         edE      e_E         edF      e_F         edG      e_G         edH      e_H         edI      e_I         edJ      e_J         edK      e_K         edL      e_L         edM      e_M         edN      e_N         edO      e_O         edP      e_P         edQ      e_Q         edR      e_R         edS      e_S         edT      e_T         edU      e_U         edV      e_V         edW      e_W         edX      e_X         edY      e_Y         edZ      e_Z         ed[      e_[         ed\      e_\         ed]      e_]         ed^      e_^         ed_      e__         ed`      e_`         eda      e_a         edb      e_b         edc      e_c         edd      e_d         ede      e_e         edf      e_f         edg      e_g         edh      e_h         edi      e_i         edj      e_j         edk      e_k         edl      e_l         edm      e_m         edn      e_n         edo      e_o         edp      e_p         edq      e_q         edr      e_r         eds      e_s         edt      e_t         edu      e_u         edv      e_v         edw      e_w         edx      e_x         edy      e_y         edz      e_z         ed{      e_{         ed|      e_|         ed}      e_}         ed~      e_~         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed«      e_         edë      e_         edī      e_         edū      e_         edƫ      e_         edǫ      e_         edȫ      e_         edɫ      e_         edʫ      e_         ed˫      e_         ed̫      e_         edͫ      e_         edΫ      e_         edϫ      e_         edЫ      e_         edѫ      e_         edҫ      e_         edӫ      e_         edԫ      e_         edի      e_         ed֫      e_         ed׫      e_         edث      e_         ed٫      e_         edګ      e_         ed۫      e_         edܫ      e_         edݫ      e_         edޫ      e_         ed߫      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed       e_          ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed	      e_	         ed
      e_
         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         ed      e_         G d de      Z ed      e_         ed       e_         ed!      e_         ed"      e_         ed#      e_         G d de      Z ed      e_          ed       e_!         ed!      e_"         ed"      e_#         ed#      e_$         ed$      e_%         ed%      e_&         ed&      e_'         ed'      e_(         G d de      Z) G d d       Z* e*d      e*_+         e*d       e*_          e*d!      e*_,         e*d"      e*_-         e*d#      e*_.         e*d$      e*_/         e*d%      e*_0         e*d&      e*_1         G d! d"e      Z2 e2d      e2_3         e2d       e2_4         e2d!      e2_5         e2d"      e2_6         G d# d$e      Z7 e7d      e7_+         e7d       e7_8         e7d!      e7_9         e7d"      e7_:         e7d#      e7_          G d% d&e      Z; e;d      e;_+         e;d       e;_<         e;d!      e;_=         e;d"      e;_>         e;d#      e;_?         e;d$      e;_@         e;d%      e;_A         e;d&      e;_B         e;d'      e;_C         e;d(      e;_D         e;d)      e;_E         e;d*      e;_F         e;d+      e;_G         e;d,      e;_H         e;d-      e;_I         e;d.      e;_J         e;d/      e;_K         e;d0      e;_L         e;d1      e;_M         e;d2      e;_N         e;d3      e;_O         e;d4      e;_P         e;d5      e;_Q         e;d6      e;_R         e;d7      e;_         e;d8      e;_S         e;d9      e;_T         e;d:      e;_U         e;d;      e;_V         e;d<      e;_W         e;d=      e;_X         e;d>      e;_Y         e;dG      e;_Z         e;dV      e;_[         e;dW      e;_         e;dX      e;_\         e;dY      e;_]         e;dZ      e;_^         e;d[      e;__         e;d\      e;_`         e;d]      e;_a         e;d^      e;_b         e;d_      e;_c         e;d`      e;_d         e;da      e;_e         e;db      e;_f         e;dc      e;_g         e;dd      e;_h         e;de      e;_i         e;df      e;_j         e;dg      e;_k         e;dh      e;_0         e;di      e;_l         e;dj      e;_m         e;dk      e;_n         e;dl      e;_o         e;dm      e;_p         e;dn      e;_q         e;do      e;_r         e;dp      e;_s         e;dq      e;_t         e;dr      e;_u         e;ds      e;_v         e;dt      e;_w         e;du      e;_x         e;dv      e;_y         e;dw      e;_z         e;dx      e;_{         e;dy      e;_|         e;dz      e;_}         e;d{      e;_~         e;d|      e;_         e;d}      e;_         e;d~      e;_         e;d      e;_         e;d      e;_         e;d      e;_         e;d      e;_         e;d      e;_         e;d      e;_         e;d      e;_         e;d      e;_         e;d      e;_         e;d      e;_         e;d      e;_         e;d      e;_         e;d      e;_         e;d      e;_         e;d'      e;_         e;d(      e;_         e;d)      e;_         e;d*      e;_         e;d+      e;_         e;d,      e;_         e;d-      e;_         e;d.      e;_         G d/ d0e      Z ed      e_          ed       e_         ed!      e_         G d1 d2e      Z ed      e_+         ed       e_         ed!      e_         ed"      e_         ed#      e_         G d3 d4e      Z ed      e_          ed       e_"         ed!      e_-         G d5 d6e      Z G d7 d8      Z G d9 d:e      Zd;d<d=d>d?d@dAdBdCdDdEdFdGdHZ G dI dJ      Zi dejM                  dK      d ejM                  dL      d!ejM                  dM      d"ejM                  dN      d#ejM                  dO      d$ejM                  dP      d%ejM                  dQ      d&ejM                  dR      d'ejM                  dS      d(ejM                  dT      d)ejM                  dU      d*ejM                  dV      d+ejM                  dW      d,ejM                  dX      d-ejM                  dY      d.ejM                  dZ      d/ejM                  d[      ejM                  d\      ejM                  d]      ejM                  d^      ejM                  d_      d`Z G da dbe      ZejM                  dc      ejM                  dd      ejM                  de      ejM                  df      dgZ G dh die      Z G dj dke      Z G dl dme      Z G dn doe      Z G dp dqe      Z G dr dse      Z G dt du      Z G dv dwe      Z G dx dy      Z G dz d{      Z G d| d}e      Z G d~ de      Z ede ee      ee      ed<    eee)e)e      ed<    eee)e      ed<   g de ee      e ee)      gfdegfde ee      geejt                  fdegeejt                  fdeegeejt                  fdegfdeegefdegefdeegeejt                  fdegeejt                  fdegeejt                  fdegefdeeeeeeeg ee      fdeegefdegefdeegefdeegefde)gefde)gefde)gefde)gefde)gefde)gefde)gefde)gefde)gefde)gefde)gefde)gefde)gefde)gefde)gefde)gefdg efdegefdegfdegfdegfdegfde ee      egfdegfde)e)gefdeegefdeegefdeegefdeegeejt                  fdeegeejt                  fdegeejt                  fdegefde)gefde)ge)e)jz                  fdegeejt                  fdegefdegefdegeejt                  fdeegefdeegefdeegeejt                  fdegefdegeej|                  fdeege)fde)gefde)ge)e)jt                  fde)geejt                  fdÐe)gefdĐe)ge)e)jz                  fdŐe)gefdƐe)ge)e)jt                  fdǐe)eegefdȐe)geejt                  fdɐe)ge)e)jz                  fdʐe)geejt                  fdːe)geejt                  fd̐e)geejt                  fd͐e)geejt                  fdΐe)gefdϐe)geejt                  fdeegefdegefdegeejt                  fdee ee      geejt                  fdeegefdegefdegefdegefde ee      geejt                  fdeegefdegefdegeejt                  fdܐegeejt                  fdݐe)gefdސe)gefdߐe)geejt                  fdeegefdegeejt                  fdegefde)geejt                  fde)geejt                  fdeed   egfde ee       ee       ee       ee      gfdeeeegefdeeegefdde)fdegefdegefdegefdegefdegefde)gefde)ege)e)jz                  fdegeejt                  fdeegefdegefdegefdegeejt                  fde)ge)e)jz                  fde)gefdeegefdegefdeegefdeegeejt                  fdege)e)jt                  fdegeejt                  fdegeej|                  fdege)e)jt                  fd e)geejt                  fdegeejt                  fdegeejt                  fdegeejt                  fde)gefdegefdegefde)gefdegefd	egefd
eegefdegefdegefdegefdegefdegefdegefdegefdegefdegefde)gefdegefdeeeeeeegefdeeeegefdeeegefdee e ee             ee      gfde)ed   egefde)gefde)ege)e)jt                  fde)gefde)egej                  fde)egeejt                  fd e)egefd!e)egefd"e)gefd#e)gefd$e)geejt                  fd%e)geejt                  fd&e)gefd'egefd(egefd)egeejt                  fd*egefd+eegeejt                  fd,eegefd-egefd.egefd/egeejt                  fd0eed   egefZ G d1 d2e      Zd3 ZÐd4 Z G d5 d6      ZŐd7 Z eū       Z eƫ        g d8Zy(9  a  
Clang Indexing Library Bindings
===============================

This module provides an interface to the Clang indexing library. It is a
low-level interface to the indexing library which attempts to match the Clang
API directly while also being "pythonic". Notable differences from the C API
are:

 * string results are returned as Python strings, not CXString objects.

 * null cursors are translated to None.

 * access to child cursors is done via iteration, not visitation.

The major indexing objects are:

  Index

    The top-level object which manages some global library state.

  TranslationUnit

    High-level object encapsulating the AST for a single translation unit. These
    can be loaded from .ast files or parsed on the fly.

  Cursor

    Generic object for representing a node in the AST.

  SourceRange, SourceLocation, and File

    Objects representing information about the input source.

Most object information is exposed using properties, when the underlying API
call is efficient.
    )absolute_importdivisionprint_function)*Nc                   Z     e Zd Zd fd	Zd Ze fd       Zed        Ze	d        Z
 xZS )c_interop_stringc                 v    |d}t        |t              r|j                  d      }t        t        |   |       y )N utf8)
isinstancestrencodesuperc_char_p__init__)selfp	__class__s     </home/dcms/DCMS/lib/python3.12/site-packages/clang/cindex.pyr   zc_interop_string.__init__K   s4    9Aa Ah&q)    c                     | j                   S Nvaluer   s    r   __str__zc_interop_string.__str__R       zzr   c                 \    t         t        | 
  y t         t        | 
  j                  d      S Nr   )r   r   r   decode)r   r   s    r   r   zc_interop_string.valueU   s+    4&.Xt*11&99r   c                     t        |t              r | |      S t        |t              r | |      S |y t        dj	                  t        |      j                  | j                              )NzCannot convert '{}' to '{}')r   r   bytes	TypeErrorformattype__name__)clsparams     r   
from_paramzc_interop_string.from_param[   s]    eS!u:eU#u:=)00e1E1Es||T
 	
r   c                     | j                   S r   r   )xargss     r   to_python_stringz!c_interop_string.to_python_stringh   s    wwr   r   )r&   
__module____qualname__r   r   propertyr   classmethodr)   staticmethodr-   __classcell__)r   s   @r   r   r   J   sI    * : :
 

 

  r   r   c                 H    t        | t              r| S | j                  d      S r   )r   r"   r   r+   s    r   br6   m   s     !U88Fr   c                       e Zd ZdZy)TranslationUnitLoadErrora  Represents an error that occurred when loading a TranslationUnit.

    This is raised in the case where a TranslationUnit could not be
    instantiated due to failure in the libclang library.

    FIXME: Make libclang expose additional error information in this scenario.
    N)r&   r.   r/   __doc__ r   r   r8   r8   ~   s     	r   r8   c                   "    e Zd ZdZdZdZdZd Zy)TranslationUnitSaveErrorzRepresents an error that occurred when saving a TranslationUnit.

    Each error has associated with it an enumerated value, accessible under
    e.save_error. Consumers can compare the value with one of the ERROR_
    constants in this class.
             c                     t        |t              sJ |dk  s|dkD  rt        d|z        || _        t        j	                  | d||fz         y )Nr=   r?   znEncountered undefined TranslationUnit save error constant: %d. Please file a bug to have this value supported.Error %d: %s)r   int	Exception
save_errorr   r   enumerationmessages      r   r   z!TranslationUnitSaveError.__init__   s\    +s+++?kAo#%01  &4;2H!HIr   N)r&   r.   r/   r9   ERROR_UNKNOWNERROR_TRANSLATION_ERRORSERROR_INVALID_TUr   r:   r   r   r<   r<      s$     M  ! Jr   r<   c                       e Zd ZdZd ZddZy)CachedPropertya  Decorator that lazy-loads the value of a property.

    The first time the property is accessed, the original property function is
    executed. The value it returns is set as the new value of that instance's
    property, replacing the original method.
    c                 D    || _         	 |j                  | _        y #  Y y xY wr   )wrappedr9   )r   rN   s     r   r   zCachedProperty.__init__   s#    	"??DL	s    Nc                 r    || S | j                  |      }t        || j                   j                  |       |S r   )rN   setattrr&   )r   instanceinstance_typer   s       r   __get__zCachedProperty.__get__   s6    KX&$,,//7r   r   )r&   r.   r/   r9   r   rS   r:   r   r   rL   rL      s    r   rL   c                   8    e Zd ZdZdefdefgZd Zedd       Z	y)	_CXStringz)Helper for transforming CXString results.spellingfreec                 B    t         j                  j                  |        y r   )conflibclang_disposeStringr   s    r   __del__z_CXString.__del__   s    $$T*r   Nc                 d    t        | t              sJ t        j                  j	                  |       S r   )r   rU   rY   rZ   clang_getCStringresfnr,   s      r   from_resultz_CXString.from_result   s'    #y)))xx((--r   NN)
r&   r.   r/   r9   r   c_int_fields_r\   r2   rb   r:   r   r   rU   rU      s1    3X&8H+ . .r   rU   c                       e Zd ZdZdedz  fdefgZdZd Ze	d        Z
e	d        Zed	        Zed
        Zed        Zed        Zed        Zd Zd Zd Zy)SourceLocationzQ
    A SourceLocation represents a particular location within a source file.
    ptr_datar>   int_dataNc           	         | j                   t               t               t               t               f\  }}}}t        j                  j                  | t        |      t        |      t        |      t        |             |rt        |      }nd }|t        |j                        t        |j                        t        |j                        f| _         | j                   S r   )
_data
c_object_pc_uintrY   rZ   clang_getInstantiationLocationbyrefFilerB   r   )r   flcos        r   _get_instantiationz!SourceLocation._get_instantiation   s    ::#vx68CJAq!QHH33eAha%(E!H GS\3qww<QWWFDJzzr   c                 F    t         j                  j                  | |||      S )z
        Retrieve the source location associated with a given file/line/column in
        a particular translation unit.
        )rY   rZ   clang_getLocation)tufilelinecolumns       r   from_positionzSourceLocation.from_position   s     xx))"dD&AAr   c                 D    t         j                  j                  | ||      S )zRetrieve a SourceLocation from a given character offset.

        tu -- TranslationUnit file belongs to
        file -- File instance to obtain offset from
        offset -- Integer character offset within file
        )rY   rZ   clang_getLocationForOffset)rx   ry   offsets      r   from_offsetzSourceLocation.from_offset   s     xx222tVDDr   c                 (    | j                         d   S )z1Get the file represented by this source location.r   ru   r   s    r   ry   zSourceLocation.file        &&(++r   c                 (    | j                         d   S )z1Get the line represented by this source location.r=   r   r   s    r   rz   zSourceLocation.line  r   r   c                 (    | j                         d   S )z3Get the column represented by this source location.r>   r   r   s    r   r{   zSourceLocation.column  r   r   c                 (    | j                         d   S )z8Get the file offset represented by this source location.r?   r   r   s    r   r   zSourceLocation.offset  r   r   c                 @    t         j                  j                  |       S )z@Returns true if the given source location is in a system header.)rY   rZ   clang_Location_isInSystemHeaderr   s    r   is_in_system_headerz"SourceLocation.is_in_system_header       xx77==r   c                 B    t         j                  j                  | |      S r   )rY   rZ   clang_equalLocationsr   others     r   __eq__zSourceLocation.__eq__  s    xx,,T599r   c                 &    | j                  |       S r   r   r   s     r   __ne__zSourceLocation.__ne__      ;;u%%%r   c                     | j                   r| j                   j                  }nd }d|d| j                  d| j                  dS )Nz<SourceLocation file z, line z	, column >)ry   namerz   r{   r   filenames     r   __repr__zSourceLocation.__repr__  s7    99yy~~HHIIKK
 	
r   )r&   r.   r/   r9   c_void_prm   re   rk   ru   r2   r|   r   r0   ry   rz   r{   r   r   r   r   r   r:   r   r   rg   rg      s     X\*Z,@AHE B B E E , , , , , , , , > >:&	
r   rg   c                   t    e Zd ZdZdedz  fdefdefgZed        Ze	d        Z
e	d        Zd	 Zd
 Zd Zd Zy)SourceRangezY
    A SourceRange describes a range of source locations within the source
    code.
    rh   r>   begin_int_dataend_int_datac                 B    t         j                  j                  | |      S r   )rY   rZ   clang_getRangestartends     r   from_locationszSourceRange.from_locations5  s    xx&&uc22r   c                 @    t         j                  j                  |       S )zi
        Return a SourceLocation representing the first character within a
        source range.
        )rY   rZ   clang_getRangeStartr   s    r   r   zSourceRange.start9  s     xx++D11r   c                 @    t         j                  j                  |       S )zh
        Return a SourceLocation representing the last character within a
        source range.
        )rY   rZ   clang_getRangeEndr   s    r   r   zSourceRange.endA  s     xx))$//r   c                 B    t         j                  j                  | |      S r   )rY   rZ   clang_equalRangesr   s     r   r   zSourceRange.__eq__I  s    xx))$66r   c                 &    | j                  |       S r   r   r   s     r   r   zSourceRange.__ne__L  r   r   c                    t        |t              sy|j                  | j                  j                  no| j                  j                  j                  |j                  j                  k7  s7|j                  j                  | j
                  j                  j                  k7  ry| j                  j                  |j                  cxk  r| j
                  j                  k  ry | j                  j                  |j                  k(  r%| j                  j                  |j                  k  ryy|j                  | j
                  j                  k(  r$|j                  | j
                  j                  k  ryy)z$Useful to detect the Token/Lexer bugFT)r   rg   ry   r   r   r   rz   r{   r   s     r   __contains__zSourceRange.__contains__O  s    %0::$**//"9JJOO  EJJOO3zz$((--"4"44 ::??UZZ7$((--7 8ZZ__

*zz  ELL0
 	 ZZ488==(||txx.r   c                 <    d| j                   d| j                  dS )Nz<SourceRange start z, end r   r   r   s    r   r   zSourceRange.__repr__h  s    37::txxHHr   N)r&   r.   r/   r9   r   rm   re   r2   r   r0   r   r   r   r   r   r   r:   r   r   r   r   '  s}     
X\"	6"	 H 3 3 2 2 0 07&2Ir   r   c                      e Zd ZdZdZdZdZdZdZdZ	dZ
dZdZdZd	Zd
Zd Zd Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        ZddZd Zd Zd Z y)
Diagnosticz
    A Diagnostic is a single instance of a Clang diagnostic. It includes the
    diagnostic severity, the message, the location the diagnostic occurred, as
    well as additional source ranges and associated fix-it hints.
    r   r=   r>   r?                ?   c                     || _         y r   ptrr   r   s     r   r   zDiagnostic.__init__  s	    r   c                 B    t         j                  j                  |        y r   )rY   rZ   clang_disposeDiagnosticr   s    r   r\   zDiagnostic.__del__  s    ((.r   c                 @    t         j                  j                  |       S r   )rY   rZ   clang_getDiagnosticSeverityr   s    r   severityzDiagnostic.severity      xx33D99r   c                 @    t         j                  j                  |       S r   )rY   rZ   clang_getDiagnosticLocationr   s    r   locationzDiagnostic.location  r   r   c                 @    t         j                  j                  |       S r   )rY   rZ   clang_getDiagnosticSpellingr   s    r   rV   zDiagnostic.spelling  r   r   c                 &     G d d      } ||       S )Nc                       e Zd Zd Zd Zd Zy)(Diagnostic.ranges.<locals>.RangeIteratorc                     || _         y r   diagr   r   s     r   r   z1Diagnostic.ranges.<locals>.RangeIterator.__init__  	     	r   c                 f    t        t        j                  j                  | j                              S r   )rB   rY   rZ   clang_getDiagnosticNumRangesr   r   s    r   __len__z0Diagnostic.ranges.<locals>.RangeIterator.__len__       488@@KLLr   c                 ~    |t        |       k\  rt        t        j                  j	                  | j
                  |      S r   )len
IndexErrorrY   rZ   clang_getDiagnosticRanger   r   keys     r   __getitem__z4Diagnostic.ranges.<locals>.RangeIterator.__getitem__  s/    #d)#$$xx88CHHr   Nr&   r.   r/   r   r   r   r:   r   r   RangeIteratorr     s    !MIr   r   r:   )r   r   s     r   rangeszDiagnostic.ranges  s    
	I 
	I T""r   c                 &     G d d      } ||       S )Nc                       e Zd Zd Zd Zd Zy)(Diagnostic.fixits.<locals>.FixItIteratorc                     || _         y r   r   r   s     r   r   z1Diagnostic.fixits.<locals>.FixItIterator.__init__  r   r   c                 f    t        t        j                  j                  | j                              S r   )rB   rY   rZ   clang_getDiagnosticNumFixItsr   r   s    r   r   z0Diagnostic.fixits.<locals>.FixItIterator.__len__  r   r   c                     t               }t        j                  j                  | j                  |t        |            }t        |      dk(  rt        t        ||      S Nr   )	r   rY   rZ   clang_getDiagnosticFixItr   ro   r   r   FixIt)r   r   ranger   s       r   r   z4Diagnostic.fixits.<locals>.FixItIterator.__getitem__  sH    #99$))S%PU,Wu:?$$UE**r   Nr   r:   r   r   FixItIteratorr     s    !M+r   r   r:   )r   r   s     r   fixitszDiagnostic.fixits  s    	+ 	+ T""r   c                 &     G d d      } ||       S )Nc                       e Zd Zd Zd Zd Zy)5Diagnostic.children.<locals>.ChildDiagnosticsIteratorc                 L    t         j                  j                  |      | _        y r   )rY   rZ   clang_getChildDiagnosticsdiag_setr   s     r   r   z>Diagnostic.children.<locals>.ChildDiagnosticsIterator.__init__  s     $ B B4 Hr   c                 f    t        t        j                  j                  | j                              S r   )rB   rY   rZ   clang_getNumDiagnosticsInSetr   r   s    r   r   z=Diagnostic.children.<locals>.ChildDiagnosticsIterator.__len__  s     488@@OPPr   c                 |    t         j                  j                  | j                  |      }|st        t        |      S r   )rY   rZ   clang_getDiagnosticInSetr   r   r   r   r   r   s      r   r   zADiagnostic.children.<locals>.ChildDiagnosticsIterator.__getitem__  s0    xx88L$$!$''r   Nr   r:   r   r   ChildDiagnosticsIteratorr     s    IQ(r   r   r:   )r   r   s     r   childrenzDiagnostic.children  s    	( 	( (--r   c                 @    t         j                  j                  |       S )z<The category number for this diagnostic or 0 if unavailable.)rY   rZ   clang_getDiagnosticCategoryr   s    r   category_numberzDiagnostic.category_number  s     xx33D99r   c                 @    t         j                  j                  |       S )z4The string name of the category for this diagnostic.)rY   rZ   clang_getDiagnosticCategoryTextr   s    r   category_namezDiagnostic.category_name  r   r   c                 B    t         j                  j                  | d      S )z5The command-line option that enables this diagnostic.N)rY   rZ   clang_getDiagnosticOptionr   s    r   optionzDiagnostic.option  s     xx11$==r   c                     t               }t        j                  j                  | t	        |             t         j                  |      S )z6The command-line option that disables this diagnostic.)rU   rY   rZ   r   ro   rb   )r   disables     r   disable_optionzDiagnostic.disable_option  s4     +**4w@$$W--r   Nc                     |t         j                  j                         }|t        j                   z  rt        d      t         j                  j                  | |      S )z
        Format this diagnostic for display. The options argument takes
        Diagnostic.Display* flags, which can be combined using bitwise OR. If
        the options argument is not provided, the default display options will
        be used.
        zInvalid format options)rY   rZ   %clang_defaultDiagnosticDisplayOptionsr   _FormatOptionsMask
ValueErrorclang_formatDiagnostic)r   optionss     r   r$   zDiagnostic.format  sO     ?hhDDFGj3333566xx..tW==r   c                 V    d| j                   d| j                  d| j                  dS )Nz<Diagnostic severity z, location z, spelling r   )r   r   rV   r   s    r   r   zDiagnostic.__repr__  s!    MMMMMM
 	
r   c                 "    | j                         S r   )r$   r   s    r   r   zDiagnostic.__str__  s    {{}r   c                     | j                   S r   r   r   s    r   r)   zDiagnostic.from_param  s    xxr   r   )!r&   r.   r/   r9   IgnoredNoteWarningErrorFatalDisplaySourceLocationDisplayColumnDisplaySourceRangesDisplayOptionDisplayCategoryIdDisplayCategoryNamer  r   r\   r0   r   r   rV   r   r   r   r   r   r   r   r$   r   r   r)   r:   r   r   r   r   l  s0    GDGEE MM/ : : : : : : # # # #$ . .  : : > > > > . .>
r   r   c                       e Zd ZdZd Zd Zy)r   z
    A FixIt represents a transformation to be applied to the source to
    "fix-it". The fix-it should be applied by replacing the given source range
    with the given value.
    c                      || _         || _        y r   r   r   )r   r   r   s      r   r   zFixIt.__init__  s    

r   c                 <    d| j                   d| j                  dS )Nz<FixIt range z, value r   r  r   s    r   r   zFixIt.__repr__  s    /3zz4::FFr   N)r&   r.   r/   r9   r   r   r:   r   r   r   r     s    Gr   r   c                   ,    e Zd ZdZd Zd Zed        Zy)
TokenGroupaf  Helper class to facilitate token management.

    Tokens are allocated from libclang in chunks. They must be disposed of as a
    collective group.

    One purpose of this class is for instances to represent groups of allocated
    tokens. Each token in a group contains a reference back to an instance of
    this class. When all tokens from a group are garbage collected, it allows
    this class to be garbage collected. When this class is garbage collected,
    it calls the libclang destructor which invalidates all tokens in the group.

    You should not instantiate this class outside of this module.
    c                 .    || _         || _        || _        y r   )_tu_memory_count)r   rx   memorycounts       r   r   zTokenGroup.__init__  s    r   c                     t         j                  j                  | j                  | j                  | j
                         y r   )rY   rZ   clang_disposeTokensr  r  r  r   s    r   r\   zTokenGroup.__del__  s$    $$TXXt||T[[Ir   c              #     K    t        t                     }t               }t        j                  j                  | |t        |      t        |             t        |j                        }|dk  ryt        |t        t        |z              j                  }t        | ||      }t        d|      D ]F  }t               }||   j                  |_        ||   j                  |_        | |_        ||_        | H yw)zHelper method to return all tokens in an extent.

        This functionality is needed multiple places in this module. We define
        it here because it seems like a logical place.
        r=   Nr   )POINTERTokenrm   rY   rZ   clang_tokenizero   rB   r   castcontentsr  r   ri   rh   r  _group)	rx   extenttokens_memorytokens_countr   tokens_arraytoken_groupitokens	            r   
get_tokenszTokenGroup.get_tokens  s      '(xFE-,@%BUVL&&' 19M755=+ABKK ]LAq% 	AGE)!_55EN)!_55ENEI&ELK	s   C7C9N)r&   r.   r/   r9   r   r\   r2   r1  r:   r   r   r  r    s&    
J  r   r  c                   @    e Zd ZdZi Zd Zd Zed        Zed        Z	y)	TokenKindz%Describes a specific type of a Token.c                      || _         || _        y)z@Create a new TokenKind instance from a numeric value and a name.N)r   r   )r   r   r   s      r   r   zTokenKind.__init__D  s    
	r   c                      d| j                   S )Nz
TokenKind.r   r   s    r   r   zTokenKind.__repr__I  s    !%,,r   c                 f    t         j                  j                  | d      }|t        d| z        |S )z6Obtain a registered TokenKind instance from its value.NzUnknown TokenKind: %d)r3  
_value_mapgetr  )r   results     r   
from_valuezTokenKind.from_valueL  s7     %%))%6>4u<==r   c                     | t         j                  v rt        d| z        t        | |      }|t         j                  | <   t        t         ||       y)zRegister a new TokenKind enumeration.

        This should only be called at module load time by code within this
        package.
        z TokenKind already registered: %dN)r3  r8  r  rP   )r   r   kinds      r   registerzTokenKind.registerV  sK     I(((?%GHH%&*	U#	4&r   N)
r&   r.   r/   r9   r8  r   r   r2   r;  r>  r:   r   r   r3  r3  ?  s<    /J
-   ' 'r   r3  c                   B    e Zd ZdZd Zd Zed        Zed        Z	d Z
y)BaseEnumerationa!  
    Common base class for named enumerations held in sync with Index.h values.

    Subclasses must define their own _kinds and _name_map members, as:
    _kinds = []
    _name_map = None
    These values hold the per-subclass instances and value-to-name mappings,
    respectively.

    c                    |t        | j                  j                        k\  rF| j                  xj                  d g|t        | j                  j                        z
  dz   z  z  c_        | j                  j                  |   .t        dj	                  t        | j                        |            || _        | | j                  j                  |<   d | j                  _        y )Nr=   z{0} value {1} already loaded)r   r   _kindsr  r$   r   r   	_name_mapr   r   s     r   r   zBaseEnumeration.__init__r  s    C--..NN!!dVus4>>;P;P7Q/QTU/U%VV!>>  '3.55c$..6I5Q  
'+e$#' r   c                     | j                   S r   r   r   s    r   r)   zBaseEnumeration.from_param}  r   r   c                     | j                   Yi | _         | j                  j                  j                         D ]+  \  }}t	        || j                        s|| j                   |<   - | j                   |    S )z-Get the enumeration name of this cursor kind.)rC  r   __dict__itemsr   r   r   r   s      r   r   zBaseEnumeration.name  sh     >>!DN"nn55;;= 0
UeT^^4,/DNN5)0 ~~d##r   c                     |t        | j                        k\  s| j                  |   t        d|z        | j                  |   S )Nz!Unknown template argument kind %d)r   rB  r  )r'   ids     r   from_idzBaseEnumeration.from_id  s>    SZZ CJJrN$:@2EFFzz"~r   c                 8    | j                   d| j                  S )N.)r   r   r   s    r   r   zBaseEnumeration.__repr__  s    NNII
 	
r   N)r&   r.   r/   r9   r   r)   r0   r   r1   rL  r   r:   r   r   r@  r@  f  s>    		( $ $  

r   r@  c                   d    e Zd ZdZg ZdZed        Zd Zd Z	d Z
d Zd Zd	 Zd
 Zd Zd Zd Zy)
CursorKindzL
    A CursorKind describes the kind of entity that a cursor points to.
    Nc                  N    t         j                  D  cg c]  } | | 	 c} S c c} w )z,Return all CursorKind enumeration instances.)rP  rB  r5   s    r   get_all_kindszCursorKind.get_all_kinds  s"     &,,>aAI>>>s   ""c                 @    t         j                  j                  |       S )z#Test if this is a declaration kind.)rY   rZ   clang_isDeclarationr   s    r   is_declarationzCursorKind.is_declaration  s    xx++D11r   c                 @    t         j                  j                  |       S )z!Test if this is a reference kind.)rY   rZ   clang_isReferencer   s    r   is_referencezCursorKind.is_reference      xx))$//r   c                 @    t         j                  j                  |       S )z#Test if this is an expression kind.)rY   rZ   clang_isExpressionr   s    r   is_expressionzCursorKind.is_expression  s    xx**400r   c                 @    t         j                  j                  |       S )z!Test if this is a statement kind.)rY   rZ   clang_isStatementr   s    r   is_statementzCursorKind.is_statement  rY  r   c                 @    t         j                  j                  |       S )z"Test if this is an attribute kind.)rY   rZ   clang_isAttributer   s    r   is_attributezCursorKind.is_attribute  rY  r   c                 @    t         j                  j                  |       S )z Test if this is an invalid kind.)rY   rZ   clang_isInvalidr   s    r   
is_invalidzCursorKind.is_invalid      xx''--r   c                 @    t         j                  j                  |       S )z(Test if this is a translation unit kind.)rY   rZ   clang_isTranslationUnitr   s    r   is_translation_unitzCursorKind.is_translation_unit      xx//55r   c                 @    t         j                  j                  |       S )z%Test if this is a preprocessing kind.)rY   rZ   clang_isPreprocessingr   s    r   is_preprocessingzCursorKind.is_preprocessing  s    xx--d33r   c                 @    t         j                  j                  |       S )z"Test if this is an unexposed kind.)rY   rZ   clang_isUnexposedr   s    r   is_unexposedzCursorKind.is_unexposed  rY  r   c                      d| j                   S )NzCursorKind.r6  r   s    r   r   zCursorKind.__repr__  s    "&))--r   )r&   r.   r/   r9   rB  rC  r2   rR  rU  rX  r\  r_  rb  re  ri  rm  rp  r   r:   r   r   rP  rP    sW    
 FI? ?20100.640.r   rP  r=   r>   r?   r            r   	   
                  r                                                r   !   "   #   $   %   &   '   (   )   *   +   ,   -   .   /   0   1   2   F   G   H   I   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s   t   u   v   w   x   y   z   {   |   }   ~                                                                                                                                                                                                                                                                  i  i  i  i  i  i  i  i  i	  i
  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i   i!  i"  i#  i$  i%  i&  i'  i(  i)  i*  i+  i,  i-  i.  i/  i0  i^  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  iX  iY  iZ  i[  i\  i  c                       e Zd ZdZg ZdZy)TemplateArgumentKindzf
    A TemplateArgumentKind describes the kind of entity that a template argument
    represents.
    N)r&   r.   r/   r9   rB  rC  r:   r   r   r  r    s     FIr   r  c                       e Zd ZdZg ZdZd Zy)ExceptionSpecificationKindzn
    An ExceptionSpecificationKind describes the kind of exception specification
    that a function has.
    Nc                 8    dj                  | j                        S )NzExceptionSpecificationKind.{})r$   r   r   s    r   r   z#ExceptionSpecificationKind.__repr__  s    .55dii@@r   r&   r.   r/   r9   rB  rC  r   r:   r   r   r  r    s     FIAr   r  c                      e Zd ZdZdefdefdedz  fgZed        Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Ze d        Z!e d        Z"e d         Z#e d!        Z$e d"        Z%e d#        Z&e d$        Z'e d%        Z(e d&        Z)e d'        Z*e d(        Z+e d)        Z,e d*        Z-e d+        Z.e d,        Z/e d-        Z0e d.        Z1e d/        Z2e d0        Z3e d1        Z4e d2        Z5e d3        Z6e d4        Z7e d5        Z8e d6        Z9e d7        Z:d8 Z;d9 Z<d: Z=d; Z>d< Z?d= Z@d> ZAd? ZBd@ ZCdA ZDdB ZEdC ZFdD ZGedE        ZHedF        ZIyG)HCursorzr
    The Cursor class represents a reference to an element within the AST. It
    acts as a kind of iterator.
    _kind_idxdatadatar?   c                 T    t         j                  j                  | |      }| |_        |S r   )rY   rZ   clang_getCursorr  )rx   r   cursors      r   from_locationzCursor.from_location  s&     ))"h7
r   c                     | j                   S r   )hashr   s    r   __hash__zCursor.__hash__      yyr   c                 B    t         j                  j                  | |      S r   )rY   rZ   clang_equalCursorsr   s     r   r   zCursor.__eq__  s    xx**477r   c                 &    | j                  |       S r   r   r   s     r   r   zCursor.__ne__  r   r   c                 @    t         j                  j                  |       S )zw
        Returns true if the declaration pointed at by the cursor is also a
        definition of that entity.
        )rY   rZ   clang_isCursorDefinitionr   s    r   is_definitionzCursor.is_definition!  s    
 xx0066r   c                 @    t         j                  j                  |       S )zReturns True if the cursor refers to a C++ member function or member
        function template that is declared 'const'.
        )rY   rZ   clang_CXXMethod_isConstr   s    r   is_const_methodzCursor.is_const_method(       xx//55r   c                 @    t         j                  j                  |       S )zBReturns True if the cursor refers to a C++ converting constructor.)rY   rZ   ,clang_CXXConstructor_isConvertingConstructorr   s    r   is_converting_constructorz Cursor.is_converting_constructor.  s    xxDDTJJr   c                 @    t         j                  j                  |       S )z<Returns True if the cursor refers to a C++ copy constructor.)rY   rZ   &clang_CXXConstructor_isCopyConstructorr   s    r   is_copy_constructorzCursor.is_copy_constructor2      xx>>tDDr   c                 @    t         j                  j                  |       S )z?Returns True if the cursor refers to a C++ default constructor.)rY   rZ   )clang_CXXConstructor_isDefaultConstructorr   s    r   is_default_constructorzCursor.is_default_constructor6  s    xxAA$GGr   c                 @    t         j                  j                  |       S )z<Returns True if the cursor refers to a C++ move constructor.)rY   rZ   &clang_CXXConstructor_isMoveConstructorr   s    r   is_move_constructorzCursor.is_move_constructor:  r4  r   c                 @    t         j                  j                  |       S )zReturns True if the cursor refers to a C++ member function or member
        function template that is declared '= default'.
        )rY   rZ   clang_CXXMethod_isDefaultedr   s    r   is_default_methodzCursor.is_default_method>  s     xx33D99r   c                 @    t         j                  j                  |       S )zReturns True if the cursor refers to a C++ member function or member
        function template that is declared '= delete'.
        )rY   rZ   clang_CXXMethod_isDeletedr   s    r   is_deleted_methodzCursor.is_deleted_methodD       xx11$77r   c                 @    t         j                  j                  |       S )ad  Returnrs True if the cursor refers to a copy-assignment operator.

        A copy-assignment operator `X::operator=` is a non-static,
        non-template member function of _class_ `X` with exactly one
        parameter of type `X`, `X&`, `const X&`, `volatile X&` or `const
        volatile X&`.


        That is, for example, the `operator=` in:

           class Foo {
               bool operator=(const volatile Foo&);
           };

        Is a copy-assignment operator, while the `operator=` in:

           class Bar {
               bool operator=(const int&);
           };

        Is not.
        )rY   rZ   (clang_CXXMethod_isCopyAssignmentOperatorr   s    r   "is_copy_assignment_operator_methodz)Cursor.is_copy_assignment_operator_methodJ      . xx@@FFr   c                 @    t         j                  j                  |       S )ae  Returnrs True if the cursor refers to a move-assignment operator.

        A move-assignment operator `X::operator=` is a non-static,
        non-template member function of _class_ `X` with exactly one
        parameter of type `X&&`, `const X&&`, `volatile X&&` or `const
        volatile X&&`.


        That is, for example, the `operator=` in:

           class Foo {
               bool operator=(const volatile Foo&&);
           };

        Is a move-assignment operator, while the `operator=` in:

           class Bar {
               bool operator=(const int&&);
           };

        Is not.
        )rY   rZ   (clang_CXXMethod_isMoveAssignmentOperatorr   s    r   "is_move_assignment_operator_methodz)Cursor.is_move_assignment_operator_methodc  rE  r   c                 @    t         j                  j                  |       S )a  Determines if a C++ constructor or conversion function is
        explicit, returning 1 if such is the case and 0 otherwise.

        Constructors or conversion functions are declared explicit through
        the use of the explicit specifier.

        For example, the following constructor and conversion function are
        not explicit as they lack the explicit specifier:

            class Foo {
                Foo();
                operator int();
            };

        While the following constructor and conversion function are
        explicit as they are declared with the explicit specifier.

            class Foo {
                explicit Foo();
                explicit operator int();
            };

        This method will return 0 when given a cursor pointing to one of
        the former declarations and it will return 1 for a cursor pointing
        to the latter declarations.

        The explicit specifier allows the user to specify a
        conditional compile-time expression whose value decides
        whether the marked element is explicit or not.

        For example:

            constexpr bool foo(int i) { return i % 2 == 0; }

            class Foo {
                 explicit(foo(1)) Foo();
                 explicit(foo(2)) operator int();
            }

        This method will return 0 for the constructor and 1 for
        the conversion function.
        )rY   rZ   clang_CXXMethod_isExplicitr   s    r   is_explicit_methodzCursor.is_explicit_method|  s    V xx22488r   c                 @    t         j                  j                  |       S )z]Returns True if the cursor refers to a C++ field that is declared
        'mutable'.
        )rY   rZ   clang_CXXField_isMutabler   s    r   is_mutable_fieldzCursor.is_mutable_field       xx0066r   c                 @    t         j                  j                  |       S )zReturns True if the cursor refers to a C++ member function or member
        function template that is declared pure virtual.
        )rY   rZ   clang_CXXMethod_isPureVirtualr   s    r   is_pure_virtual_methodzCursor.is_pure_virtual_method  s     xx55d;;r   c                 @    t         j                  j                  |       S )zReturns True if the cursor refers to a C++ member function or member
        function template that is declared 'static'.
        )rY   rZ   clang_CXXMethod_isStaticr   s    r   is_static_methodzCursor.is_static_method  rO  r   c                 @    t         j                  j                  |       S )zReturns True if the cursor refers to a C++ member function or member
        function template that is declared 'virtual'.
        )rY   rZ   clang_CXXMethod_isVirtualr   s    r   is_virtual_methodzCursor.is_virtual_method  rA  r   c                 @    t         j                  j                  |       S )zvReturns True if the cursor refers to a C++ record declaration
        that has pure virtual member functions.
        )rY   rZ   clang_CXXRecord_isAbstractr   s    r   is_abstract_recordzCursor.is_abstract_record       xx22488r   c                 @    t         j                  j                  |       S )z?Returns True if the cursor refers to a scoped enum declaration.)rY   rZ   clang_EnumDecl_isScopedr   s    r   is_scoped_enumzCursor.is_scoped_enum  rj  r   c                 @    t         j                  j                  |       S )z
        If the cursor is a reference to a declaration or a declaration of
        some entity, return a cursor that points to the definition of that
        entity.
        )rY   rZ   clang_getCursorDefinitionr   s    r   get_definitionzCursor.get_definition  s     xx11$77r   c                 @    t         j                  j                  |       S )a  Return the Unified Symbol Resolution (USR) for the entity referenced
        by the given cursor (or None).

        A Unified Symbol Resolution (USR) is a string that identifies a
        particular entity (function, class, variable, etc.) within a
        program. USRs can be compared across translation units to determine,
        e.g., when references in one translation refer to an entity defined in
        another translation unit.)rY   rZ   clang_getCursorUSRr   s    r   get_usrzCursor.get_usr  s     xx**400r   c                 ~    | j                   t        j                  k(  sJ t        j                  j                  |       S )zBReturns the File that is included by the current inclusion cursor.)r=  rP  INCLUSION_DIRECTIVErY   rZ   clang_getIncludedFiler   s    r   get_included_filezCursor.get_included_file  s/    yyJ:::::xx--d33r   c                 @    t         j                  | j                        S )zReturn the kind of this cursor.)rP  rL  r  r   s    r   r=  zCursor.kind  s     !!$--00r   c                 z    t        | d      s$t        j                  j                  |       | _        | j                  S )z;Return the spelling of the entity pointed at by the cursor.	_spelling)hasattrrY   rZ   clang_getCursorSpellingrl  r   s    r   rV   zCursor.spelling  s.     t[)!XX==dCDN~~r   c                 z    t        | d      s$t        j                  j                  |       | _        | j                  S )a  
        Return the display name for the entity referenced by this cursor.

        The display name contains extra information that helps identify the
        cursor, such as the parameters of a function or template or the
        arguments of a class template specialization.
        _displayname)rm  rY   rZ   clang_getCursorDisplayNamerp  r   s    r   displaynamezCursor.displayname  s1     t^, $ C CD ID   r   c                 z    t        | d      s$t        j                  j                  |       | _        | j                  S )zAReturn the mangled name for the entity referenced by this cursor._mangled_name)rm  rY   rZ   clang_Cursor_getManglingrt  r   s    r   mangled_namezCursor.mangled_name  s1     t_-!%!B!B4!HD!!!r   c                 z    t        | d      s$t        j                  j                  |       | _        | j                  S )zu
        Return the source location (the starting character) of the entity
        pointed at by the cursor.
        _loc)rm  rY   rZ   clang_getCursorLocationrx  r   s    r   r   zCursor.location	  s.     tV$88>DIyyr   c                     t        | d      s$t        j                  j                  |       | _        t
        j                  | j                        S )z"Return the linkage of this cursor._linkage)rm  rY   rZ   clang_getCursorLinkager{  LinkageKindrL  r   s    r   linkagezCursor.linkage  s9     tZ( HH;;DADM""4==11r   c                     t        | d      s$t        j                  j                  |       | _        t
        j                  | j                        S )z:Return the thread-local storage (TLS) kind of this cursor.	_tls_kind)rm  rY   rZ   clang_getCursorTLSKindr  TLSKindrL  r   s    r   tls_kindzCursor.tls_kind  s7     t[)!XX<<TBDNt~~..r   c                 z    t        | d      s$t        j                  j                  |       | _        | j                  S )zv
        Return the source range (the range of text) occupied by the entity
        pointed at by the cursor.
        _extent)rm  rY   rZ   clang_getCursorExtentr  r   s    r   r*  zCursor.extent$  s.     tY'8899$?DL||r   c                     t        | d      s$t        j                  j                  |       | _        t
        j                  | j                        S )zf
        Retrieves the storage class (if any) of the entity pointed at by the
        cursor.
        _storage_class)rm  rY   rZ   clang_Cursor_getStorageClassr  StorageClassrL  r   s    r   storage_classzCursor.storage_class/  s=     t-."&(("G"G"MD##D$7$788r   c                     t        | d      s$t        j                  j                  |       | _        t
        j                  | j                        S )zT
        Retrieves the availability of the entity pointed at by the cursor.
        _availability)rm  rY   rZ   clang_getCursorAvailabilityr  AvailabilityKindrL  r   s    r   availabilityzCursor.availability:  s<    
 t_-!%!E!Ed!KD''(:(:;;r   c                     t        | d      s$t        j                  j                  |       | _        t
        j                  | j                        S )zi
        Retrieves the access specifier (if any) of the entity pointed at by the
        cursor.
        _access_specifier)rm  rY   rZ   clang_getCXXAccessSpecifierr  AccessSpecifierrL  r   s    r   access_specifierzCursor.access_specifierD  s=     t01%)XX%I%I$%OD"&&t'='=>>r   c                 z    t        | d      s$t        j                  j                  |       | _        | j                  S )zT
        Retrieve the Type (if any) of the entity pointed at by the cursor.
        _type)rm  rY   rZ   clang_getCursorTyper  r   s    r   r%   zCursor.typeO  s.    
 tW%55d;DJzzr   c                 z    t        | d      s$t        j                  j                  |       | _        | j                  S )aI  Return the canonical Cursor corresponding to this Cursor.

        The canonical cursor is the cursor which is representative for the
        underlying entity. For example, if you have multiple forward
        declarations for the same class, the canonical cursor for the forward
        declarations will be identical.
        
_canonical)rm  rY   rZ   clang_getCanonicalCursorr  r   s    r   	canonicalzCursor.canonicalY  s.     t\*"hh??EDOr   c                 z    t        | d      s$t        j                  j                  |       | _        | j                  S )z0Retrieve the Type of the result for this Cursor._result_type)rm  rY   rZ   clang_getCursorResultTyper  r   s    r   result_typezCursor.result_typeg  s1     t^, $ B B4 HD   r   c                     t        | d      s9t        j                  j                  |       }t        j                  |      | _        | j                  S )z
        Retrieve the exception specification kind, which is one of the values
        from the ExceptionSpecificationKind enumeration.
        _exception_specification_kind)rm  rY   rZ   )clang_getCursorExceptionSpecificationTyper  rL  r  )r   exc_kinds     r   exception_specification_kindz#Cursor.exception_specification_kindo  sG     t<=xxII$OH1K1S1S2D. 111r   c                     t        | d      s@| j                  j                         sJ t        j                  j                  |       | _        | j                  S )zReturn the underlying type of a typedef declaration.

        Returns a Type for the typedef this cursor is a declaration for. If
        the current cursor is not a typedef, this raises.
        _underlying_type)rm  r=  rU  rY   rZ   "clang_getTypedefDeclUnderlyingTyper  r   s    r   underlying_typedef_typezCursor.underlying_typedef_type}  sI     t/099++---$(HH$O$OPT$UD!$$$r   c                     t        | d      sC| j                  t        j                  k(  sJ t        j
                  j                  |       | _        | j                  S )zReturn the integer type of an enum declaration.

        Returns a Type corresponding to an integer. If the cursor is not for an
        enum, this raises.
        
_enum_type)rm  r=  rP  	ENUM_DECLrY   rZ   clang_getEnumDeclIntegerTyper  r   s    r   	enum_typezCursor.enum_type  sF     t\*99
 4 4444"hhCCDIDOr   c           
         t        | d      sK| j                  t        j                  k(  sJ | j                  }|j                  t
        j                  k(  r|j                         j                  }|j                  t
        j                  t
        j                  t
        j                  t
        j                  t
        j                  t
        j                  t
        j                  t
        j                   t
        j"                  f	v r0t$        j&                  j)                  |       | _        | j*                  S t$        j&                  j-                  |       | _        | j*                  S )z%Return the value of an enum constant._enum_value)rm  r=  rP  ENUM_CONSTANT_DECLr%   TypeKindENUMget_declarationr  CHAR_UUCHARCHAR16CHAR32USHORTUINTULONG	ULONGLONGUINT128rY   rZ   &clang_getEnumConstantDeclUnsignedValuer  clang_getEnumConstantDeclValue)r   underlying_types     r   
enum_valuezCursor.enum_value  s     t]+99
 = ==== #iiO##x}}4"1"A"A"C"M"M##""  
( 
 $(88#R#RSW#X   $(88#J#J4#P r   c                 z    t        | d      s$t        j                  j                  |       | _        | j                  S )z.Return the Objective-C type encoding as a str._objc_type_encoding)rm  rY   rZ   clang_getDeclObjCTypeEncodingr  r   s    r   objc_type_encodingzCursor.objc_type_encoding  s2     t23'+xx'M'Md'SD$'''r   c                 z    t        | d      s$t        j                  j                  |       | _        | j                  S )z'Returns a hash of the cursor as an int._hash)rm  rY   rZ   clang_hashCursorr  r   s    r   r!  zCursor.hash  s.     tW%2248DJzzr   c                 z    t        | d      s$t        j                  j                  |       | _        | j                  S )z+Return the semantic parent for this cursor._semantic_parent)rm  rY   rZ   clang_getCursorSemanticParentr  r   s    r   semantic_parentzCursor.semantic_parent  s2     t/0$(HH$J$J4$PD!$$$r   c                 z    t        | d      s$t        j                  j                  |       | _        | j                  S )z*Return the lexical parent for this cursor._lexical_parent)rm  rY   rZ   clang_getCursorLexicalParentr  r   s    r   lexical_parentzCursor.lexical_parent  s2     t./#'88#H#H#ND ###r   c                     | j                   S )z9Returns the TranslationUnit to which this Cursor belongs.r  r   s    r   translation_unitzCursor.translation_unit      
 xxr   c                 z    t        | d      s$t        j                  j                  |       | _        | j                  S )zx
        For a cursor that is a reference, returns a cursor
        representing the entity that it references.
        _referenced)rm  rY   rZ   clang_getCursorReferencedr  r   s    r   
referencedzCursor.referenced  s1     t]+#xxAA$GDr   c                 @    t         j                  j                  |       S )z:Returns the brief comment text associated with that Cursor)rY   rZ    clang_Cursor_getBriefCommentTextr   s    r   brief_commentzCursor.brief_comment       xx88>>r   c                 @    t         j                  j                  |       S )z8Returns the raw comment text associated with that Cursor)rY   rZ   clang_Cursor_getRawCommentTextr   s    r   raw_commentzCursor.raw_comment       xx66t<<r   c              #      K   t         j                  j                  |       }t        d|      D ]$  }t         j                  j	                  | |       & yw)z>Return an iterator for accessing the arguments of this cursor.r   N)rY   rZ   clang_Cursor_getNumArgumentsr   clang_Cursor_getArgument)r   num_argsr/  s      r   get_argumentszCursor.get_arguments  sG     8888>q(# 	=A((33D!<<	=s   AAc                 @    t         j                  j                  |       S )z@Returns the number of template args associated with this cursor.)rY   rZ   $clang_Cursor_getNumTemplateArgumentsr   s    r   get_num_template_argumentsz!Cursor.get_num_template_arguments  s    xx<<TBBr   c                 B    t         j                  j                  | |      S )zMReturns the TemplateArgumentKind for the indicated template
        argument.)rY   rZ   $clang_Cursor_getTemplateArgumentKindr   nums     r   get_template_argument_kindz!Cursor.get_template_argument_kind  s     xx<<T3GGr   c                 B    t         j                  j                  | |      S )z7Returns the CXType for the indicated template argument.)rY   rZ   $clang_Cursor_getTemplateArgumentTyper  s     r   get_template_argument_typez!Cursor.get_template_argument_type  s    xx<<T3GGr   c                 B    t         j                  j                  | |      S )z?Returns the value of the indicated arg as a signed 64b integer.)rY   rZ   %clang_Cursor_getTemplateArgumentValuer  s     r   get_template_argument_valuez"Cursor.get_template_argument_value   s    xx==dCHHr   c                 B    t         j                  j                  | |      S )zBReturns the value of the indicated arg as an unsigned 64b integer.)rY   rZ   -clang_Cursor_getTemplateArgumentUnsignedValuer  s     r   $get_template_argument_unsigned_valuez+Cursor.get_template_argument_unsigned_value  s    xxEEdCPPr   c                       fd}g }t         j                  j                   t        d   |      |       t	        |      S )z=Return an iterator for accessing the children of this cursor.c                     | t         j                  j                         k7  sJ j                  | _        |j	                  |        yNr=   rY   rZ   clang_getNullCursorr  append)childparentr   r   s      r   visitorz$Cursor.get_children.<locals>.visitor  s<     DHH88:::: EIOOE"r   cursor_visit)rY   rZ   clang_visitChildren	callbacksiter)r   r  r   s   `  r   get_childrenzCursor.get_children  s9    	 $$T9^+DW+MxXH~r   c              #   p   K   |  | j                         D ]  }|j                         D ]  }|   yw)z`Depth-first preorder walk over the cursor and its descendants.

        Yields cursors.
        N)r  walk_preorder)r   r  
descendants      r   r  zCursor.walk_preorder  sC     
 
&&( 	!E#113 !
  !	!s   46c                 V    t         j                  | j                  | j                        S )zObtain Token instances formulating that compose this Cursor.

        This is a generator for Token instances. It returns all tokens which
        occupy the extent this cursor occupies.
        )r  r1  r  r*  r   s    r   r1  zCursor.get_tokens$  s     $$TXXt{{;;r   c                 @    t         j                  j                  |       S )z;Returns the offsetof the FIELD_DECL pointed by this Cursor.)rY   rZ   clang_Cursor_getOffsetOfFieldr   s    r   get_field_offsetofzCursor.get_field_offsetof,  s    xx55d;;r   c                     | j                   t        j                  k(  r(| j                  j	                         j                         S t        j                  j                  |       S )z3
        Check if the record is anonymous.
        )	r=  rP  
FIELD_DECLr%   r  is_anonymousrY   rZ   clang_Cursor_isAnonymousr   s    r   r  zCursor.is_anonymous0  sG     99
---99,,.;;==xx0066r   c                 @    t         j                  j                  |       S )z3
        Check if the field is a bitfield.
        )rY   rZ   clang_Cursor_isBitFieldr   s    r   is_bitfieldzCursor.is_bitfield8  r-  r   c                 @    t         j                  j                  |       S )z3
        Retrieve the width of a bitfield.
        )rY   rZ   clang_getFieldDeclBitWidthr   s    r   get_bitfield_widthzCursor.get_bitfield_width>  r\  r   c                     t        | t              sJ | t        j                  j	                         k(  ry d }|D ]0  }t        |t
              r|} nt        |d      s$|j                  } n |J || _        | S Nr  )	r   r  rY   rZ   r  TranslationUnitrm  r  r  r`   ra   r,   rx   args        r   rb   zCursor.from_resultD  s    #v&&&$((..00  	C#/s./))	 ~~
r   c                     t        | t              sJ | t        j                  j	                         k(  ry |d   j
                  | _        | S r   )r   r  rY   rZ   r  r  r_   s      r   from_cursor_resultzCursor.from_cursor_result\  s>    #v&&&$((..00q'++
r   N)Jr&   r.   r/   r9   rd   r   re   r2   r  r"  r   r   r)  r,  r0  r3  r7  r:  r=  r@  rD  rH  rK  rN  rR  rU  rX  r[  r_  rb  re  ri  r0   r=  rV   rr  rv  r   r~  r  r*  r  r  r  r%   r  r  r  r  r  r  r  r!  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r1  r  r  r  r  rb   r  r:   r   r   r  r    s*   
 U#gu%517MNH 8&76KEHE:8G2G2+9Z7<78968	14 1 1   ! ! " "   2 2 / /   9 9 < < ? ?     ! ! 2 2 
% 
% 
 
    2 ( (   % % $ $       ? ? = ==CH
HIQ$!<<769  .  r   r  c                   J    e Zd ZdZg ZdZd Zd Zed        Z	e
d        Zd Zy)r  z6
    Describes the storage class of a declaration
    Nc                 6   |t        t        j                        k\  r:t        xj                  d g|t        t        j                        z
  dz   z  z  c_        t        j                  |   t        d      || _        | t        j                  |<   d t        _        y )Nr=   zStorageClass already loaded)r   r  rB  r  r   rC  rD  s     r   r   zStorageClass.__init__o  s    C++,,D6US9L9L5M-MPQ-Q#RRu%1:;;
%)E"!%r   c                     | j                   S r   r   r   s    r   r)   zStorageClass.from_paramx  r   r   c                     | j                   Mi | _         t        j                  j                         D ]%  \  }}t	        |t              s|| j                   |<   ' | j                   |    S )z/Get the enumeration name of this storage class.)rC  r  rG  rH  r   rI  s      r   r   zStorageClass.name{  s`     >>!DN*3399; 0
Ue\2,/DNN5)0 ~~d##r   c                     | t        t        j                        k\  st        j                  |    st        d| z        t        j                  |    S )NzUnknown storage class %d)r   r  rB  r  )rK  s    r   rL  zStorageClass.from_id  sD    \(())1D1DR1H7"<==""2&&r   c                      d| j                   S )NzStorageClass.r6  r   s    r   r   zStorageClass.__repr__  s    $(II//r   )r&   r.   r/   r9   rB  rC  r   r)   r0   r   r2   rL  r   r:   r   r   r  r  f  sJ    
 FI& $ $ ' '
0r   r  c                       e Zd ZdZg ZdZd Zy)r  z2
    Describes the availability of an entity.
    Nc                      d| j                   S )NzAvailabilityKind.r6  r   s    r   r   zAvailabilityKind.__repr__      (,		33r   r  r:   r   r   r  r    s    
 FI4r   r  c                   $    e Zd ZdZg ZdZd Zd Zy)r  z4
    Describes the access of a C++ class member
    Nc                     | j                   S r   r   r   s    r   r)   zAccessSpecifier.from_param  r   r   c                      d| j                   S )NzAccessSpecifier.r6  r   s    r   r   zAccessSpecifier.__repr__  s    '+yy22r   r&   r.   r/   r9   rB  rC  r)   r   r:   r   r   r  r    s    
 FI3r   r  c                   .    e Zd ZdZg ZdZed        Zd Zy)r  z%
    Describes the kind of type.
    Nc                 T    t         j                  j                  | j                        S )z'Retrieve the spelling of this TypeKind.)rY   rZ   clang_getTypeKindSpellingr   r   s    r   rV   zTypeKind.spelling  s     xx11$**==r   c                      d| j                   S )Nz	TypeKind.r6  r   s    r   r   zTypeKind.__repr__  s     $		++r   )	r&   r.   r/   r9   rB  rC  r0   rV   r   r:   r   r   r  r    s*    
 FI> >,r   r                          c                   $    e Zd ZdZg ZdZd Zd Zy)RefQualifierKindz-Describes a specific ref-qualifier of a type.Nc                     | j                   S r   r   r   s    r   r)   zRefQualifierKind.from_paramE	  r   r   c                      d| j                   S )NzRefQualifierKind.r6  r   s    r   r   zRefQualifierKind.__repr__H	  r%  r   r)  r:   r   r   r7  r7  >	  s    7 FI4r   r7  c                   $    e Zd ZdZg ZdZd Zd Zy)r}  z*Describes the kind of linkage of a cursor.Nc                     | j                   S r   r   r   s    r   r)   zLinkageKind.from_paramX	  r   r   c                      d| j                   S )NzLinkageKind.r6  r   s    r   r   zLinkageKind.__repr__[	  s    #'99..r   r)  r:   r   r   r}  r}  Q	  s    4 FI/r   r}  c                   $    e Zd ZdZg ZdZd Zd Zy)r  z=Describes the kind of thread-local storage (TLS) of a cursor.Nc                     | j                   S r   r   r   s    r   r)   zTLSKind.from_paramm	  r   r   c                      d| j                   S )NzTLSKind.r6  r   s    r   r   zTLSKind.__repr__p	  s    #yy**r   r)  r:   r   r   r  r  f	  s    G FI+r   r  c                   "   e Zd ZdZdefdedz  fgZed        Zd Z	ed        Z
ed        Zed	        Zed
        Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d Z"d Z#d  Z$d! Z%ed"        Z&d# Z'd$ Z(y%)&Typez=
    The type of an element in the abstract syntax tree.
    r  r  r>   c                 @    t         j                  | j                        S )zReturn the kind of this type.)r  rL  r  r   s    r   r=  z	Type.kind	  s     ..r   c                      G d dt         j                  j                        }| j                  t        j
                  k(  sJ  ||       S )zRetrieve a container for the non-variadic arguments for this type.

        The returned object is iterable and indexable. Each item in the
        container is a Type instance.
        c                       e Zd Zd Zd Zd Zy).Type.argument_types.<locals>.ArgumentsIteratorc                      || _         d | _        y r   )r  length)r   r  s     r   r   z7Type.argument_types.<locals>.ArgumentsIterator.__init__	  s    $"r   c                     | j                   .t        j                  j                  | j                        | _         | j                   S r   )rG  rY   rZ   clang_getNumArgTypesr  r   s    r   r   z6Type.argument_types.<locals>.ArgumentsIterator.__len__	  s0    ;;&"&(("?"?"LDK{{"r   c                 N   t        |t              st        d      |dk  rt        d      |t	        |       k\  rt        d|t	        |       fz        t
        j                  j                  | j                  |      }|j                  t        j                  k(  rt        d      |S )NzMust supply a non-negative int.r   z'Only non-negative indexes are accepted.z,Index greater than container length: %d > %dz Argument could not be retrieved.)r   rB   r#   r   r   rY   rZ   clang_getArgTyper  r=  r  INVALID)r   r   r:  s      r   r   z:Type.argument_types.<locals>.ArgumentsIterator.__getitem__	  s    !#s+#$EFF7$%NOO#d)#$"%(#d)$45 
 224;;D;;("2"22$%GHHr   Nr   r:   r   r   ArgumentsIteratorrE  	  s    ##r   rM  )collectionsabcSequencer=  r  FUNCTIONPROTO)r   rM  s     r   argument_typeszType.argument_types	  s=    	 8 8 	> yyH22222 &&r   c                     t         j                  j                  |       }|j                  t        j
                  k(  rt        d      |S )zRetrieve the Type of elements within this Type.

        If accessed on a type that is not an array, complex, or vector type, an
        exception will be raised.
        z(Element type not available on this type.)rY   rZ   clang_getElementTyper=  r  rL  rC   r   r:  s     r   element_typezType.element_type	  s;     ..t4;;(***FGGr   c                 d    t         j                  j                  |       }|dk  rt        d      |S )zRetrieve the number of elements in this type.

        Returns an int.

        If the Type is not an array or vector, this raises.
        r   zType does not have elements.)rY   rZ   clang_getNumElementsrC   rU  s     r   element_countzType.element_count	  s0     ..t4A::;;r   c                     | j                   S )z5The TranslationUnit to which this Type is associated.r  r   s    r   r  zType.translation_unit	  r  r   c                     t        | t              sJ d }|D ]  }t        |d      s|j                  } n |J || _        | S r  )r   rA  rm  r  r  r  s        r   rb   zType.from_result	  sW    #t$$$ 	Cs./))	
 ~~
r   c                 @    t         j                  j                  |       S r   )rY   rZ   "clang_Type_getNumTemplateArgumentsr   s    r   r  zType.get_num_template_arguments	  s    xx::4@@r   c                 B    t         j                  j                  | |      S r   )rY   rZ   $clang_Type_getTemplateArgumentAsTyper  s     r   r  zType.get_template_argument_type	  s    xx<<T3GGr   c                 @    t         j                  j                  |       S )ae  
        Return the canonical type for a Type.

        Clang's type system explicitly models typedefs and all the
        ways a specific type can be represented.  The canonical type
        is the underlying type with all the "sugar" removed.  For
        example, if 'T' is a typedef for 'int', the canonical type for
        'T' would be 'int'.
        )rY   rZ   clang_getCanonicalTyper   s    r   get_canonicalzType.get_canonical	  s     xx..t44r   c                 @    t         j                  j                  |       S )zDetermine whether a Type has the "const" qualifier set.

        This does not look through typedefs that may have added "const"
        at a different level.
        )rY   rZ   clang_isConstQualifiedTyper   s    r   is_const_qualifiedzType.is_const_qualified	  s     xx22488r   c                 @    t         j                  j                  |       S )zDetermine whether a Type has the "volatile" qualifier set.

        This does not look through typedefs that may have added "volatile"
        at a different level.
        )rY   rZ   clang_isVolatileQualifiedTyper   s    r   is_volatile_qualifiedzType.is_volatile_qualified	       xx55d;;r   c                 @    t         j                  j                  |       S )zDetermine whether a Type has the "restrict" qualifier set.

        This does not look through typedefs that may have added "restrict" at
        a different level.
        )rY   rZ   clang_isRestrictQualifiedTyper   s    r   is_restrict_qualifiedzType.is_restrict_qualified
  ri  r   c                 ~    | j                   t        j                  k(  sJ t        j                  j                  |       S )zADetermine whether this function Type is a variadic function type.)r=  r  rQ  rY   rZ   clang_isFunctionTypeVariadicr   s    r   is_function_variadiczType.is_function_variadic	
  s/    yyH22222xx44T::r   c                 @    t         j                  j                  |       S r   )rY   rZ   clang_getAddressSpacer   s    r   get_address_spacezType.get_address_space
  s    xx--d33r   c                 @    t         j                  j                  |       S r   )rY   rZ   clang_getTypedefNamer   s    r   get_typedef_namezType.get_typedef_name
  s    xx,,T22r   c                 @    t         j                  j                  |       S )z<Determine whether this Type represents plain old data (POD).)rY   rZ   clang_isPODTyper   s    r   is_podzType.is_pod
  rf  r   c                 @    t         j                  j                  |       S )zE
        For pointer types, returns the type of the pointee.
        )rY   rZ   clang_getPointeeTyper   s    r   get_pointeezType.get_pointee
       xx,,T22r   c                 @    t         j                  j                  |       S )zJ
        Return the cursor for the declaration of the given type.
        )rY   rZ   clang_getTypeDeclarationr   s    r   r  zType.get_declaration
  rO  r   c                 @    t         j                  j                  |       S )zK
        Retrieve the result type associated with a function type.
        )rY   rZ   clang_getResultTyper   s    r   
get_resultzType.get_result%
  s     xx++D11r   c                 @    t         j                  j                  |       S )zF
        Retrieve the type of the elements of the array type.
        )rY   rZ   clang_getArrayElementTyper   s    r   get_array_element_typezType.get_array_element_type+
  rA  r   c                 @    t         j                  j                  |       S )z:
        Retrieve the size of the constant array.
        )rY   rZ   clang_getArraySizer   s    r   get_array_sizezType.get_array_size1
  s     xx**400r   c                 @    t         j                  j                  |       S )zE
        Retrieve the class type of the member pointer type.
        )rY   rZ   clang_Type_getClassTyper   s    r   get_class_typezType.get_class_type7
  r-  r   c                 @    t         j                  j                  |       S )z>
        Retrieve the type named by the qualified-id.
        )rY   rZ   clang_Type_getNamedTyper   s    r   get_named_typezType.get_named_type=
  r-  r   c                 @    t         j                  j                  |       S )z7
        Retrieve the alignment of the record.
        )rY   rZ   clang_Type_getAlignOfr   s    r   	get_alignzType.get_alignC
  s     xx--d33r   c                 @    t         j                  j                  |       S )z2
        Retrieve the size of the record.
        )rY   rZ   clang_Type_getSizeOfr   s    r   get_sizezType.get_sizeI
  r|  r   c                 B    t         j                  j                  | |      S )z?
        Retrieve the offset of a field in the record.
        )rY   rZ   clang_Type_getOffsetOf)r   	fieldnames     r   
get_offsetzType.get_offsetO
  s     xx..tY??r   c                 f    t         j                  t        j                  j	                  |             S )z9
        Retrieve the ref-qualifier of the type.
        )r7  rL  rY   rZ   clang_Type_getCXXRefQualifierr   s    r   get_ref_qualifierzType.get_ref_qualifierU
  s$      ''(N(Nt(TUUr   c                       fd}g t         j                  j                   t        d   |             t	              S )z9Return an iterator for accessing the fields of this type.c                     | t         j                  j                         k7  sJ j                  | _        j	                  |        yr  r  )fieldr   fieldsr   s     r   r  z Type.get_fields.<locals>.visitor^
  s:    DHH88:::: EIMM% r   fields_visit)rY   rZ   clang_Type_visitFieldsr  r  )r   r  r  s   ` @r   
get_fieldszType.get_fields[
  s>    	 '')N+G4f	
 F|r   c                 z    t         j                  t        j                  j                  j                  |             S )z
        Return the kind of the exception specification; a value from
        the ExceptionSpecificationKind enumeration.
        )r  rL  rY   rZ   clanggetExceptionSpecificationTyper   s    r    get_exception_specification_kindz%Type.get_exception_specification_kindl
  s-    
 *11HHNN88>
 	
r   c                 @    t         j                  j                  |       S )z#Retrieve the spelling of this Type.)rY   rZ   clang_getTypeSpellingr   s    r   rV   zType.spellingu
  s     xx--d33r   c                 r    t        |      t        |       k7  ryt        j                  j                  | |      S )NF)r%   rY   rZ   clang_equalTypesr   s     r   r   zType.__eq__z
  s,    ;$t*$xx((u55r   c                 &    | j                  |       S r   r   r   s     r   r   zType.__ne__
  r   r   N))r&   r.   r/   r9   rd   r   re   r0   r=  rR  rV  rY  r  r2   rb   r  r  rb  re  rh  rl  ro  rr  ru  rx  r{  r  r  r  r  r  r  r  r  r  r  r  r  rV   r   r   r:   r   r   rA  rA  y	  s    U#fhl%;<H/ /''R 
 
      AH
59<<;43.372816643@V"
 4 46&r   rA  c                       e Zd ZdZd Zd Zy)ClangObjectz
    A helper for Clang objects. This class helps act as an intermediary for
    the ctypes library and the Clang CIndex library.
    c                 H    t        |t              r|sJ |x| _        | _        y r   )r   rl   obj_as_parameter_)r   r  s     r   r   zClangObject.__init__
  s#    #z*s22),,4&r   c                     | j                   S r   r  r   s    r   r)   zClangObject.from_param
      """r   N)r&   r.   r/   r9   r   r)   r:   r   r   r  r  
  s    
-#r   r  c                   &    e Zd ZdZdefdefdefgZy)_CXUnsavedFilez*Helper for passing unsaved file arguments.r   r(  rG  N)r&   r.   r/   r9   r   c_ulongre   r:   r   r   r  r  
  s     4"Z$:Xw<OPHr   r  ()[]{}<r   z, :;= )rs  rt  r   ru  rv  rw  rx  ry  rz  r   r|  r}  r~  c                       e Zd Z G d d      Zd Zd Zed        Zed        Z	ed        Z
ed        Zd	 Zd
 Zd Zd Zd Zy)CompletionChunkc                       e Zd Zd Zd Zd Zy)CompletionChunk.Kindc                     || _         y r   r6  r   r   s     r   r   zCompletionChunk.Kind.__init__
  	    DIr   c                     | j                   S r   r6  r   s    r   r   zCompletionChunk.Kind.__str__
      99r   c                     d| z  S )Nz<ChunkKind: %s>r:   r   s    r   r   zCompletionChunk.Kind.__repr__
  s    $t++r   Nr&   r.   r/   r   r   r   r:   r   r   Kindr  
  s    			,r   r  c                 .    || _         || _        d| _        y N)csr   !_CompletionChunk__kindNumberCache)r   completionStringr   s      r   r   zCompletionChunk.__init__
  s    "!#r   c                 X    d| j                   z   dz   t        | j                        z   dz   S )Nz{'z', r  )rV   r   r=  r   s    r   r   zCompletionChunk.__repr__
  s(    dmm#e+c$))n<sBBr   c                     | j                   t        v rt        | j                      S t        j                  j	                  | j
                  | j                        S r   )_CompletionChunk__kindNumberSpellingCacherY   rZ   clang_getCompletionChunkTextr  r   r   s    r   rV   zCompletionChunk.spelling
  s@    - !2!233xx44TWWdhhGGr   c                     | j                   dk(  r9t        j                  j                  | j                  | j
                        | _         | j                   S r  )r  rY   rZ   clang_getCompletionChunkKindr  r   r   s    r   __kindNumberzCompletionChunk.__kindNumber
  sB    !!R'%)XX%J%J&D" %%%r   c                 (    t         | j                     S r   )completionChunkKindMapr  r   s    r   r=  zCompletionChunk.kind
  s    %d&7&788r   c                     t         j                  j                  | j                  | j                        }|rt        |      S y r   )rY   rZ   (clang_getCompletionChunkCompletionStringr  r   CompletionStringr   r`   s     r   stringzCompletionChunk.string
  s1    hh??R#C((r   c                      | j                   dk(  S r   r  r   s    r   isKindOptionalzCompletionChunk.isKindOptional
        A%%r   c                      | j                   dk(  S r  r  r   s    r   isKindTypedTextzCompletionChunk.isKindTypedText
  r  r   c                      | j                   dk(  S )Nr?   r  r   s    r   isKindPlaceHolderz!CompletionChunk.isKindPlaceHolder
  r  r   c                      | j                   dk(  S )Nr   r  r   s    r   isKindInformativez!CompletionChunk.isKindInformative
  r  r   c                      | j                   dk(  S )Nr{  r  r   s    r   isKindResultTypez CompletionChunk.isKindResultType
  s      B&&r   N)r&   r.   r/   r  r   r   rL   rV   r0   r  r=  r  r  r  r  r  r  r:   r   r   r  r  
  s    , ,$
C H H & & 9 9  &&&&'r   r  Optional	TypedTextTextPlaceholderInformativeCurrentParameter	LeftParen
RightParenLeftBracketRightBracket	LeftBrace
RightBrace	LeftAngle
RightAngleComma
ResultTypeColon	SemiColonEqualHorizontalSpaceVerticalSpace)r|  r}  r~  r  c                   r    e Zd Z G d d      Zd Zed        Zd Zed        Z	ed        Z
ed        Zd	 Zy
)r  c                       e Zd Zd Zd Zd Zy)CompletionString.Availabilityc                     || _         y r   r6  r  s     r   r   z&CompletionString.Availability.__init__  r  r   c                     | j                   S r   r6  r   s    r   r   z%CompletionString.Availability.__str__  r  r   c                     d| z  S )Nz<Availability: %s>r:   r   s    r   r   z&CompletionString.Availability.__repr__  s    '$..r   Nr  r:   r   r   Availabilityr    s    			/r   r	  c                     | j                   S r   )
num_chunksr   s    r   r   zCompletionString.__len__       r   c                 T    t         j                  j                  | j                        S r   )rY   rZ   clang_getNumCompletionChunksr  r   s    r   r  zCompletionString.num_chunks#  s    xx44TXX>>r   c                 X    | j                   |k  rt        t        | j                  |      S r   )r  r   r  r  r   s     r   r   zCompletionString.__getitem__'  s%    ??c!txx--r   c                 T    t         j                  j                  | j                        S r   )rY   rZ   clang_getCompletionPriorityr  r   s    r   priorityzCompletionString.priority,  s    xx33DHH==r   c                 f    t         j                  j                  | j                        }t        |   S r   )rY   rZ   clang_getCompletionAvailabilityr  availabilityKindsr  s     r   r  zCompletionString.availability0  s%    hh66txx@ %%r   c                     t         j                  d      r)t         j                  j                  | j                        S t               S )Nclang_getCompletionBriefComment)rY   function_existsrZ   r  r  rU   r   s    r   briefCommentzCompletionString.briefComment5  s2     AB88;;DHHEE{r   c                     dj                  | D cg c]  }t        |       c}      dz   t        | j                        z   dz   t        | j                        z   dz   t        | j                        z   S c c}w )Nz | z || Priority: z || Availability: z || Brief comment: )joinr   r  r  r  )r   as     r   r   zCompletionString.__repr__;  s|    JJ-1A-.$-- ! ## $##$	%
 $$ $##$%	
-s   A4N)r&   r.   r/   r	  r   rL   r  r   r0   r  r  r  r   r:   r   r   r  r    sk    / / ? ?.
 > > & &  
	
r   r  	Available
DeprecatedNotAvailableNotAccessible)r   r=   r>   r?   c                   B    e Zd ZdefdefgZd Zed        Zed        Z	y)CodeCompletionResult
cursorKindr  c                 >    t        t        | j                              S r   )r   r  r  r   s    r   r   zCodeCompletionResult.__repr__R  s    #D$9$9:;;r   c                 @    t         j                  | j                        S r   )rP  rL  r#  r   s    r   r=  zCodeCompletionResult.kindU  s    !!$//22r   c                 ,    t        | j                        S r   )r  r  r   s    r   r  zCodeCompletionResult.stringY  s     5 566r   N)
r&   r.   r/   rd   rl   re   r   r0   r=  r  r:   r   r   r"  r"  O  sD    u%(:J'GHH< 3 3 7 7r   r"  c                   4    e Zd Zd ee      fdefgZd Zd Zy)CCRStructureresults
numResultsc                     | j                   S r   )r*  r   s    r   r   zCCRStructure.__len__a  r  r   c                 H    t        |       |k  rt        | j                  |   S r   )r   r   r)  r   s     r   r   zCCRStructure.__getitem__d  s#    t9||C  r   N)	r&   r.   r/   r$  r"  rd   re   r   r   r:   r   r   r(  r(  ^  s&    G$89:\5<QRH!r   r(  c                   >    e Zd Zd Zd Zd Zed        Zed        Zy)CodeCompletionResultsc                 Z    t        |t        t                    r|sJ |x| _        | _        y r   )r   r$  r(  r   r  r   s     r   r   zCodeCompletionResults.__init__l  s(    #w|45#==),,4&r   c                     | j                   S r   r  r   s    r   r)   z CodeCompletionResults.from_paramp  r  r   c                 B    t         j                  j                  |        y r   )rY   rZ    clang_disposeCodeCompleteResultsr   s    r   r\   zCodeCompletionResults.__del__s  s    11$7r   c                 .    | j                   j                  S r   )r   r(  r   s    r   r)  zCodeCompletionResults.resultsv  s    xx   r   c                 &     G d d      } ||       S )Nc                       e Zd Zd Zd Zd Zy)9CodeCompletionResults.diagnostics.<locals>.DiagnosticsItrc                     || _         y r   )ccr)r   r8  s     r   r   zBCodeCompletionResults.diagnostics.<locals>.DiagnosticsItr.__init__}  s	    r   c                 f    t        t        j                  j                  | j                              S r   )rB   rY   rZ   #clang_codeCompleteGetNumDiagnosticsr8  r   s    r   r   zACodeCompletionResults.diagnostics.<locals>.DiagnosticsItr.__len__  s     488GGQRRr   c                 V    t         j                  j                  | j                  |      S r   )rY   rZ   clang_codeCompleteGetDiagnosticr8  r   s     r   r   zECodeCompletionResults.diagnostics.<locals>.DiagnosticsItr.__getitem__  s    xx??#NNr   Nr   r:   r   r   DiagnosticsItrr6  |  s    SOr   r=  r:   )r   r=  s     r   diagnosticsz!CodeCompletionResults.diagnosticsz  s    	O 	O d##r   N)	r&   r.   r/   r   r)   r\   r0   r)  r>  r:   r   r   r.  r.  k  s9    -#8 ! ! $ $r   r.  c                   6    e Zd ZdZedd       Zd Zd ZddZy)	Indexz
    The Index type provides the primary interface to the Clang CIndex library,
    primarily by providing an interface for reading and parsing translation
    units.
    c                 T    t        t        j                  j                  | d            S )z
        Create a new Index.
        Parameters:
        excludeDecls -- Exclude local declarations from translation units.
        r   )r@  rY   rZ   clang_createIndex)excludeDeclss    r   createzIndex.create  s      TXX//a@AAr   c                 B    t         j                  j                  |        y r   )rY   rZ   clang_disposeIndexr   s    r   r\   zIndex.__del__  s    ##D)r   c                 .    t         j                  ||       S )z/Load a TranslationUnit from the given AST file.)r  from_ast_file)r   paths     r   readz
Index.read  s    ,,T488r   Nc                 4    t         j                  |||||       S )as  Load the translation unit from the given source code file by running
        clang and generating the AST before loading. Additional command line
        parameters can be passed to clang via the args parameter.

        In-memory contents for files can be provided by passing a list of pairs
        to as unsaved_files, the first item should be the filenames to be mapped
        and the second should be the contents to be substituted for the
        file. The contents may be passed as strings or file objects.

        If an error was encountered during parsing, a TranslationUnitLoadError
        will be raised.
        )r  from_source)r   rI  r,   unsaved_filesr  s        r   parsezIndex.parse  s     **4}gtTTr   )F)NNr   )	r&   r.   r/   r9   r2   rD  r\   rJ  rN  r:   r   r   r@  r@    s-     B B*9Ur   r@  c                       e Zd ZdZdZdZdZdZdZdZ	dZ
e	 dd
       Zedd       Zd Zd Zed        Zed        Zd Zd Zd Zd Zed        ZddZd Z	 	 	 	 ddZddZy	)r  zRepresents a source code translation unit.

    This is one of the main types in the API. Any time you wish to interact
    with Clang's representation of a source file, you typically start with a
    translation unit.
    r   r=   r>   r   r   @   r  Nc           
         |g }|g }|t         j                         }d}t        |      dkD  r+t        t        |      z  |D cg c]  }t	        |       c} }d}t        |      dkD  rt        t        |      z         }t        |      D ]r  \  }	\  }
}t        |d      r|j                         }t	        |      }t	        t        j                  |
            ||	   _        |||	   _        t        |      ||	   _        t t        j                  j!                  ||t        j                  |      nd|t        |      |t        |      |      }|st#        d       | ||      S c c}w )a  Create a TranslationUnit by parsing source.

        This is capable of processing source code both from files on the
        filesystem as well as in-memory contents.

        Command-line arguments that would be passed to clang are specified as
        a list via args. These can be used to specify include paths, warnings,
        etc. e.g. ["-Wall", "-I/path/to/include"].

        In-memory file content can be provided via unsaved_files. This is an
        iterable of 2-tuples. The first element is the filename (str or
        PathLike). The second element defines the content. Content can be
        provided as str source code or as file objects (anything with a read()
        method). If a file object is being used, content will be read until EOF
        and the read cursor will not be reset to its original position.

        options is a bitwise or of TranslationUnit.PARSE_XXX flags which will
        control parsing behavior.

        index is an Index instance to utilize. If not provided, a new Index
        will be created for this TranslationUnit.

        To parse source from the filesystem, the filename of the file to parse
        is specified by the filename argument. Or, filename could be None and
        the args list would contain the filename(s) to parse.

        To parse source from an in-memory buffer, set filename to the virtual
        filename you wish to associate with this source (e.g. "test.c"). The
        contents of that file are then provided in unsaved_files.

        If an error occurs, a TranslationUnitLoadError is raised.

        Please note that a TranslationUnit with parser errors may be returned.
        It is the caller's responsibility to check tu.diagnostics for errors.

        Also note that Clang infers the source language from the extension of
        the input filename. If you pass in source code containing a C++ class
        declaration with the filename "test.c" parsing will fail.
        Nr   rJ  zError parsing translation unit.)index)r@  rD  r   r   r6   r  	enumeraterm  rJ  osfspathr   r(  rG  rY   rZ   clang_parseTranslationUnitr8   )r'   r   r,   rM  r  rR  
args_arrayr+   unsaved_arrayr/  r   r(  r   s                r   rL  zTranslationUnit.from_source  s\   V <D M=LLNE
t9q="SY.1E1!A$1EFJ}!+c-.@@CM'0'? 8##D(8V,'}}HX;()"))D/(:a %,4a )*-h-a '8 hh11#+#7BIIhTI
 *+LMM3e$$5 2Fs   E%c                     |t         j                         }t        j                  j	                  |t        j                  |            }|st        |       | ||      S )a  Create a TranslationUnit instance from a saved AST file.

        A previously-saved AST file (provided with -emit-ast or
        TranslationUnit.save()) is loaded from the filename specified.

        If the file cannot be loaded, a TranslationUnitLoadError will be
        raised.

        index is optional and is the Index instance to use. If not provided,
        a default Index will be created.

        filename can be str or PathLike.
        )r   rR  )r@  rD  rY   rZ   clang_createTranslationUnitrT  rU  r8   )r'   r   rR  r   s       r   rH  zTranslationUnit.from_ast_file)  sN     =LLNEhh225"))H:MN*844s%((r   c                 b    t        |t              sJ || _        t        j	                  | |       y)zCreate a TranslationUnit instance.

        TranslationUnits should be created using one of the from_* @classmethod
        functions above. __init__ is only called internally.
        N)r   r@  rR  r  r   )r   r   rR  s      r   r   zTranslationUnit.__init__A  s+     %'''
T3'r   c                 B    t         j                  j                  |        y r   )rY   rZ   clang_disposeTranslationUnitr   s    r   r\   zTranslationUnit.__del__K  s    --d3r   c                 @    t         j                  j                  |       S )z?Retrieve the cursor that represents the given translation unit.)rY   rZ   clang_getTranslationUnitCursorr   s    r   r  zTranslationUnit.cursorN  r  r   c                 @    t         j                  j                  |       S )z3Get the original translation unit source file name.)rY   rZ    clang_getTranslationUnitSpellingr   s    r   rV   zTranslationUnit.spellingS  r  r   c                 |    d }g }t         j                  j                  | t        d   |      |       t	        |      S )aM  
        Return an iterable sequence of FileInclusion objects that describe the
        sequence of inclusions in a translation unit. The first object in
        this sequence is always the input file. Note that this method will not
        recursively iterate over header files included through precompiled
        headers.
        c                     |dkD  r=|j                   }|j                  t        |j                  t	        |       ||             y y r   )r(  r  FileInclusionry   rp   )fobjlptrdepthincludeslocs        r   r  z-TranslationUnit.get_includes.<locals>.visitora  s6    qymmchhT
C OP r   translation_unit_includes)rY   rZ   clang_getInclusionsr  r  )r   r  rh  s      r   get_includeszTranslationUnit.get_includesX  s?    	Q $$)78A8	
 H~r   c                 .    t         j                  | |      S )z)Obtain a File from this translation unit.)rp   	from_namer   s     r   get_filezTranslationUnit.get_filen  s     ~~dH--r   c                     | j                  |      }t        |t              rt        j	                  | ||      S t        j                  | ||d   |d         S )a  Obtain a SourceLocation for a file in this translation unit.

        The position can be specified by passing:

          - Integer file offset. Initial file offset is 0.
          - 2-tuple of (line number, column number). Initial file position is
            (0, 0)
        r   r=   )ro  r   rB   rg   r   r|   )r   r   positionrq   s       r   get_locationzTranslationUnit.get_locations  sP     MM(#h$!--dAx@@++D!Xa[(1+NNr   c                    | j                  |      }t        |      dk  rt        d      |\  }}t        |d      rt        j                  | ||d   |d         }n't        |t              rt        j                  | ||      }t        |d      rt        j                  | ||d   |d         }n't        |t              rt        j                  | ||      }t        |t              sJ t        |t              sJ t        j                  ||      S )a  Obtain a SourceRange from this translation unit.

        The bounds of the SourceRange must ultimately be defined by a start and
        end SourceLocation. For the locations argument, you can pass:

          - 2 SourceLocation instances in a 2-tuple or list.
          - 2 int file offsets via a 2-tuple or list.
          - 2 2-tuple or lists of (line, column) pairs in a 2-tuple or list.

        e.g.

        get_extent('foo.c', (5, 10))
        get_extent('foo.c', ((1, 1), (1, 15)))
        r>   z)Must pass object with at least 2 elementsr   r   r=   )ro  r   rC   rm  rg   r|   r   rB   r   r   r   )r   r   	locationsrq   start_locationend_locations         r   
get_extentzTranslationUnit.get_extent  s     MM(#y>AGHH'0$>9-+99a*N1,=N ,+77aPN<+)77aa,q/L c*)55dA|LL..999,777)).,GGr   c                 &     G d d      } ||       S )zW
        Return an iterable (and indexable) object containing the diagnostics.
        c                       e Zd Zd Zd Zd Zy)1TranslationUnit.diagnostics.<locals>.DiagIteratorc                     || _         y r   )rx   )r   rx   s     r   r   z:TranslationUnit.diagnostics.<locals>.DiagIterator.__init__  s	    r   c                 f    t        t        j                  j                  | j                              S r   )rB   rY   rZ   clang_getNumDiagnosticsrx   r   s    r   r   z9TranslationUnit.diagnostics.<locals>.DiagIterator.__len__  s     488;;DGGDEEr   c                 |    t         j                  j                  | j                  |      }|st        t        |      S r   )rY   rZ   clang_getDiagnosticrx   r   r   r   s      r   r   z=TranslationUnit.diagnostics.<locals>.DiagIterator.__getitem__  s0    xx33DGGSA$$!$''r   Nr   r:   r   r   DiagIteratorrz    s    F(r   r  r:   )r   r  s     r   r>  zTranslationUnit.diagnostics  s    	( 	( D!!r   c                    |g }d}t        |      rt        t        |      z         }t        |      D ]r  \  }\  }}t        |d      r|j	                         }t        |      }t        t        j                  |            ||   _        |||   _	        t        |      ||   _
        t t        j                  j                  | t        |      ||      }y)aj  
        Reparse an already parsed translation unit.

        In-memory contents for files can be provided by passing a list of pairs
        as unsaved_files, the first items should be the filenames to be mapped
        and the second should be the contents to be substituted for the
        file. The contents may be passed as strings or file objects.
        Nr   rJ  )r   r  rS  rm  rJ  r6   rT  rU  r   r(  rG  rY   rZ   clang_reparseTranslationUnit)r   rM  r  unsaved_files_arrayr/  r   r(  r   s           r   reparsezTranslationUnit.reparse  s      M}#1C4F#F"I'0'? >##D(8V,'}}HX;./		$.@#A&+2:#A&/03H#A&-> hh33#m$&97
r   c                     t         j                  j                  |       }t        t         j                  j	                  | t        j                  |      |            }|dk7  rt        |d      y)a  Saves the TranslationUnit to a file.

        This is equivalent to passing -emit-ast to the clang frontend. The
        saved file can be loaded back into a TranslationUnit. Or, if it
        corresponds to a header, it can be used as a pre-compiled header file.

        If an error occurs while saving, a TranslationUnitSaveError is raised.
        If the error was TranslationUnitSaveError.ERROR_INVALID_TU, this means
        the constructed TranslationUnit was not valid at time of save. In this
        case, the reason(s) why should be available via
        TranslationUnit.diagnostics().

        filename -- The path to save the translation unit to (str or PathLike).
        r   zError saving TranslationUnit.N)rY   rZ   clang_defaultSaveOptionsrB   clang_saveTranslationUnitrT  rU  r<   )r   r   r  r:  s       r   savezTranslationUnit.save  sb     ((33D9HH..		(#
 Q;*63RSS r   c           
         d}|r|dz  }|r|dz  }|r|dz  }|g }d}	t        |      rt        t        |      z         }	t        |      D ]r  \  }
\  }}t        |d      r|j	                         }t        |      }t        t        j                  |            |	|
   _        ||	|
   _	        t        |      |	|
   _
        t t        j                  j                  | t        j                  |      |||	t        |      |      }|rt        |      S y)af  
        Code complete in this translation unit.

        In-memory contents for files can be provided by passing a list of pairs
        as unsaved_files, the first items should be the filenames to be mapped
        and the second should be the contents to be substituted for the
        file. The contents may be passed as strings or file objects.
        r   r=   r>   r   NrJ  )r   r  rS  rm  rJ  r6   rT  rU  r   r(  rG  rY   rZ   clang_codeCompleteAtr.  )r   rI  rz   r{   rM  include_macrosinclude_code_patternsinclude_brief_commentsr  r  r/  r   r(  r   s                 r   codeCompletezTranslationUnit.codeComplete  s   $ qLG qLG!qLG M}#1C4F#F"I'0'? >##D(8V,'}}HX;./		$.@#A&+2:#A&/03H#A&-> hh++IIdO
 (--r   c                 X    |t        |d   |d         }t        j                  | |      S )a7  Obtain tokens in this translation unit.

        This is a generator for Token instances. The caller specifies a range
        of source code to obtain tokens for. The range can be specified as a
        2-tuple of SourceLocation or as a SourceRange. If both are defined,
        behavior is undefined.
        r   r=   r   )r   r  r1  )r   rt  r*  s      r   r1  zTranslationUnit.get_tokens,  s1       y|1FF$$T622r   )NNr   Nr   r   )NFFFrc   )r&   r.   r/   r9   
PARSE_NONE PARSE_DETAILED_PROCESSING_RECORDPARSE_INCOMPLETEPARSE_PRECOMPILED_PREAMBLEPARSE_CACHE_COMPLETION_RESULTSPARSE_SKIP_FUNCTION_BODIES/PARSE_INCLUDE_BRIEF_COMMENTS_IN_CODE_COMPLETIONr1   rL  rH  r   r\   r0   r  rV   rl  ro  rr  rw  r>  r  r  r  r1  r:   r   r   r  r    s     J ()$  "# &'" "$ 7:3GKO% O%b ) ).(4 = = ? ?,.
O 'HR " "(
4T> #$5n3r   r  c                   \    e Zd ZdZed        Zed        Zed        Zd Z	d Z
ed        Zy)	rp   zd
    The File class represents a particular source file that is part of a
    translation unit.
    c                 z    t        t        j                  j                  | t	        j
                  |                  S )z9Retrieve a file handle within the given translation unit.)rp   rY   rZ   clang_getFilerT  rU  )r  	file_names     r   rn  zFile.from_name@  s/     HH""#3RYYy5IJ
 	
r   c                 @    t         j                  j                  |       S )z3Return the complete file and path name of the file.)rY   rZ   clang_getFileNamer   s    r   r   z	File.nameG       xx))$//r   c                 @    t         j                  j                  |       S )z.Return the last modification time of the file.)rY   rZ   clang_getFileTimer   s    r   timez	File.timeL  r  r   c                     | j                   S r   r6  r   s    r   r   zFile.__str__Q  r#  r   c                      d| j                   z  S )Nz
<File: %s>r6  r   s    r   r   zFile.__repr__T  s    tyy))r   c                 h    t        | t              sJ t        |       } |d   j                  | _        | S r   )r   rl   rp   r  r_   s      r   rb   zFile.from_resultW  s1    #z***3i q'++
r   N)r&   r.   r/   r9   r2   rn  r0   r   r  r   r   rb   r:   r   r   rp   rp   :  sa    
 
 
 0 0 0 0*  r   rp   c                   &    e Zd ZdZd Zed        Zy)rd  a  
    The FileInclusion class represents the inclusion of one source file by
    another via a '#include' directive or as the input file for the translation
    unit. This class provides information about the included file, the including
    file, the location of the '#include' directive and the depth of the included
    file in the stack. Note that the input file has depth 0.
    c                 <    || _         || _        || _        || _        y r   )sourceincluder   rg  )r   srctgtri  rg  s        r   r   zFileInclusion.__init__j  s    
r   c                      | j                   dk(  S )z,True if the included file is the input file.r   )rg  r   s    r   is_input_filezFileInclusion.is_input_filep  s     zzQr   N)r&   r.   r/   r9   r   r0   r  r:   r   r   rd  rd  a  s       r   rd  c                       e Zd ZdZdZdZd Zy)CompilationDatabaseErrorzRepresents an error that occurred when working with a CompilationDatabase

    Each error is associated to an enumerated value, accessible under
    e.cdb_error. Consumers can compare the value with one of the ERROR_
    constants in this class.
    r   r=   c                     t        |t              sJ |dkD  rt        d|z        || _        t        j	                  | d||fz         y )Nr=   zmEncountered undefined CompilationDatabase error constant: %d. Please file a bug to have this value supported.rA   )r   rB   rC   	cdb_errorr   rE   s      r   r   z!CompilationDatabaseError.__init__  sV    +s+++?#%01  %4;2H!HIr   N)r&   r.   r/   r9   rH   ERROR_CANNOTLOADDATABASEr   r:   r   r   r  r  v  s     M  !Jr   r  c                   F    e Zd ZdZd Zed        Zed        Zed        Zy)CompileCommandz3Represents the compile command used to build a filec                      || _         || _        y r   )cmdccmds)r   r  r  s      r   r   zCompileCommand.__init__  s     
r   c                 T    t         j                  j                  | j                        S )z1Get the working directory for this CompileCommand)rY   rZ   !clang_CompileCommand_getDirectoryr  r   s    r   	directoryzCompileCommand.directory  s     xx99$((CCr   c                 T    t         j                  j                  | j                        S )z0Get the working filename for this CompileCommand)rY   rZ    clang_CompileCommand_getFilenamer  r   s    r   r   zCompileCommand.filename  s     xx88BBr   c              #      K   t         j                  j                  | j                        }t	        |      D ].  }t         j                  j                  | j                  |       0 yw)z
        Get an iterable object providing each argument in the
        command line for the compiler invocation as a _CXString.

        Invariant : the first argument is the compiler executable
        N)rY   rZ   clang_CompileCommand_getNumArgsr  r   clang_CompileCommand_getArg)r   rG  r/  s      r   	argumentszCompileCommand.arguments  sP      99$((Cv 	DA((66txxCC	Ds   A'A)N)	r&   r.   r/   r9   r   r0   r  r   r  r:   r   r   r  r    sL    = D D C C 	D 	Dr   r  c                   8    e Zd ZdZd Zd Zd Zd Zed        Z	y)CompileCommandsz
    CompileCommands is an iterable object containing all CompileCommand
    that can be used for building a specific file.
    c                     || _         y r   )r  )r   r  s     r   r   zCompileCommands.__init__  s	    
r   c                 V    t         j                  j                  | j                         y r   )rY   rZ   clang_CompileCommands_disposer  r   s    r   r\   zCompileCommands.__del__  s    ..tzz:r   c                 f    t        t        j                  j                  | j                              S r   )rB   rY   rZ   clang_CompileCommands_getSizer  r   s    r   r   zCompileCommands.__len__  s     48899$**EFFr   c                 ~    t         j                  j                  | j                  |      }|st        t        ||       S r   )rY   rZ    clang_CompileCommands_getCommandr  r   r  )r   r/  ccs      r   r   zCompileCommands.__getitem__  s2    XX66tzz1Eb$''r   c                     | sy t        |       S r   )r  r_   s      r   rb   zCompileCommands.from_result  s    s##r   N)
r&   r.   r/   r9   r   r\   r   r   r2   rb   r:   r   r   r  r    s0    
;G( $ $r   r  c                   B    e Zd ZdZd Zed        Zed        Zd Zd Z	y)CompilationDatabasez
    The CompilationDatabase is a wrapper class around
    clang::tooling::CompilationDatabase

    It enables querying how a specific source file can be built.
    c                 B    t         j                  j                  |        y r   )rY   rZ   !clang_CompilationDatabase_disposer   s    r   r\   zCompilationDatabase.__del__  s    2248r   c                 4    | st        dd      t        |       S )Nr   "CompilationDatabase loading failed)r  r  r_   s      r   rb   zCompilationDatabase.from_result  s    *1.RSS"3''r   c                     t               }	 t        j                  j                  t	        j
                  |       t        |            }|S # t        $ r$}t        t        |j                        d      d}~ww xY w)z@Builds a CompilationDatabase from the database found in buildDirr  N)
rm   rY   rZ   'clang_CompilationDatabase_fromDirectoryrT  rU  ro   r  rB   r   )buildDir	errorCodecdbes       r   fromDirectoryz!CompilationDatabase.fromDirectory  sl     H		((BB		(#U9%5C 
	 ( 	*IOO$&J 	s   <A
 
	A7A22A7c                 h    t         j                  j                  | t        j                  |            S )z
        Get an iterable object providing all the CompileCommands available to
        build filename. Returns None if filename is not found in the database.
        )rY   rZ   ,clang_CompilationDatabase_getCompileCommandsrT  rU  r   s     r   getCompileCommandsz&CompilationDatabase.getCompileCommands  s)    
 xxDD"))H%
 	
r   c                 @    t         j                  j                  |       S )zo
        Get an iterable object providing all the CompileCommands available from
        the database.
        )rY   rZ   /clang_CompilationDatabase_getAllCompileCommandsr   s    r   getAllCompileCommandsz)CompilationDatabase.getAllCompileCommands  s    
 xxGGMMr   N)
r&   r.   r/   r9   r\   r2   rb   r  r  r  r:   r   r   r  r    s?    9 ( (
  
Nr   r  c                   v    e Zd ZdZdedz  fdefgZed        Zed        Z	ed        Z
ed        Zed	        Zy
)r%  a7  Represents a single token from the preprocessor.

    Tokens are effectively segments of source code. Source code is first parsed
    into tokens before being converted into the AST and Cursors.

    Tokens are obtained from parsed TranslationUnit instances. You currently
    can't create tokens manually.
    ri   r   rh   c                 V    t         j                  j                  | j                  |       S )zhThe spelling of this token.

        This is the textual representation of the token in source.
        )rY   rZ   clang_getTokenSpellingr  r   s    r   rV   zToken.spelling
  s     xx..txx>>r   c                 f    t         j                  t        j                  j	                  |             S )z*Obtain the TokenKind of the current token.)r3  r;  rY   rZ   clang_getTokenKindr   s    r   r=  z
Token.kind  s$     ##DHH$?$?$EFFr   c                 V    t         j                  j                  | j                  |       S )z(The SourceLocation this Token occurs at.)rY   rZ   clang_getTokenLocationr  r   s    r   r   zToken.location  s     xx..txx>>r   c                 V    t         j                  j                  | j                  |       S )z$The SourceRange this Token occupies.)rY   rZ   clang_getTokenExtentr  r   s    r   r*  zToken.extent  s     xx,,TXXt<<r   c                     t               }| j                  |_        t        j                  j	                  | j                  t        |       dt        |             |S )z%The Cursor this Token corresponds to.r=   )r  r  rY   rZ   clang_annotateTokensro   )r   r  s     r   r  zToken.cursor!  s?     XX
%%dhhdQfNr   N)r&   r.   r/   r9   rm   r   re   r0   rV   r=  r   r*  r  r:   r   r   r%  r%    s     VaZ(:x*@AH? ? G G ? ? = =  r   r%  rj  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r<  r:  rB  rZ  r/  r2  r6  r9  rM  r+  r<  r?  rC  rG  rJ  rQ  rT  rW  rZ  r^  r  r  r2  r   rF  r[   r"  r]  r%  r   r   r  r  rK  r  r  r  r  ra  r   r  r  r  r  r  r  r^   r  r  ra  rq  r  r  ry  r  !clang_getCursorReferenceNameRanger  r  rn  r  rd  ru  r  r  r  r   r   r   r   r   r   r   r   r   r   r   rT  r  r  r  r  r  r  clang_getIBOutletCollectionTyperh  rk  rn   rw   r~   r  rI  r  r}  r   rX  clang_getNumOverloadedDeclsclang_getOverloadedDeclrz  r   r   r   r  "clang_getSpecializedCursorTemplateclang_getTemplateCursorKindr  r  r  r  r_  ra  clang_getTUResourceUsageNamer~  r  rt  r,  r  r  ra  rd  r(  rT  r[  "clang_isFileMultipleIncludeGuardedrn  rd  rw  rl  rW  rk  r^  rh  ro  clang_isVirtualBaserg  rV  r  r  r&  r  r  r  r  r  r  r  r  r  r  r  r  r
  r   r  r  r]  r_  r  r  r  r  r  c                       e Zd Zd Zd Zy)LibclangErrorc                     || _         y r   m)r   rG   s     r   r   zLibclangError.__init__M  s	    r   c                     | j                   S r   r  r   s    r   r   zLibclangError.__str__P  s    vvr   N)r&   r.   r/   r   r   r:   r   r   r  r  L  s    r   r  c                    	 t        | |d         }t	        |      dk\  r
|d   |_        t	        |      dk\  r
|d   |_        t	        |      dk(  r|d   |_        y y # t        $ r%}t        |      dz   }|rY d }~y t        |      d }~ww xY w)Nr   zW. Please ensure that your python bindings are compatible with your libclang.so version.r>   r=   r?   r   )getattrAttributeErrorr   r  r   argtypesrestypeerrcheck)rZ   itemignore_errorsfuncr  msgs         r   register_functionr  T  s    	!sDG$ 4yA~Q
4yA~Aw
4yA~Q   !F 8 8 	 C  !s   A 	B	$B9BB	c                 :      fd}t         D ]
  } ||        y)zRegister function prototypes with a libclang library instance.

    This must be called as part of library instantiation so Python knows how
    to call out to the shared library.
    c                     t        |       S r   )r  )r  r  rZ   s    r   r>  z$register_functions.<locals>.registers  s     dM::r   N)functionList)rZ   r  r>  rq   s   ``  r   register_functionsr  l  s     ;  r   c            
       :   e Zd Zej                  j                  dej                  j                  ej                  j                  ej                  j                  e
            d            ZdZdZdZed        Zed        Zed        Zed	        Zd
 Zd Zd Zy)ConfigLIBCLANG_LIBRARY_PATHnativeNTFc                 v    t         j                  rt        d      t        j                  |       t         _        y)z,Set the path in which to search for libclangzSlibrary path must be set before before using any other functionalities in libclang.N)r  loadedrC   rT  rU  library_path)rI  s    r   set_library_pathzConfig.set_library_path  s/     ==9 
 !iior   c                 v    t         j                  rt        d      t        j                  |       t         _        y)z"Set the exact location of libclangzSlibrary file must be set before before using any other functionalities in libclang.N)r  r  rC   rT  rU  library_file)r   s    r   set_library_filezConfig.set_library_file  s0     ==9 
 !ii1r   c                 P    t         j                  rt        d      | t         _        y)a  Perform compatibility check when loading libclang

        The python bindings are only tested and evaluated with the version of
        libclang they are provided with. To ensure correct behavior a (limited)
        compatibility check is performed when loading the bindings. This check
        will throw an exception, as soon as it fails.

        In case these bindings are used with an older version of libclang, parts
        that have been stable between releases may still work. Users of the
        python bindings can disable the compatibility check. This will cause
        the python bindings to load, even though they are written for a newer
        version of libclang. Failures now arise if unsupported or incompatible
        features are accessed. The user is required to test themselves if the
        features they are using are available and compatible between different
        libclang versions.
        zZcompatibility_check must be set before before using any other functionalities in libclang.N)r  r  rC   compatibility_check)check_statuss    r   set_compatibility_checkzConfig.set_compatibility_check  s'    $ ==? 
 &2"r   c                 r    | j                         }t        |t        j                          dt        _        |S )NT)get_cindex_libraryr  r  r  r  )r   rZ   s     r   rZ   z
Config.lib  s/    %%'3F$>$> >?
r   c                 D   t         j                  rt         j                  S dd l}|j                         }|dk(  rd}n
|dk(  rd}nd}t         j                  rIt
        j                  j                  t         j                  dz   |z         rt         j                  dz   |z   }|S )Nr   Darwinzlibclang.dylibWindowszlibclang.dllzlibclang.so/)r  r  platformsystemr  rT  rI  isfile)r   r  r   ry   s       r   get_filenamezConfig.get_filename  s    &&& 8#DY!D D277>>&2E2E2Kd2R#S&&,t3Dr   c                     	 t         j                  | j                               }|S # t        $ r}t	        |      dz   }t        |      d }~ww xY w)Nz[. To provide a path to libclang use Config.set_library_path() or Config.set_library_file().)cdllLoadLibraryr  OSErrorr   r  )r   libraryr  r   s       r   r  zConfig.get_cindex_library  s\    	%&&t'8'8':;G   	%A - - 
  $$	%s   #' 	AA		Ac                 P    	 t        | j                  |       y# t        $ r Y yw xY w)NFT)r  rZ   r  r  s     r   r  zConfig.function_exists  s.    	DHHd#   		s    	%%)r&   r.   r/   rT  environr9  rI  r  dirnamerealpath__file__r  r  r  r  r2   r  r  r  rL   rZ   r  r  r  r:   r   r   r  r  z  s    ::>>"9277<<XZX_X_XhXhiqXrHsu};~LLF. . 2 2 2 22  (r   r  c                  t    t         j                  j                  D ]  \  } }t        j	                  ||         y r   )r  enumerations
TokenKindsr3  r>  )r   r   s     r   register_enumerationsr,    s1    ))44 (e5$'(r   )r  r  r.  r  r  r  rP  r  r   rp   r   r@  r}  rg   r   r  r3  r%  r8   r  r  rA  (  r9   
__future__r   r   r   ctypesclang.enumerationsr  collections.abcrN  rT  r   r   r6   r$  r   rl   r  rC   r8   r<   rL   	StructurerU   rg   r   r   r   r  r3  r@  rP  UNEXPOSED_DECLSTRUCT_DECL
UNION_DECL
CLASS_DECLr  r  r  FUNCTION_DECLVAR_DECL	PARM_DECLOBJC_INTERFACE_DECLOBJC_CATEGORY_DECLOBJC_PROTOCOL_DECLOBJC_PROPERTY_DECLOBJC_IVAR_DECLOBJC_INSTANCE_METHOD_DECLOBJC_CLASS_METHOD_DECLOBJC_IMPLEMENTATION_DECLOBJC_CATEGORY_IMPL_DECLTYPEDEF_DECL
CXX_METHOD	NAMESPACELINKAGE_SPECCONSTRUCTOR
DESTRUCTORCONVERSION_FUNCTIONTEMPLATE_TYPE_PARAMETERTEMPLATE_NON_TYPE_PARAMETERTEMPLATE_TEMPLATE_PARAMETERFUNCTION_TEMPLATECLASS_TEMPLATE%CLASS_TEMPLATE_PARTIAL_SPECIALIZATIONNAMESPACE_ALIASUSING_DIRECTIVEUSING_DECLARATIONTYPE_ALIAS_DECLOBJC_SYNTHESIZE_DECLOBJC_DYNAMIC_DECLCXX_ACCESS_SPEC_DECLOBJC_SUPER_CLASS_REFOBJC_PROTOCOL_REFOBJC_CLASS_REFTYPE_REFCXX_BASE_SPECIFIERTEMPLATE_REFNAMESPACE_REF
MEMBER_REF	LABEL_REFOVERLOADED_DECL_REFVARIABLE_REFINVALID_FILENO_DECL_FOUNDNOT_IMPLEMENTEDINVALID_CODEUNEXPOSED_EXPRDECL_REF_EXPRMEMBER_REF_EXPR	CALL_EXPROBJC_MESSAGE_EXPR
BLOCK_EXPRINTEGER_LITERALFLOATING_LITERALIMAGINARY_LITERALSTRING_LITERALCHARACTER_LITERAL
PAREN_EXPRUNARY_OPERATORARRAY_SUBSCRIPT_EXPRBINARY_OPERATORCOMPOUND_ASSIGNMENT_OPERATORCONDITIONAL_OPERATORCSTYLE_CAST_EXPRCOMPOUND_LITERAL_EXPRINIT_LIST_EXPRADDR_LABEL_EXPRStmtExprGENERIC_SELECTION_EXPRGNU_NULL_EXPRCXX_STATIC_CAST_EXPRCXX_DYNAMIC_CAST_EXPRCXX_REINTERPRET_CAST_EXPRCXX_CONST_CAST_EXPRCXX_FUNCTIONAL_CAST_EXPRCXX_TYPEID_EXPRCXX_BOOL_LITERAL_EXPRCXX_NULL_PTR_LITERAL_EXPRCXX_THIS_EXPRCXX_THROW_EXPRCXX_NEW_EXPRCXX_DELETE_EXPRCXX_UNARY_EXPROBJC_STRING_LITERALOBJC_ENCODE_EXPROBJC_SELECTOR_EXPROBJC_PROTOCOL_EXPROBJC_BRIDGE_CAST_EXPRPACK_EXPANSION_EXPRSIZE_OF_PACK_EXPRLAMBDA_EXPROBJ_BOOL_LITERAL_EXPROBJ_SELF_EXPROMP_ARRAY_SECTION_EXPROBJC_AVAILABILITY_CHECK_EXPRFIXED_POINT_LITERALOMP_ARRAY_SHAPING_EXPROMP_ITERATOR_EXPRCXX_ADDRSPACE_CAST_EXPRCONCEPT_SPECIALIZATION_EXPRREQUIRES_EXPRUNEXPOSED_STMT
LABEL_STMTCOMPOUND_STMT	CASE_STMTDEFAULT_STMTIF_STMTSWITCH_STMT
WHILE_STMTDO_STMTFOR_STMT	GOTO_STMTINDIRECT_GOTO_STMTCONTINUE_STMT
BREAK_STMTRETURN_STMTASM_STMTOBJC_AT_TRY_STMTOBJC_AT_CATCH_STMTOBJC_AT_FINALLY_STMTOBJC_AT_THROW_STMTOBJC_AT_SYNCHRONIZED_STMTOBJC_AUTORELEASE_POOL_STMTOBJC_FOR_COLLECTION_STMTCXX_CATCH_STMTCXX_TRY_STMTCXX_FOR_RANGE_STMTSEH_TRY_STMTSEH_EXCEPT_STMTSEH_FINALLY_STMTMS_ASM_STMT	NULL_STMT	DECL_STMTOMP_PARALLEL_DIRECTIVEOMP_SIMD_DIRECTIVEOMP_FOR_DIRECTIVEOMP_SECTIONS_DIRECTIVEOMP_SECTION_DIRECTIVEOMP_SINGLE_DIRECTIVEOMP_PARALLEL_FOR_DIRECTIVEOMP_PARALLEL_SECTIONS_DIRECTIVEOMP_TASK_DIRECTIVEOMP_MASTER_DIRECTIVEOMP_CRITICAL_DIRECTIVEOMP_TASKYIELD_DIRECTIVEOMP_BARRIER_DIRECTIVEOMP_TASKWAIT_DIRECTIVEOMP_FLUSH_DIRECTIVESEH_LEAVE_STMTOMP_ORDERED_DIRECTIVEOMP_ATOMIC_DIRECTIVEOMP_FOR_SIMD_DIRECTIVEOMP_PARALLELFORSIMD_DIRECTIVEOMP_TARGET_DIRECTIVEOMP_TEAMS_DIRECTIVEOMP_TASKGROUP_DIRECTIVE OMP_CANCELLATION_POINT_DIRECTIVEOMP_CANCEL_DIRECTIVEOMP_TARGET_DATA_DIRECTIVEOMP_TASK_LOOP_DIRECTIVEOMP_TASK_LOOP_SIMD_DIRECTIVEOMP_DISTRIBUTE_DIRECTIVEOMP_TARGET_ENTER_DATA_DIRECTIVEOMP_TARGET_EXIT_DATA_DIRECTIVEOMP_TARGET_PARALLEL_DIRECTIVE OMP_TARGET_PARALLELFOR_DIRECTIVEOMP_TARGET_UPDATE_DIRECTIVE$OMP_DISTRIBUTE_PARALLELFOR_DIRECTIVE*OMP_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVEOMP_DISTRIBUTE_SIMD_DIRECTIVE&OMP_TARGET_PARALLEL_FOR_SIMD_DIRECTIVEOMP_TARGET_SIMD_DIRECTIVEOMP_TEAMS_DISTRIBUTE_DIRECTIVE#OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE0OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE+OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVEOMP_TARGET_TEAMS_DIRECTIVE%OMP_TARGET_TEAMS_DISTRIBUTE_DIRECTIVE2OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE7OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE*OMP_TARGET_TEAMS_DISTRIBUTE_SIMD_DIRECTIVEBUILTIN_BIT_CAST_EXPROMP_MASTER_TASK_LOOP_DIRECTIVE'OMP_PARALLEL_MASTER_TASK_LOOP_DIRECTIVE#OMP_MASTER_TASK_LOOP_SIMD_DIRECTIVE,OMP_PARALLEL_MASTER_TASK_LOOP_SIMD_DIRECTIVEOMP_PARALLEL_MASTER_DIRECTIVEOMP_DEPOBJ_DIRECTIVEOMP_SCAN_DIRECTIVEOMP_TILE_DIRECTIVEOMP_CANONICAL_LOOPOMP_INTEROP_DIRECTIVEOMP_DISPATCH_DIRECTIVEOMP_MASKED_DIRECTIVEOMP_UNROLL_DIRECTIVEOMP_META_DIRECTIVEOMP_GENERIC_LOOP_DIRECTIVE OMP_TEAMS_GENERIC_LOOP_DIRECTIVE'OMP_TARGET_TEAMS_GENERIC_LOOP_DIRECTIVE#OMP_PARALLEL_GENERIC_LOOP_DIRECTIVE*OMP_TARGET_PARALLEL_GENERIC_LOOP_DIRECTIVEOMP_PARALLEL_MASKED_DIRECTIVEOMP_MASKED_TASK_LOOP_DIRECTIVE#OMP_MASKED_TASK_LOOP_SIMD_DIRECTIVE'OMP_PARALLEL_MASKED_TASK_LOOP_DIRECTIVE,OMP_PARALLEL_MASKED_TASK_LOOP_SIMD_DIRECTIVETRANSLATION_UNITUNEXPOSED_ATTRIB_ACTION_ATTRIB_OUTLET_ATTRIB_OUTLET_COLLECTION_ATTRCXX_FINAL_ATTRCXX_OVERRIDE_ATTRANNOTATE_ATTRASM_LABEL_ATTRPACKED_ATTR	PURE_ATTR
CONST_ATTRNODUPLICATE_ATTRCUDACONSTANT_ATTRCUDADEVICE_ATTRCUDAGLOBAL_ATTRCUDAHOST_ATTRCUDASHARED_ATTRVISIBILITY_ATTRDLLEXPORT_ATTRDLLIMPORT_ATTRCONVERGENT_ATTRWARN_UNUSED_ATTRWARN_UNUSED_RESULT_ATTRALIGNED_ATTRPREPROCESSING_DIRECTIVEMACRO_DEFINITIONMACRO_INSTANTIATIONrg  MODULE_IMPORT_DECLTYPE_ALIAS_TEMPLATE_DECLSTATIC_ASSERTFRIEND_DECLCONCEPT_DECLOVERLOAD_CANDIDATEr  NULLTYPEDECLARATIONNULLPTRINTEGRALr  NONEDYNAMIC_NONEDYNAMICMS_ANYBASIC_NOEXCEPTCOMPUTED_NOEXCEPTUNEVALUATEDUNINSTANTIATEDUNPARSEDr  r  rL  EXTERNSTATICPRIVATEEXTERNOPENCLWORKGROUPLOCALAUTOREGISTERr  	AVAILABLE
DEPRECATEDNOT_AVAILABLENOT_ACCESSIBLEr  PUBLIC	PROTECTEDPRIVATEr  	UNEXPOSEDVOIDBOOLr  r  r  r  r  r  r  r  r  CHAR_SSCHARWCHARSHORTINTLONGLONGLONGINT128FLOATDOUBLE
LONGDOUBLEOVERLOAD	DEPENDENTOBJCID	OBJCCLASSOBJCSELFLOAT128HALFIBM128COMPLEXBLOCKPOINTERLVALUEREFERENCERVALUEREFERENCERECORDr  TYPEDEFOBJCINTERFACEOBJCOBJECTPOINTERFUNCTIONNOPROTOrQ  CONSTANTARRAYVECTORINCOMPLETEARRAYVARIABLEARRAYDEPENDENTSIZEDARRAYMEMBERPOINTER
ELABORATEDPIPEOCLIMAGE1DROOCLIMAGE1DARRAYROOCLIMAGE1DBUFFERROOCLIMAGE2DROOCLIMAGE2DARRAYROOCLIMAGE2DDEPTHROOCLIMAGE2DARRAYDEPTHROOCLIMAGE2DMSAAROOCLIMAGE2DARRAYMSAAROOCLIMAGE2DMSAADEPTHROOCLIMAGE2DARRAYMSAADEPTHROOCLIMAGE3DROOCLIMAGE1DWOOCLIMAGE1DARRAYWOOCLIMAGE1DBUFFERWOOCLIMAGE2DWOOCLIMAGE2DARRAYWOOCLIMAGE2DDEPTHWOOCLIMAGE2DARRAYDEPTHWOOCLIMAGE2DMSAAWOOCLIMAGE2DARRAYMSAAWOOCLIMAGE2DMSAADEPTHWOOCLIMAGE2DARRAYMSAADEPTHWOOCLIMAGE3DWOOCLIMAGE1DRWOCLIMAGE1DARRAYRWOCLIMAGE1DBUFFERRWOCLIMAGE2DRWOCLIMAGE2DARRAYRWOCLIMAGE2DDEPTHRWOCLIMAGE2DARRAYDEPTHRWOCLIMAGE2DMSAARWOCLIMAGE2DARRAYMSAARWOCLIMAGE2DMSAADEPTHRWOCLIMAGE2DARRAYMSAADEPTHRWOCLIMAGE3DRW
OCLSAMPLEROCLEVENTOCLQUEUEOCLRESERVEID	EXTVECTORATOMICr7  LVALUERVALUEr}  
NO_LINKAGEINTERNALUNIQUE_EXTERNALEXTERNALr  rA  r  r  r  r  r  r  r  r  r"  r(  r.  r@  r  rp   rd  r  r  r  r  r%  	CFUNCTYPErm   	py_objectrd   rb   bool
c_longlongr  r-   c_ulonglongrL  r  r  r  r  r  r,  rY   __all__r:   r   r   <module>r     s+  $J A @&    	 x  F X
	
		y 		Jy JH 2.	 .O
Y O
dBI) BIJI IXG G5 5p#' #'N.
 .
b3. 3.~ 'qM
  $A
  #1
  #1
  "!}
  #1
  !+1
  &a=
  !m
  ""~
  ",B
  !+2
  !+2
  !+2
  'rN
  (2"~
 $ %/rN
 ! '1n
 # &0^
 " %R.
  #2
  ""~
  %R.
  $B
  #2
  ",B
  &0^
 " *4B
 & *4B
 &  *"~
  'rN
  4>b>
 0 (^
  (^
   *"~
  (^
  #-R.
   *"~
  #-R.
  #-R.
 )"~
 &rN
  !n
  *2
  %R.
  &b>
  #2
  ""~
  ",B
  %R.
 
 %R.
 %b>
 '^
 $R.
  'sO
  &c?
  (_
  "#
   *#
  #3
  (_
  )o
   *#
  'sO
   *#
 
 #3
  'sO
  #-S/
  (_
  +5S/
 ' #-S/
  )o
  $.c?
   'sO
  (_
  !o
  %/sO
 ! &c?
  #-S/
  $.c?
   (2#
 $ ",C
  '1o
 # (_
  $.c?
   (2#
 $ &c?
  'sO
  %S/
  (_
  'sO
  ",C
  )o
  !+3
  !+3
  $.c?
   ",C
   *#
  $C
  $.c?
   &c?
  %/sO
 ! +5S/
 ' ",C
  %/sO
 !  *#
  &0_
 " *4C
 & &c?
  'sO
  #3
  &c?
  "#
  %S/
   _
  $C
  #3
   _
  !o
  "#
  !+3
  &c?
  #3
  $C
  !o
  )o
  !+3
  #-S/
  !+3
  (2#
 $ )33
 % '1o
 # 'sO
  %S/
  !+3
  %S/
  (_
  )o
  $C
  "#
  "#
  %/sO
 ! !+3
   *#
  %/sO
 ! $.c?
   #-S/
  )33
 % .8_
 * !+3
  #-S/
  %/sO
 ! &0_
 " $.c?
   %/sO
 ! ",C
  'sO
  $.c?
   #-S/
  %/sO
 ! ,6c?
 ( #-S/
  ",C
  &0_
 " /9o
 + #-S/
  (2#
 $ &0_
 " +5S/
 ' '1o
 # .8_
 * -7sO
 ) ,6c?
 ( /9o
 + *4C
 & 3=S/
 / 9C3
 5 ,6c?
 ( 5?sO
 1 (2#
 $ -7sO
 ) 2<C
 . ?Io
 ; :DC
 6 )33
 % 4>c?
 0 AK3
 = FPPS_
 B 9C3
 5 $.c?
   -7sO
 ) 6@_
 2 2<C
 . ;ES/
 7 ,6c?
 ( #-S/
  !+3
  !+3
  !+3
  $.c?
   %/sO
 ! #-S/
  #-S/
  !+3
  )33
 % /9o
 + 6@_
 2 2<C
 . 9C3
 5 ,6c?
 ( -7sO
 ) 2<C
 . 6@_
 2 ;ES/
 7 )o
  'sO
 &sO
 &sO
 '1#
 $&sO
 )#
 %c?
 &sO
 #C
 !#
 "3
 (o
 )#
 '_
 '_
 %c?
 '_
 '_
 &sO
 &sO
 '_
 (o
 %/_
 "$S/
  &0_
 "(o
 !+C
 !+C
  !+3
 &0o
 #%c?
 #C
 $S/
  !+3
 ?  13  03  #7#:   3A6   4Q 7  A A #=Q"?  *DQ*G  '%?%B  "$>q$A  !,Fq,I  )/I!/L  ,)CA)F  &,Fq,I  )&@&C  #
\	Y \	~&0 &0R $A  O "1o "1o )!_ $0O ! O $Q 

4 
4 .a0  .q1  !1!!4  "21"5  
3o 3  *!, (+ +A. )!, &q) 
, ,$ A; a[ 1+!1+1+1+"b\ B< 2,"""|RL 2,"2,rl B< RL b\ 2,b\ B< RL 2,C= C=   #C= #C= 3-C= !# %c] #C= !# !# 3-#C= !# '} !# sm   %c] &sm   %c] %c] "*3- $SM !)# !)# &.sm #    %c] &sm   %c] %c] "*3- $SM !)# !)# &.sm #    %c] &sm   %c] %c] "*3- $SM !)# !)# &.sm #  sm SM SM   c] 3-4 4 )+  *1-  *1-  // / "!n $Q "1~ )!n "1~ +o + qz!*H&9 H&d# #QY Q  


)2>' >'BJ'K( F# M*	
 M* ./ K( L) M* N+ [) \* [) \* W%  \*!" W%#$ 	[)W%./_-+ 2/
{ /
f K(L)N+O,	 79 7
!9 
!$K $<$UK $UNG3k G3T$; $N *Jy J8D D@$ $8-N+ -N`+I +b *3*gn-vy*	
% & &eVVYG	. %eVY?	. S	'%.&'&/BS
 ):,7S 	2	76?+''	S 	:	##	S& 	7	%&##	%S0 %zl31S2 (*f)=zJ3S4 %zlF;5S8 	&	V	7SD 	,		CSP 	+		OSZ 'f=[S^ 		*E5(E5Q]Sf ')>(F
SgSh +-B,CUKiSj 5%.*5kSl #U,<$=zJmSn 4fXtDoSp .x>qSr 16(DAsSt .x>uSv  &40wSx $/ySz #VHd3{S| !6(D1}S~ 0&4@S@ 0&4@ASB "F8T2CSD %vh5ESF  &40GSH !6(D1ISJ "F8T2KSL $/MSN -b&9OSP  /!2F;QSR (*?)@ASSX -YSZ E7#[S\ YK(]S^ _genfEF_S` $o%67aSb FF+T2cSd nn=tDeSf ;4d;gSh $t,iSj 
F3Y	@U@UVkSl $t/?/?@mSn !4&$0@0@AoSp D6:.qSr "F8U3sSt  &663L3LMuSv vtT-=-=>wSx !:,
;ySz '
E:{S| '
Iy?T?TU}S~ 0(E1BJOS@ $h%6>ASD 	'	5	CSN #XJ6OSR 		))	QS\ .96B]S^ #VHe4_S` !6(FF4F4FGaSb "F8Y	8M8MNcSd vh4eSf $fXvv7P7PQgSh .9iSj !6(FF4F4FGkSl )666*BKPmSn !6(D$2B2BCoSp %vh8Q8QRqSr )Y5J5JKsSt VHdD,<,<=uSv F8Y	0E0EFwSx  &9i6K6KLyS@ #VHf5ASB %vh	9;P;PQCSD Z0*=ESF #ZL&9GSH 'iAVAVWISL 	#	VW[12	KSV  *f!5zBWSX #ZL.AYSZ $j\6:[S\ $j\6:]S` 	$	WY'(	_Sj  *f!5{CkSl #ZL%8mSn #ZL)Y=R=RSoSp dVT4+;+;<qSr .xEsSt &x<uSv $fXtT5E5EFwSx (89:FySz 4&)Y-B-BC{S| 4&&)}S~ '$8H8HIS@ vh
D4D4DEASD 		)$?@)LCSL 	)JFOFOFO	
	KS^ ?D&&A>R_S` "OT6#BNSaSb D&)cSd dVV,eSf $hZ7gSh f5iSj $j\6:kSl dVZ0mSn #VHf5oSp  0&&:S:STqSr dVT4+;+;<sSt 7EuSv ;-8wSx [M>:ySz TFD$*:*:;{S| *F8VV=V=VW}S~ #VHf5S@ ou5{CASB E7F+CSD 7HESH 	!	% 	GSR &'8&&BTBTUSSV 	+		USb 	'	))	aSl  $1C1CDmSn *F8T4;K;KLoSp dVY	0E0EFqSr !6(Iy7L7LMsSt tfi1F1FGuSv &6*wSx :,-ySz "D640{S|  &40}S~ ZL$/S@ J<.ASB *OT+BDICSD $dVT2ESF d+GSH %ISJ zlD1KSL :,-MSN %tfd3OSP :,-QSR d3SST :,-USV VHd+WSX %tfd3YS\ 	%	 (E8UEJ[Sd $ouh%NPUVeSf !?4Df"MuUgSj 		+wwu~'>PiSp VY~%>	JFSqSr $fXu5sSt  &&!166;M;MNuSv ,fXu=wSz 	/	$$ySB ,ff-=tTEUEUVCSD -vv.>
KESF 5vv6FTGSH  &40ISJ $/KSL (&9i>S>STMSN &xI<Q<QROSP %vh
;QSR '(8$?SST tfj1USV d.>.>?WSX *D659YSZ ,dF^T4CSCST[S\ &67D]S^ dVZ0_S` %tff5aSb d.>.>?cSd i&?KVTeSlI  0d dN(
 x  r   