Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 18.189.171.137
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : symtable.cpython-310.opt-1.pyc
o

^b�'�@sXdZddlZddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlZgd�Zdd�ZGdd�d�Ze�ZGd	d
�d
�ZGdd�de�ZGd
d�de�ZGdd�d�Zedkr�ddlZddlZeejd��Ze� �Z!Wd�n1s~wYee!ej"�#ejd�dd�Z$e$�%�D]Z&e$�'e&�Z(e)e(e(�*�e(�+��q�dSdS)z2Interface to the compiler's internal symbol tables�N)�USE�
DEF_GLOBAL�DEF_NONLOCAL�	DEF_LOCAL�	DEF_PARAM�
DEF_IMPORT�	DEF_BOUND�	DEF_ANNOT�	SCOPE_OFF�
SCOPE_MASK�FREE�LOCAL�GLOBAL_IMPLICIT�GLOBAL_EXPLICIT�CELL)�symtable�SymbolTable�Class�Function�SymbolcCst�|||�}t||�S)z� Return the toplevel *SymbolTable* for the source code.

    *filename* is the name of the file with the code
    and *compile_type* is the *compile()* mode argument.
    )�	_symtabler�_newSymbolTable)�code�filenameZcompile_type�top�r�1/usr/local/python-3.10/lib/python3.10/symtable.pyrs
rc@s$eZdZdd�Zdd�Zdd�ZdS)�SymbolTableFactorycCst��|_dS�N)�weakref�WeakValueDictionary�_SymbolTableFactory__memo��selfrrr�__init__szSymbolTableFactory.__init__cCs6|jtjkrt||�S|jtjkrt||�St||�Sr)�typer�
TYPE_FUNCTIONr�
TYPE_CLASSrr)r#�tablerrrr�news



zSymbolTableFactory.newcCs8||f}|j�|d�}|dur|�||�}|j|<|Sr)r!�getr))r#r(r�key�objrrr�__call__ s
zSymbolTableFactory.__call__N)�__name__�
__module__�__qualname__r$r)r-rrrrrsrc@s|eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)rcCs||_||_i|_dSr)�_table�	_filename�_symbols)r#Z	raw_tablerrrrr$,s
zSymbolTable.__init__cCsJ|jtkrd}nd|jj}|jjdkrd�||j�Sd�||jj|j�S)N�z%s rz<{0}SymbolTable for module {1}>z<{0}SymbolTable for {1} in {2}>)�	__class__rr.r1�name�formatr2)r#�kindrrr�__repr__1s
�zSymbolTable.__repr__cCs:|jjtjkr	dS|jjtjkrdS|jjtjkrdSdS)zwReturn the type of the symbol table.

        The values retuned are 'class', 'module' and
        'function'.
        �module�function�classN)r1r%rZTYPE_MODULEr&r'r"rrr�get_type>s�zSymbolTable.get_typecC�|jjS)z,Return an identifier for the table.
        )r1�idr"rrr�get_idMszSymbolTable.get_idcCr>)z�Return the table's name.

        This corresponds to the name of the class, function
        or 'top' if the table is for a class, function or
        global respectively.
        )r1r6r"rrr�get_nameRszSymbolTable.get_namecCr>)zPReturn the number of the first line in the
        block for the table.
        )r1�linenor"rrr�
get_lineno[szSymbolTable.get_linenocCst|jjtjk�S)zJReturn *True* if the locals in the table
        are optimizable.
        )�boolr1r%rr&r"rrr�is_optimizedaszSymbolTable.is_optimizedcC�t|jj�S)zAReturn *True* if the block is a nested class
        or function.)rDr1�nestedr"rrr�	is_nestedg�zSymbolTable.is_nestedcCrF)z:Return *True* if the block has nested namespaces.
        )rDr1�childrenr"rrr�has_childrenlrIzSymbolTable.has_childrencCs|jj��S)z8Return a list of names of symbols in the table.
        )r1�symbols�keysr"rrr�get_identifiersqrIzSymbolTable.get_identifierscCsT|j�|�}|dur(|jj|}|�|�}|jjdk}t||||d�}|j|<|S)zLLookup a *name* in the table.

        Returns a *Symbol* instance.
        Nr��module_scope)r3r*r1rL�_SymbolTable__check_childrenr6r)r#r6Zsym�flags�
namespacesrPrrr�lookupvs
�zSymbolTable.lookupcs�fdd����D�S)zLReturn a list of *Symbol* instances for
        names in the table.
        csg|]}��|��qSr)rT��.0�identr"rr�
<listcomp>�sz+SymbolTable.get_symbols.<locals>.<listcomp>)rNr"rr"r�get_symbols�szSymbolTable.get_symbolscs��fdd��jjD�S)Ncs"g|]
}|j�krt|�j��qSr)r6rr2�rV�st�r6r#rrrX�s�z0SymbolTable.__check_children.<locals>.<listcomp>�r1rJ)r#r6rr\rZ__check_children�s�zSymbolTable.__check_childrencs�fdd��jjD�S)z3Return a list of the nested symbol tables.
        csg|]}t|�j��qSr)rr2rZr"rrrX�s�z,SymbolTable.get_children.<locals>.<listcomp>r]r"rr"r�get_children�s
�zSymbolTable.get_childrenN)r.r/r0r$r9r=r@rArCrErHrKrNrTrYrQr^rrrrr*s
	rc@sPeZdZdZdZdZdZdZdd�Zdd�Z	dd�Z
dd	�Zd
d�Zdd
�Z
dS)rNcst��fdd����D��S)Nc3s$�|]
}��jj|�r|VqdSr)r1rLrU�r#Z	test_funcrr�	<genexpr>�s��z-Function.__idents_matching.<locals>.<genexpr>)�tuplerNr_rr_rZ__idents_matching�szFunction.__idents_matchingcC� |jdur
|�dd��|_|jS)z6Return a tuple of parameters to the function.
        NcS�|t@Sr)r��xrrr�<lambda>��z)Function.get_parameters.<locals>.<lambda>)�_Function__params�_Function__idents_matchingr"rrr�get_parameters��
zFunction.get_parametersc�0|jdurttf��fdd�}|�|�|_|jS)z2Return a tuple of locals in the function.
        Nc�|t?t@�vSr�r
rrd�Zlocsrrrf��z%Function.get_locals.<locals>.<lambda>)�_Function__localsr
rri�r#�testrror�
get_locals��

zFunction.get_localscrl)z3Return a tuple of globals in the function.
        Ncrmrrnrd��globrrrf�rpz&Function.get_globals.<locals>.<lambda>)�_Function__globalsrrrirrrrvr�get_globals�ruzFunction.get_globalscCrb)z5Return a tuple of nonlocals in the function.
        NcSrcr)rrdrrrrf�rgz(Function.get_nonlocals.<locals>.<lambda>)�_Function__nonlocalsrir"rrr�
get_nonlocals�rkzFunction.get_nonlocalscCs$|jdurdd�}|�|�|_|jS)z:Return a tuple of free variables in the function.
        NcSs|t?t@tkSr)r
rrrdrrrrf�rpz$Function.get_frees.<locals>.<lambda>)�_Function__freesri)r#�is_freerrr�	get_frees�s
zFunction.get_frees)r.r/r0rhrqr|rxrzrirjrtryr{r~rrrrr�s		rc@seZdZdZdd�ZdS)rNcCs6|jduri}|jjD]}d||j<qt|�|_|jS)z9Return a tuple of methods declared in the class.
        N�)�_Class__methodsr1rJr6ra)r#�dr[rrr�get_methods�s

zClass.get_methods)r.r/r0r�r�rrrrr�src@s�eZdZd$dd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�ZdS)%rNFrOcCs.||_||_|t?t@|_|pd|_||_dS)Nr)�
_Symbol__name�_Symbol__flagsr
r�_Symbol__scope�_Symbol__namespaces�_Symbol__module_scope)r#r6rRrSrPrrrr$�s


zSymbol.__init__cCsd�|j�S)Nz<symbol {0!r}>)r7r�r"rrrr9�szSymbol.__repr__cC�|jS)z#Return a name of a symbol.
        )r�r"rrrrA�szSymbol.get_namecCst|jtj@�S)zBReturn *True* if the symbol is used in
        its block.
        )rDr�rrr"rrr�
is_referenced�szSymbol.is_referencedcC�t|jt@�S)z4Return *True* if the symbol is a parameter.
        )rDr�rr"rrr�is_parameter��zSymbol.is_parametercC�"t|jttfvp|jo|jt@�S)z0Return *True* if the sysmbol is global.
        )rDr�rrr�r�rr"rrr�	is_global���zSymbol.is_globalcCr�)z(Return *True* if the symbol is nonlocal.)rDr�rr"rrr�is_nonlocal��zSymbol.is_nonlocalcC�t|jtk�S)zOReturn *True* if the symbol is declared global
        with a global statement.)rDr�rr"rrr�is_declared_globalr�zSymbol.is_declared_globalcCr�)z.Return *True* if the symbol is local.
        )rDr�r
rr�r�rr"rrr�is_localr�zSymbol.is_localcCr�)z2Return *True* if the symbol is annotated.
        )rDr�r	r"rrr�is_annotatedr�zSymbol.is_annotatedcCr�)zIReturn *True* if a referenced symbol is
        not assigned to.
        )rDr�rr"rrrr}�zSymbol.is_freecCr�)zQReturn *True* if the symbol is created from
        an import statement.
        )rDr�rr"rrr�is_importedr�zSymbol.is_importedcCr�)z)Return *True* if a symbol is assigned to.)rDr�rr"rrr�is_assignedr�zSymbol.is_assignedcCs
t|j�S)a�Returns *True* if name binding introduces new namespace.

        If the name is used as the target of a function or class
        statement, this will be true.

        Note that a single name can be bound to multiple objects.  If
        is_namespace() is true, the name may also be bound to other
        objects, like an int or list, that does not introduce a new
        namespace.
        )rDr�r"rrr�is_namespace!s
zSymbol.is_namespacecCr�)z.Return a list of namespaces bound to this name)r�r"rrr�get_namespaces.szSymbol.get_namespacescCs t|j�dkrtd��|jdS)z�Return the single namespace bound to this name.

        Raises ValueError if the name is bound to multiple namespaces.
        rz$name is bound to multiple namespacesr)�lenr��
ValueErrorr"rrr�
get_namespace2s
zSymbol.get_namespacer)r.r/r0r$r9rAr�r�r�r�r�r�r�r}r�r�r�r�r�rrrrr�s"
r�__main__r�exec),�__doc__rrrrrrrrr	r
rrr
rrrr�__all__rrrrrrrr.�os�sys�open�argv�f�read�src�path�split�modrNrWrT�info�printr�r�rrrr�<module>s.D	l6`
�
�
© 2025 GrazzMean