ó 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   cCsO|jjtjkrdS|jjtjkr2dS|jjtjkrKdSdS(Ntmoduletfunctiontclass(R-R!Rt TYPE_MODULER"R#(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(RBR-tnested(R((s /usr/lib64/python2.7/symtable.pyt is_nestedPscCst|jjƒS(N(RBR-tchildren(R((s /usr/lib64/python2.7/symtable.pyt has_childrenSscCst|jjttB@ƒS(s"Return true if the scope uses exec(RBR-RCRR(R((s /usr/lib64/python2.7/symtable.pythas_execVscCst|jjt@ƒS(s&Return true if the scope uses import *(RBR-RCR(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|R?RARDRFRHRIRJRMRRRTRNRW(((s /usr/lib64/python2.7/symtable.pyR%s              cBsMeZdZdZdZdZd„Zd„Zd„Z d„Z d„Z RS(cCs9tg|jƒD]"}||jj|ƒr|^qƒS(N(ttupleRMR-RK(Rt test_funcRS((s /usr/lib64/python2.7/symtable.pyt__idents_matching~scCs.|jdkr'|jd„ƒ|_n|jS(NcSs|t@S(N(R(tx((s /usr/lib64/python2.7/symtable.pyt„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((R`s /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^(RRb((Rds /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]RaRgReR^R_RcRfRi(((s /usr/lib64/python2.7/symtable.pyRvs    cBseZdZd„ZRS(cCsR|jdkrKi}x!|jjD]}d||j(R5Rm(R((s /usr/lib64/python2.7/symtable.pyR7±scCs|jS(N(Rm(R((s /usr/lib64/python2.7/symtable.pyR?´scCst|jtj@ƒS(N(RBRnRR(R((s /usr/lib64/python2.7/symtable.pyt is_referenced·scCst|jt@ƒS(N(RBRnR(R((s /usr/lib64/python2.7/symtable.pyt is_parameterºscCst|jttfkƒS(N(RBRoR R (R((s /usr/lib64/python2.7/symtable.pyt is_global½scCst|jtkƒS(N(RBRoR (R((s /usr/lib64/python2.7/symtable.pytis_declared_globalÀscCst|jt@ƒS(N(RBRnR(R((s /usr/lib64/python2.7/symtable.pytis_localÃscCst|jtkƒS(N(RBRoR (R((s /usr/lib64/python2.7/symtable.pyRhÆscCst|jt@ƒS(N(RBRnR(R((s /usr/lib64/python2.7/symtable.pyt is_importedÉscCst|jt@ƒS(N(RBRnR(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. (RBRp(R((s /usr/lib64/python2.7/symtable.pyt is_namespaceÏs cCs|jS(s.Return a list of namespaces bound to this name(Rp(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(tlenRpt ValueError(R((s /usr/lib64/python2.7/symtable.pyt get_namespaceàs N(R+R,R'R R7R?RqRrRsRtRuRhRvRwRxRyR|(((s /usr/lib64/python2.7/symtable.pyR©s            t__main__iitexec((,t__doc__RRRRRRRRRRR R R R R RRRt__all__RRRtobjectRRRRR+tostsystopentargvtreadtsrctpathtsplittmodRMRSRRtinfoRuRx(((s /usr/lib64/python2.7/symtable.pyts$ j   Q& @ )