e7SrSSKrSSKJrJrJrJrJrJrJrJ r J r J r J r J r JrJrJr SSKrSSKJr /SQrSr"SS5r\"5r"S S \5r"S S 5r"S S\5r"SS\5r"SS5rS\4/r\R=S\"5RA555 Sr!\!Vs0sHn\"5UU_M snr"Sr#\$S:XaSSK%r%\#"\%RLSS5 ggs snf)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_EXPLICITCELL)StrEnum)symtableSymbolTableType SymbolTableClassFunctionSymbolcF[R"XU5n[X15$)zReturn 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)codefilename compile_typetops ./opt/imh/python3.13/lib/python3.13/symtable.pyrr s!   T\ :C 3 ))c&\rSrSrSrSrSrSrg)SymbolTableFactoryc8[R"5UlgN)weakrefWeakValueDictionary_SymbolTableFactory__memoselfs r __init__SymbolTableFactory.__init__s113 r!cUR[R:Xa [X5$UR[R:Xa [ X5$[ X5$r&)typer TYPE_FUNCTIONr TYPE_CLASSrr)r+tablers r newSymbolTableFactory.newsG ::00 0E, , ::-- -) )5++r!cX4nURRUS5nUcURX5=o@RU'U$r&)r)getr3)r+r2rkeyobjs r __call__SymbolTableFactory.__call__!sAokkooc4( ;%)XXe%> >C++c" r!)__memoN)__name__ __module__ __qualname____firstlineno__r,r3r9__static_attributes__r!r r#r#s4,r!r#c0\rSrSrSrSrSrSrSrSr Sr S r g ) r+modulefunctionclass annotationz type aliasztype parametersz type variablerAN) r<r=r>r?MODULEFUNCTIONCLASS ANNOTATION TYPE_ALIASTYPE_PARAMETERS TYPE_VARIABLEr@rAr!r rr+s% FH EJJ'O#Mr!rch\rSrSrSrSrSrSrSrSr Sr S r S r S r S rS rSrSrSrg)r5c*XlX l0Ulgr&)_table _filename_symbols)r+ raw_tablers r r,SymbolTable.__init__7s ! r!c.UR[:XaSnOSURR-nURRS:XaSR XR 5$SR UURRUR 5$)Nz%s rz<{0}SymbolTable for module {1}>z<{0}SymbolTable for {1} in {2}>) __class__rr<rRnameformatrS)r+kinds r __repr__SymbolTable.__repr__<sy >>[ (D4>>222D ;;  u $4;;D..Q Q4;;D<@KKr?r,r]rerirlrprtrxr|rrrrrr@rAr!r rr5sK L=,  " A ( * * H $ 0r!rcL\rSrSrSrSrSrSrSrSr Sr Sr Sr Sr SrS rg) rNcN^^[UU4SjTR555$)Nc3t># UH-nT"TRRU5(dM)Uv M/ g7fr&)rRr).0rr+ test_funcs r -Function.__idents_matching..s1?(>u!$++"5"5e"<=U(>s(8 8)tupler)r+rs``r __idents_matchingFunction.__idents_matchings%?(<(<(>?? ?r!cbURcURS5UlUR$)z6Return a tuple of parameters to the function. cU[-$r&)rxs r )Function.get_parameters..sA Mr!)_Function__params_Function__idents_matchingr*s r get_parametersFunction.get_parameterss+ ==  223IJDM}}r!c^URc([[4mU4SjnURU5UlUR$)z2Return a tuple of locals in the function. c*>U[- [-T;$r&r r )rlocss r r%Function.get_locals..sqI~;Dr!)_Function__localsrrr)r+testrs @r get_localsFunction.get_localss9 == 4=DDD 2248DM}}r!c^URc([[4mU4SjnURU5UlUR$)z3Return a tuple of globals in the function. c*>U[- [-T;$r&r)rglobs r r&Function.get_globals..sa9n :tCr!)_Function__globalsrrr)r+rrs @r get_globalsFunction.get_globalss: >> !#_5DCD!33D9DN~~r!cbURcURS5UlUR$)z5Return a tuple of nonlocals in the function. cU[-$r&)rrs r r(Function.get_nonlocals..s q.si: =$Fr!)_Function__freesr)r+is_frees r get_freesFunction.get_freess/ << FG11':DL||r!)__frees __globals__locals __nonlocals__params)r<r=r>r?rrrrrrrrrrrr@rAr!r rrs;HHGIK? r!rc\rSrSrSrSrSrg)rNc~^TRGc#0nU4SjnTRRHnU"UR5(dMUR=[ R :Xa3 URS:XaSUR;aM^SXR'Mn[ R:XdMURnURHRnURU:XdMUR[ R :XdM5US:wdSUR;deSX' M M [U5TlTR$)z9Return a tuple of methods declared in the class. c~>TRRRUS5nU[- [-[ :H$)Nr)rRrr6r r r)rrr+s r is_local_symbol*Class.get_methods..is_local_symbols4 ++//q9)+z9eCCr!genexprz.0) _Class__methodsrRr{rZr/rr0varnamesrcr)r+drr scope_namecs` r get_methodsClass.get_methodss >> !A Dkk**"277++''4Y44 "ww)3 8K ()*AggJ&;;*,J%'[[#$66Z#7AFFiF]F]<],6+BdRSR\R\F\$\+\45AM$)&1+4#1XDN~~r!) __methods)r<r=r>r?rrr@rAr!r rrs I%r!rc\rSrSrSSS.SjjrSrSrSrS rS r S r S r S r Sr SrSrSrSrSrSrSrSrSrg)ri NFrcrXlX lU[- [-UlU=(d SUlX@lg)NrA) _Symbol__name_Symbol__flagsr r _Symbol__scope_Symbol__namespaces_Symbol__module_scope)r+rZrrrs r r,Symbol.__init__ s0  *j8 &,"*r!cSRUR55nSUR<SUR5SUS3$)N|z)join _flags_strr _scope_str)r+ flags_strs r r]Symbol.__repr__s>HHT__./ $++4??+<*=R {!LLr!cx[RUR5=(d [UR5$r&)_scopes_value_to_namer6rstrr*s r rSymbol._scope_strs%$((6K#dll:KKr!c#\# [HupURU-U:XdMUv M g7fr&)_flagsr)r+flagname flagvalues r rSymbol._flags_strs(#) H||i'94$*s, ,cUR$)z#Return a name of a symbol. )rr*s r rlSymbol.get_names{{r!cN[UR[R-5$)z2Return *True* if the symbol is used in its block. )rsrrrr*s r is_referencedSymbol.is_referenced$sDLL9==011r!c:[UR[-5$)z4Return *True* if the symbol is a parameter. )rsrrr*s r is_parameterSymbol.is_parameter*DLL9,--r!c[UR[[4;=(d& UR=(a UR [ -5$)z/Return *True* if the symbol is global. )rsrrrrrr r*s r is_globalSymbol.is_global/s@DLL_o$FFJ++H y0HK Kr!c:[UR[-5$)z(Return *True* if the symbol is nonlocal.)rsrrr*s r is_nonlocalSymbol.is_nonlocal5sDLL</00r!c:[UR[:H5$)zGReturn *True* if the symbol is declared global with a global statement.)rsrrr*s r is_declared_globalSymbol.is_declared_global9sDLLO344r!c[UR[[4;=(d& UR=(a UR [ -5$)z.Return *True* if the symbol is local. )rsrrrrrr r*s r is_localSymbol.is_local>s?DLLUDM1J++H y0HK Kr!c:[UR[-5$)z2Return *True* if the symbol is annotated. )rsrr r*s r is_annotatedSymbol.is_annotatedDrr!c:[UR[:H5$)z9Return *True* if a referenced symbol is not assigned to. )rsrr r*s r rSymbol.is_freeIsDLLD())r!c:[UR[-5$)zAReturn *True* if the symbol is created from an import statement. )rsrrr*s r is_importedSymbol.is_importedOsDLL:-..r!c:[UR[-5$)z)Return *True* if a symbol is assigned to.)rsrrr*s r is_assignedSymbol.is_assignedUsDLL9,--r!c,[UR5$)aSReturns *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. )rsrr*s r is_namespaceSymbol.is_namespaceYsD%%&&r!cUR$)z.Return a list of namespaces bound to this name)rr*s r get_namespacesSymbol.get_namespacesfs   r!c[UR5S:Xa [S5e[UR5S:a [S5eURS$)zReturn the single namespace bound to this name. Raises ValueError if the name is bound to multiple namespaces or no namespace. rz#name is not bound to any namespacesrz$name is bound to multiple namespaces)lenr ValueErrorr*s r get_namespaceSymbol.get_namespacejsS t  !Q &BC C "" #a 'CD D$$Q' 'r!)__flags__module_scope__name __namespaces__scoper&)r<r=r>r?r,r]rrrlrrrrr r rrrrrrr"r@rAr!r rr sg+U+ML  2 . K 15 K . * / . '! (r!rrc#Z# UH!oSRS5(dMUv M# g7f)rDEF_N) startswith)rkvs r rrys# I,R10@0@0Hbb,s+ +)r rrrrc ^SSKnSU4SjjmU=(d S/H`nUS:XaURR5nSnO%[US5nUR5nSSS5 [ WUS5nT"U5 Mb g!,(df  N(=f)Nrc |>SU-nUR5(aSOSnUR5S:XaSUR<3nOUR5<n[ USUUR5SUS35 UR 5HnUR U5nS RUR55R5n[ SUUR5R5S UR5<S U35 M [ 5 UR5HnT "XS -5 M g) Nz znested rXrDz from file zsymbol table for  :rz symbol rr) rxrerSrlprintrrrrlowerrr) r2levelindentrwwhatrsymbolrtable2 print_symbolss r r8main..print_symbolss%#oo//R >> x '23Dnn&)D )&%..2B1C1TF!LM**,E\\%(FIIf//1288:E D!2!2!4!:!:!< =XfooFWEZZ\]b\cd e- ((*F &!) ,+r!-zrbexec)r)sysstdinreadopenr)argsr=rsrcfmodr8s @r mainrE~sv-"MSEM s?)).."C Hh%ffh&sHf-c" &%s A?? B __main__r)'__doc__rrrrrrrr r r r r rrrrr'enumr__all__rr#rrrrrrrextendglobalsitems _scopes_namesrrEr<r=argv)ns0r rPs844444 W*$%&$g$p0p0f3{3l)K)Xk(k(\ #, I79??, IIO 2?@-Q1q-@< z!"CAs6C2