� zfc@s�dZddlZddlmZmZmZmZmZmZmZm Z m Z m Z m Z m Z mZmZmZmZddlZdddddgZd �Zd dd ��YZe�Zdefd ��YZdefd ��YZdefd��YZdefd��YZedkr�ddlZddlZeej d�j!�Z"ee"ej#j$ej d�dd�Z%x?e%j&�D].Z'e%j(e'�Z)e)Ge)j*�Ge)j+�GHq�WndS(s2Interface to the compiler's internal symbol tablesi����N(tUSEt DEF_GLOBALt DEF_LOCALt DEF_PARAMt DEF_IMPORTt DEF_BOUNDtOPT_IMPORT_STARtOPT_EXECt OPT_BARE_EXECt SCOPE_OFFt SCOPE_MASKtFREEtGLOBAL_IMPLICITtGLOBAL_EXPLICITtCELLtLOCALtsymtablet SymbolTabletClasstFunctiontSymbolcCs"tj|||�}t||�S(N(t _symtableRt_newSymbolTable(tcodetfilenamet compile_typettop((s /usr/lib64/python2.7/symtable.pyR stSymbolTableFactorycBs#eZd�Zd�Zd�ZRS(cCstj�|_dS(N(tweakreftWeakValueDictionaryt_SymbolTableFactory__memo(tself((s /usr/lib64/python2.7/symtable.pyt__init__scCsK|jtjkrt||�S|jtjkr>t||�St||�S(N(ttypeRt TYPE_FUNCTIONRt TYPE_CLASSRR(RttableR((s /usr/lib64/python2.7/symtable.pytnews   cCsQ||f}|jj|d�}|dkrM|j||�}|j|s<{0}SymbolTable for {1} in {2}>(t __class__RR+R-tnametformatR.(Rtkind((s /usr/lib64/python2.7/symtable.pyt__repr__,s   cCs||jjtjkrdS|jjtjkr2dS|jjtjkrKdS|jjdksxtdj|jj���dS( Ntmoduletfunctiontclassiiisunexpected type: {0}(iii(R-R!Rt TYPE_MODULER"R#tAssertionErrorR5(R((s /usr/lib64/python2.7/symtable.pytget_type9scCs |jjS(N(R-tid(R((s /usr/lib64/python2.7/symtable.pytget_idCscCs |jjS(N(R-R4(R((s /usr/lib64/python2.7/symtable.pytget_nameFscCs |jjS(N(R-tlineno(R((s /usr/lib64/python2.7/symtable.pyt get_linenoIscCs&t|jjtjko"|jj �S(N(tboolR-R!RR"t optimized(R((s /usr/lib64/python2.7/symtable.pyt is_optimizedLscCst|jj�S(N(RCR-tnested(R((s /usr/lib64/python2.7/symtable.pyt is_nestedPscCst|jj�S(N(RCR-tchildren(R((s /usr/lib64/python2.7/symtable.pyt has_childrenSscCst|jjttB@�S(s"Return true if the scope uses exec(RCR-RDRR(R((s /usr/lib64/python2.7/symtable.pythas_execVscCst|jjt@�S(s&Return true if the scope uses import *(RCR-RDR(R((s /usr/lib64/python2.7/symtable.pythas_import_starZscCs|jjj�S(N(R-tsymbolstkeys(R((s /usr/lib64/python2.7/symtable.pytget_identifiers^scCsa|jj|�}|dkr]|jj|}|j|�}t|||�}|j|�R1(t_Function__paramsR't_Function__idents_matching(R((s /usr/lib64/python2.7/symtable.pytget_parameters�scsF|jdkr?ttf��fd�}|j|�|_n|jS(Ncs|t?t@�kS(N(R R (R\(tlocs(s /usr/lib64/python2.7/symtable.pyR]�R1(t_Function__localsR'RRR_(Rttest((Ras /usr/lib64/python2.7/symtable.pyt get_locals�s  csF|jdkr?ttf��fd�}|j|�|_n|jS(Ncs|t?t@�kS(N(R R (R\(tglob(s /usr/lib64/python2.7/symtable.pyR]�R1(t_Function__globalsR'R R R_(RRc((Res /usr/lib64/python2.7/symtable.pyt get_globals�s  cCs4|jdkr-d�}|j|�|_n|jS(NcSs|t?t@tkS(N(R R R (R\((s /usr/lib64/python2.7/symtable.pyR]�R1(t_Function__freesR'R_(Rtis_free((s /usr/lib64/python2.7/symtable.pyt get_frees�s N( R+R,R'R^RbRhRfR_R`RdRgRj(((s /usr/lib64/python2.7/symtable.pyRvs    cBseZdZd�ZRS(cCsR|jdkrKi}x!|jjD]}d||j(R5Rn(R((s /usr/lib64/python2.7/symtable.pyR7�scCs|jS(N(Rn(R((s /usr/lib64/python2.7/symtable.pyR@�scCst|jtj@�S(N(RCRoRR(R((s /usr/lib64/python2.7/symtable.pyt is_referenced�scCst|jt@�S(N(RCRoR(R((s /usr/lib64/python2.7/symtable.pyt is_parameter�scCst|jttfk�S(N(RCRpR R (R((s /usr/lib64/python2.7/symtable.pyt is_global�scCst|jtk�S(N(RCRpR (R((s /usr/lib64/python2.7/symtable.pytis_declared_global�scCst|jt@�S(N(RCRoR(R((s /usr/lib64/python2.7/symtable.pytis_local�scCst|jtk�S(N(RCRpR (R((s /usr/lib64/python2.7/symtable.pyRi�scCst|jt@�S(N(RCRoR(R((s /usr/lib64/python2.7/symtable.pyt is_imported�scCst|jt@�S(N(RCRoR(R((s /usr/lib64/python2.7/symtable.pyt is_assigned�scCs t|j�S(s�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. (RCRq(R((s /usr/lib64/python2.7/symtable.pyt is_namespace�s cCs|jS(s.Return a list of namespaces bound to this name(Rq(R((s /usr/lib64/python2.7/symtable.pytget_namespaces�scCs,t|j�dkr!td�n|jdS(s�Returns the single namespace bound to this name. Raises ValueError if the name is bound to multiple namespaces. is$name is bound to multiple namespacesi(tlenRqt ValueError(R((s /usr/lib64/python2.7/symtable.pyt get_namespace�s N(R+R,R'R R7R@RrRsRtRuRvRiRwRxRyRzR}(((s /usr/lib64/python2.7/symtable.pyR�s            t__main__iitexec((,t__doc__RRRRRRRRRRR R R R R RRRt__all__RRRtobjectRRRRR+tostsystopentargvtreadtsrctpathtsplittmodRNRTRStinfoRvRy(((s /usr/lib64/python2.7/symtable.pyts$ j   Q& @ )