m %UIc@sdZdkZdklZlZlZlZlZlZlZl Z l Z l Z l Z l Z lZlZlZdkZddddddgZd Zd fd YZeZd Zdfd YZdefdYZdefdYZdfdYZedjodkZdkZeeidi Z!ee!ei"i#eidddZ$x@e$i%D].Z&e$i'e&Z(e(Ge(i)Ge(i*GHqWndS(s2Interface to the compiler's internal symbol tablesN(sUSEs DEF_GLOBALs DEF_LOCALs DEF_PARAMsDEF_STARsDEF_DOUBLESTARs DEF_INTUPLEsDEF_FREEsDEF_FREE_GLOBALsDEF_FREE_CLASSs DEF_IMPORTs DEF_BOUNDsOPT_IMPORT_STARsOPT_EXECs OPT_BARE_EXECtsymtablet SymbolTabletnewSymbolTabletClasstFunctiontSymbolcCs&ti|||}t|d|S(Ni(t _symtableRtcodetfilenamet compile_typetrawR(RRR R ((t%/data/zmath/lib/python2.4/symtable.pyRstSymbolTableFactorycBs#tZdZdZdZRS(NcCsti|_dS(N(tweakreftWeakValueDictionarytselft_SymbolTableFactory__memo(R((R t__init__scCsU|itijot||Sn|itijot||Snt||S(N( ttablettypeRt TYPE_FUNCTIONRRt TYPE_CLASSRR(RRR((R tnews cCsS||f}|ii|d}|djo!|i||}|i|s<%sSymbolTable for %s in %s>(Rt __class__RtkindRR)tnameR*(RR/((R t__repr__4s  cCs^|iitijodSn|iitijodSn|iitijodSndS(Ntmoduletfunctiontclass(RR)RRt TYPE_MODULERR(R((R tget_type@s cCs |iiS(N(RR)tid(R((R tget_idJscCs |iiS(N(RR)R0(R((R tget_nameMscCs |iiS(N(RR)tlineno(R((R t get_linenoPscCs't|iitijo |ii S(N(tboolRR)RRRt optimized(R((R t is_optimizedSscCst|iiS(N(R<RR)tnested(R((R t is_nestedWscCst|iiS(N(R<RR)tchildren(R((R t has_childrenZscCst|iittB@S(s"Return true if the scope uses execN(R<RR)R=tOPT_EXECt OPT_BARE_EXEC(R((R thas_exec]scCst|iit@S(s&Return true if the scope uses import *N(R<RR)R=tOPT_IMPORT_STAR(R((R thas_import_starascCs|iiiS(N(RR)tsymbolstkeys(R((R tget_identifiersescCsc|ii|}|djo@|ii|}|i |}t |||}|i|R@RBRERGRJRNRQRLRT(((R R.s              cBsMtZdZdZdZdZdZdZdZ dZ dZ RS(NcCsFtg}|iD](}||ii|o ||qq~S(N(ttupleRORRJRPt test_funcR)RH(RRVRORP((R t__idents_matchingscCs0|idjo|id|_n|iS(NcCs|t@S(N(txR"(RX((R ts(Rt_Function__paramsRt_Function__idents_matching(R((R tget_parametersscCs0|idjo|id|_n|iS(NcCs|t@S(N(RXt DEF_BOUND(RX((R RYs(Rt_Function__localsRR[(R((R t get_localsscs=|idjo&ttB|id|_n|iS(Ncs|@S(N(RXtglob(RX(R`(R RYs(Rt_Function__globalsRR#tDEF_FREE_GLOBALR`R[(RR`((R`R t get_globalss cCs-|idjo|it|_n|iS(N(Rt_Function__freesRR[R'(R((R t get_freess( RRRRZR^RdRaR[R\R_RcRe(((R R|s    cBstZdZdZRS(NcCsT|idjo=h}x!|iiD]}d||i(RRi(R((R R1scCs|iS(N(RRi(R((R R9scCst|iti@S(N(R<RRjRR(R((R t is_referencedscCst|it@S(N(R<RRjR"(R((R t is_parameterscCst|it@p |it@S(N(R<RRjR#Rb(R((R t is_globalscCst|it@S(N(R<RRjtDEF_STAR(R((R t is_varargscCst|it@S(N(R<RRjtDEF_DOUBLESTAR(R((R t is_keywordargscCst|it@S(N(R<RRjR](R((R tis_localscCsJ|ittB@o|ittBtB@otSn|it@otSnt S(N( RRjRR R!R"R#R$R%R&(R((R R's (cCst|it@S(N(R<RRjt DEF_IMPORT(R((R t is_importedscCst|it@S(N(R<RRjR!(R((R t is_assignedscCst|it@S(N(R<RRjt DEF_INTUPLE(R((R t is_in_tuplescCs t|iS(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. N(R<RRk(R((R t is_namespaces cCs|iS(s.Return a list of namespaces bound to this nameN(RRk(R((R tget_namespacesscCs.t|idjo tdn|idS(sReturns the single namespace bound to this name. Raises ValueError if the name is bound to multiple namespaces. is$name is bound to multiple namespacesiN(tlenRRkt ValueError(R((R t get_namespaces (RRRRR1R9RlRmRnRpRrRsR'RuRvRxRyRzR}(((R Rs               t__main__iitexec(+t__doc__RRR#R!R"RoRqRwR RbR%RtR]RFRCRDR t__all__RR RR'RRRRRtostsystopentargvtreadtsrctpathtsplittmodRJRPRNtinfoRsRy( RoRRRbR"RR RR%RRRwR#RqRR RCR'RRPRtRRRRDR!RRFR RR]R((R t?s( a    N! J )