%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python3.8/__pycache__/
Upload File :
Create Path :
Current File : //usr/local/lib/python3.8/__pycache__/symtable.cpython-38.pyc

U

naU	@sJdZddlZddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlZdddddgZd	dZGd
ddZeZGdddZGd
ddeZGdddeZGdddZedkrFddlZddlZeejdZe Z!W5QRXee!ej"#ejdddZ$e$%D]$Z&e$'e&Z(e)e(e(*e(+q dS)z2Interface to the compiler's internal symbol tablesN)USE
DEF_GLOBALDEF_NONLOCAL	DEF_LOCAL	DEF_PARAM
DEF_IMPORT	DEF_BOUND	DEF_ANNOT	SCOPE_OFF
SCOPE_MASKFREELOCALGLOBAL_IMPLICITGLOBAL_EXPLICITCELLsymtableSymbolTableClassFunctionSymbolcCst|||}t||SN)	_symtabler_newSymbolTable)codefilenameZcompile_typetopr$/usr/local/lib/python3.8/symtable.pyrsc@s$eZdZddZddZddZdS)SymbolTableFactorycCst|_dSr)weakrefWeakValueDictionary_SymbolTableFactory__memoselfrrr__init__szSymbolTableFactory.__init__cCs6|jtjkrt||S|jtjkr,t||St||Sr)typer
TYPE_FUNCTIONr
TYPE_CLASSrr)r#tablerrrrnews


zSymbolTableFactory.newcCs8||f}|j|d}|dkr4|||}|j|<|Sr)r!getr))r#r(rkeyobjrrr__call__s
zSymbolTableFactory.__call__N)__name__
__module____qualname__r$r)r-rrrrrsrc@seZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZddZddZddZdS) rcCs||_||_i|_dSr)_table	_filename_symbols)r#Z	raw_tablerrrrr$'szSymbolTable.__init__cCsN|jtkrd}nd|jj}|jjdkr6d||jSd||jj|jSdS)Nz%s rz<{0}SymbolTable for module {1}>z<{0}SymbolTable for {1} in {2}>)	__class__rr.r1nameformatr2)r#kindrrr__repr__,s
zSymbolTable.__repr__cCsX|jjtjkrdS|jjtjkr$dS|jjtjkr6dS|jjdksTtd|jjdS)Nmodulefunctionclass)zunexpected type: {0})r1r%rZTYPE_MODULEr&r'AssertionErrorr7r"rrrget_type9szSymbolTable.get_typecCs|jjSr)r1idr"rrrget_idCszSymbolTable.get_idcCs|jjSr)r1r6r"rrrget_nameFszSymbolTable.get_namecCs|jjSr)r1linenor"rrr
get_linenoIszSymbolTable.get_linenocCst|jjtjkSr)boolr1r%rr&r"rrris_optimizedLszSymbolTable.is_optimizedcCst|jjSr)rGr1nestedr"rrr	is_nestedOszSymbolTable.is_nestedcCst|jjSr)rGr1childrenr"rrrhas_childrenRszSymbolTable.has_childrencCsdS)z7Return true if the scope uses exec.  Deprecated method.Frr"rrrhas_execUszSymbolTable.has_execcCs|jjSr)r1symbolskeysr"rrrget_identifiersYszSymbolTable.get_identifierscCsT|j|}|dkrP|jj|}||}|jjdk}t||||d}|j|<|S)Nrmodule_scope)r3r*r1rN_SymbolTable__check_childrenr6r)r#r6Zsymflags
namespacesrRrrrlookup\s
zSymbolTable.lookupcsfddDS)Ncsg|]}|qSr)rV.0identr"rr
<listcomp>gsz+SymbolTable.get_symbols.<locals>.<listcomp>)rPr"rr"rget_symbolsfszSymbolTable.get_symbolscsfddjjDS)Ncs"g|]}|jkrt|jqSr)r6rr2rXstr6r#rrrZjs
z0SymbolTable.__check_children.<locals>.<listcomp>r1rK)r#r6rr^rZ__check_childreniszSymbolTable.__check_childrencsfddjjDS)Ncsg|]}t|jqSr)rr2r\r"rrrZosz,SymbolTable.get_children.<locals>.<listcomp>r_r"rr"rget_childrenns
zSymbolTable.get_childrenN)r.r/r0r$r9rArCrDrFrHrJrLrMrPrVr[rSr`rrrrr%s


c@sPeZdZdZdZdZdZdZddZddZ	ddZ
dd	Zd
dZdd
Z
dS)rNcstfddDS)Nc3s"|]}jj|r|VqdSr)r1rNrWr#Z	test_funcrr	<genexpr>}sz-Function.__idents_matching.<locals>.<genexpr>)tuplerPrarrarZ__idents_matching|szFunction.__idents_matchingcCs |jdkr|dd|_|jS)NcSs|t@Sr)rxrrr<lambda>z)Function.get_parameters.<locals>.<lambda>)_Function__params_Function__idents_matchingr"rrrget_parameterss
zFunction.get_parameterscs0|jdkr*ttffdd}|||_|jS)Ncs|t?t@kSrr
rrdZlocsrrrfrgz%Function.get_locals.<locals>.<lambda>)_Function__localsr
rrir#testrrlr
get_localss

zFunction.get_localscs0|jdkr*ttffdd}|||_|jS)Ncs|t?t@kSrrkrdZglobrrrfrgz&Function.get_globals.<locals>.<lambda>)_Function__globalsrrrirnrrqrget_globalss

zFunction.get_globalscCs |jdkr|dd|_|jS)NcSs|t@Sr)rrdrrrrfrgz(Function.get_nonlocals.<locals>.<lambda>)_Function__nonlocalsrir"rrr
get_nonlocalss
zFunction.get_nonlocalscCs$|jdkrdd}|||_|jS)NcSs|t?t@tkSr)r
rrrdrrrrfrgz$Function.get_frees.<locals>.<lambda>)_Function__freesri)r#is_freerrr	get_freess
zFunction.get_frees)r.r/r0rhrmrvrrrtrirjrprsrurxrrrrrssc@seZdZdZddZdS)rNcCs6|jdkr0i}|jjD]}d||j<qt||_|jS)Nr=)_Class__methodsr1rKr6rc)r#dr]rrrget_methodss

zClass.get_methods)r.r/r0ryr{rrrrrsc@seZdZd$ddddZddZdd	Zd
dZdd
ZddZddZ	ddZ
ddZddZddZ
ddZddZddZd d!Zd"d#ZdS)%rNFrQcCs.||_||_|t?t@|_|p d|_||_dS)Nr)
_Symbol__name_Symbol__flagsr
r_Symbol__scope_Symbol__namespaces_Symbol__module_scope)r#r6rTrUrRrrrr$s

zSymbol.__init__cCsd|jS)Nz<symbol {0!r}>)r7r|r"rrrr9szSymbol.__repr__cCs|jSr)r|r"rrrrDszSymbol.get_namecCst|jtj@Sr)rGr}rrr"rrr
is_referencedszSymbol.is_referencedcCst|jt@Sr)rGr}rr"rrris_parameterszSymbol.is_parametercCs"t|jttfkp|jo|jt@S)z0Return *True* if the sysmbol is global.
        )rGr~rrrr}rr"rrr	is_globalszSymbol.is_globalcCst|jt@Sr)rGr}rr"rrris_nonlocalszSymbol.is_nonlocalcCst|jtkSr)rGr~rr"rrris_declared_globalszSymbol.is_declared_globalcCs"t|jttfkp|jo|jt@S)z.Return *True* if the symbol is local.
        )rGr~r
rrr}rr"rrris_localszSymbol.is_localcCst|jt@Sr)rGr}r	r"rrris_annotatedszSymbol.is_annotatedcCst|jtkSr)rGr~rr"rrrrwszSymbol.is_freecCst|jt@Sr)rGr}rr"rrris_importedszSymbol.is_importedcCst|jt@Sr)rGr}rr"rrris_assignedszSymbol.is_assignedcCs
t|jS)aReturns 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.
        )rGrr"rrris_namespaceszSymbol.is_namespacecCs|jS)z.Return a list of namespaces bound to this name)rr"rrrget_namespacesszSymbol.get_namespacescCs t|jdkrtd|jdS)zReturns the single namespace bound to this name.

        Raises ValueError if the name is bound to multiple namespaces.
        r=z$name is bound to multiple namespacesr)lenr
ValueErrorr"rrr
get_namespaceszSymbol.get_namespace)N)r.r/r0r$r9rDrrrrrrrrwrrrrrrrrrrs 
__main__r=exec),__doc__rrrrrrrrr	r
rrr
rrrr__all__rrrrrrrr.ossysopenargvfreadsrcpathsplitmodrPrYrVinfoprintrrrrrr<module>s&DN,
M



Zerion Mini Shell 1.0