Efc@sdZddlZddlmZmZmZmZmZmZmZm Z m Z m Z m Z m Z mZmZmZmZddlZdddddgZd Zd dd YZeZdefd YZdefd YZdefdYZdefdYZedkrddlZddlZeej dj!Z"ee"ej#j$ej dddZ%x?e%j&D].Z'e%j(e'Z)e)Ge)j*Ge)j+GHqWndS(s2Interface to the compiler's internal symbol tablesiN(tUSEt DEF_GLOBALt DEF_LOCALt DEF_PARAMt DEF_IMPORTt DEF_BOUNDtOPT_IMPORT_STARtOPT_EXECt OPT_BARE_EXECt SCOPE_OFFt SCOPE_MASKtFREEtGLOBAL_IMPLICITtGLOBAL_EXPLICITtCELLtLOCALtsymtablet SymbolTabletClasstFunctiontSymbolcCsLtj|||}x'|jD]}|jdkr"Pq"q"Wt||S(Nttop(t _symtableRt itervaluestnamet_newSymbolTable(tcodetfilenamet compile_typetrawR((s /usr/lib64/python2.7/symtable.pyR s tSymbolTableFactorycBs#eZdZdZdZRS(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(R"ttableR((s /usr/lib64/python2.7/symtable.pytnews   cCsQ||f}|jj|d}|dkrM|j||}|j|s<{0}SymbolTable for {1} in {2}>(t __class__RR.R0RtformatR1(R"tkind((s /usr/lib64/python2.7/symtable.pyt__repr__/s   cCs||jjtjkrdS|jjtjkr2dS|jjtjkrKdS|jjdksxtdj|jjdS( Ntmoduletfunctiontclassiiisunexpected type: {0}(iii(R0R$Rt TYPE_MODULER%R&tAssertionErrorR7(R"((s /usr/lib64/python2.7/symtable.pytget_type<scCs |jjS(N(R0tid(R"((s /usr/lib64/python2.7/symtable.pytget_idFscCs |jjS(N(R0R(R"((s /usr/lib64/python2.7/symtable.pytget_nameIscCs |jjS(N(R0tlineno(R"((s /usr/lib64/python2.7/symtable.pyt get_linenoLscCs&t|jjtjko"|jj S(N(tboolR0R$RR%t optimized(R"((s /usr/lib64/python2.7/symtable.pyt is_optimizedOscCst|jjS(N(RER0tnested(R"((s /usr/lib64/python2.7/symtable.pyt is_nestedSscCst|jjS(N(RER0tchildren(R"((s /usr/lib64/python2.7/symtable.pyt has_childrenVscCst|jjttB@S(s"Return true if the scope uses exec(RER0RFRR(R"((s /usr/lib64/python2.7/symtable.pythas_execYscCst|jjt@S(s&Return true if the scope uses import *(RER0RFR(R"((s /usr/lib64/python2.7/symtable.pythas_import_star]scCs|jjjS(N(R0tsymbolstkeys(R"((s /usr/lib64/python2.7/symtable.pytget_identifiersascCsa|jj|}|dkr]|jj|}|j|}t|||}|j|s(t_Function__paramsR*t_Function__idents_matching(R"((s /usr/lib64/python2.7/symtable.pytget_parametersscsF|jdkr?ttffd}|j||_n|jS(Ncs|t?t@kS(N(R R (R^(tlocs(s /usr/lib64/python2.7/symtable.pyR_s(t_Function__localsR*RRRa(R"ttest((Rcs /usr/lib64/python2.7/symtable.pyt get_localss  csF|jdkr?ttffd}|j||_n|jS(Ncs|t?t@kS(N(R R (R^(tglob(s /usr/lib64/python2.7/symtable.pyR_s(t_Function__globalsR*R R Ra(R"Re((Rgs /usr/lib64/python2.7/symtable.pyt get_globalss  cCs4|jdkr-d}|j||_n|jS(NcSs|t?t@tkS(N(R R R (R^((s /usr/lib64/python2.7/symtable.pyR_s(t_Function__freesR*Ra(R"tis_free((s /usr/lib64/python2.7/symtable.pyt get_freess N( R.R/R*R`RdRjRhRaRbRfRiRl(((s /usr/lib64/python2.7/symtable.pyRys    cBseZdZdZRS(cCsR|jdkrKi}x!|jjD]}d||j(R7Rp(R"((s /usr/lib64/python2.7/symtable.pyR9scCs|jS(N(Rp(R"((s /usr/lib64/python2.7/symtable.pyRBscCst|jtj@S(N(RERqRR(R"((s /usr/lib64/python2.7/symtable.pyt is_referencedscCst|jt@S(N(RERqR(R"((s /usr/lib64/python2.7/symtable.pyt is_parameterscCst|jttfkS(N(RERrR R (R"((s /usr/lib64/python2.7/symtable.pyt is_globalscCst|jtkS(N(RERrR (R"((s /usr/lib64/python2.7/symtable.pytis_declared_globalscCst|jt@S(N(RERqR(R"((s /usr/lib64/python2.7/symtable.pytis_localscCst|jtkS(N(RERrR (R"((s /usr/lib64/python2.7/symtable.pyRkscCst|jt@S(N(RERqR(R"((s /usr/lib64/python2.7/symtable.pyt is_importedscCst|jt@S(N(RERqR(R"((s /usr/lib64/python2.7/symtable.pyt is_assignedscCs t|jS(sReturns 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. (RERs(R"((s /usr/lib64/python2.7/symtable.pyt is_namespaces cCs|jS(s.Return a list of namespaces bound to this name(Rs(R"((s /usr/lib64/python2.7/symtable.pytget_namespacesscCs,t|jdkr!tdn|jdS(sReturns the single namespace bound to this name. Raises ValueError if the name is bound to multiple namespaces. is$name is bound to multiple namespacesi(tlenRst ValueError(R"((s /usr/lib64/python2.7/symtable.pyt get_namespaces N(R.R/R*R#R9RBRtRuRvRwRxRkRyRzR{R|R(((s /usr/lib64/python2.7/symtable.pyRs            t__main__iitexec((,t__doc__RRRRRRRRRRR R R R R RRRt__all__RRRtobjectRRRRR.tostsystopentargvtreadtsrctpathtsplittmodRPRVRUtinfoRxR{(((s /usr/lib64/python2.7/symtable.pyts$ j   Q& @ )