%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/compiler/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/compiler/symbols.pyo

ó
Oêáac@s=dZddlmZddlmZmZmZmZmZm	Z	ddl
mZddlZddl
Z
dZddd„ƒYZd	efd
„ƒYZdefd„ƒYZd
efd„ƒYZdefd„ƒYZdefd„ƒYZddd„ƒYZd„Zedkr9ddl
Z
ddlmZmZddlZd„Zxäe
jdD]ÒZeGHeeƒZej ƒZ!ej"ƒeje!edƒZ#ee#ƒZ$eeƒZ%eƒZ&ee%e&ƒe&j'e%jƒZ(ee$e(ƒs"HdGeGHe)e$ƒGHe)e(ƒGHe
j*dƒniZ+e+j,e&j'ƒe+e%=e+j-ƒZ'[+xáe#j.ƒD]ÓZ&e&j/ƒr[ge'D]!Z0e0j1e&j2ƒkrte0^qtZ3e4e3ƒdkr¿dGe&j2ƒGHq.eee&j5ƒƒe3djƒƒs.e&j2ƒGHe)ee&j5ƒƒƒGHe)e3djƒƒGHe
j*dƒq.q[q[Wq`WndS( sModule symbol-table generatoriÿÿÿÿ(tast(tSC_LOCALtSC_GLOBAL_IMPLICITtSC_GLOBAL_EXPLICITtSC_FREEtSC_CELLt
SC_UNKNOWN(tmangleNitScopecBs¤eZdd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d„Zd	„Zd
„Z
d„Zd„Zd
„Zd„Zd„Zd„ZRS(cCs½||_||_i|_i|_i|_i|_i|_i|_g|_d|_
d|_d|_|dk	r¹x>t
t|ƒƒD]'}||dkr‹|||_Pq‹q‹WndS(Nt_(tnametmoduletdefstusestglobalstparamstfreestcellstchildrentNonetnestedt	generatortklasstrangetlen(tselfR
RRti((s,/usr/local/lib/python2.7/compiler/symbols.pyt__init__s"												
cCsd|jj|jfS(Ns<%s: %s>(t	__class__t__name__R
(R((s,/usr/local/lib/python2.7/compiler/symbols.pyt__repr__%scCs#|jdkr|St||jƒS(N(RRR(RR
((s,/usr/local/lib/python2.7/compiler/symbols.pyR(scCsd|j|j|ƒ<dS(Ni(RR(RR
((s,/usr/local/lib/python2.7/compiler/symbols.pytadd_def-scCsd|j|j|ƒ<dS(Ni(R
R(RR
((s,/usr/local/lib/python2.7/compiler/symbols.pytadd_use0scCsy|j|ƒ}||jks0||jkr0n||jkrXtd||jf‚nd|j|<|jj|ƒdS(Ns %s in %s is global and parameteri(	RR
RRtSyntaxErrorR
RRR(RR
((s,/usr/local/lib/python2.7/compiler/symbols.pyt
add_global3s
cCs-|j|ƒ}d|j|<d|j|<dS(Ni(RRR(RR
((s,/usr/local/lib/python2.7/compiler/symbols.pyt	add_param=s
cCs@i}|j|jƒ|j|jƒ|j|jƒ|jƒS(N(tupdateRR
Rtkeys(Rtd((s,/usr/local/lib/python2.7/compiler/symbols.pyt	get_namesBs
cCs|jj|ƒdS(N(Rtappend(Rtchild((s,/usr/local/lib/python2.7/compiler/symbols.pyt	add_childIscCs|jS(N(R(R((s,/usr/local/lib/python2.7/compiler/symbols.pytget_childrenLscCs—tj|jI|jrdp"dIJtjdI|jIJtjdI|jIJtjdI|jIJtjdI|jIJtjdI|jIJdS(NRts
	globals: s	cells: s	defs: s	uses: s	frees:(	tsyststderrR
RRRRR
R(R((s,/usr/local/lib/python2.7/compiler/symbols.pytDEBUGOs%cCsy||jkrtS||jkr&tS||jkr9tS|jrd||jks`||jkrdt	S|jrqt
StSdS(sbReturn scope of name.

        The scope of a name could be LOCAL, GLOBAL, FREE, or CELL.
        N(RRRRRRRRR
RRR(RR
((s,/usr/local/lib/python2.7/compiler/symbols.pyt
check_nameWs'	cCsr|js
dSi}|j|jƒxB|jjƒD]1}||jkr3||jkr3d||<q3q3W|jƒS(Ni((RR$RR
R%RR(RtfreeR
((s,/usr/local/lib/python2.7/compiler/symbols.pyt
get_free_varsis	cCsQxJ|jD]?}|jƒ}|j|ƒ}x|D]}|j|ƒq2Wq
WdS(N(RR2t	add_freestforce_global(RR)RRR
((s,/usr/local/lib/python2.7/compiler/symbols.pythandle_childrenss

cCsfd|j|<||jkr)|j|=nx6|jD]+}|j|ƒtkr3|j|ƒq3q3WdS(sÞForce name to be global in scope.

        Some child of the current node had a free reference to name.
        When the child was processed, it was labelled a free
        variable.  Now that all its enclosing scope have been
        processed, the name is known to be a global or builtin.  So
        walk back down the child chain and set the name to be global
        rather than free.

        Be careful to stop if a child does not think the name is
        free.
        iN(RRRR0RR4(RR
R)((s,/usr/local/lib/python2.7/compiler/symbols.pyR4zs


cCsg}xû|D]ó}|j|ƒ}|jrÈ|tksR|tksRt|tƒrbd|j|<q|tkr~|j|ƒqt|t	ƒr©|t
kr©d|j|<q|tkr|j|ƒqq
|t
kräd|j|<q
|tkr
|j|ƒq
q
W|S(sþProcess list of free vars from nested scope.

        Returns a list of names that are either 1) declared global in the
        parent or 2) undefined in a top-level parent.  In either case,
        the nested scope should treat them as globals.
        i(
R0RRRt
isinstancet
ClassScopeRRR(t
FunctionScopeRRR(Rtnamest
child_globalsR
tsc((s,/usr/local/lib/python2.7/compiler/symbols.pyR3Žs$
	cCs
|jjƒS(N(RR%(R((s,/usr/local/lib/python2.7/compiler/symbols.pyt
get_cell_vars©sN(Rt
__module__RRRRRR R"R#R'R*R+R/R0R2R5R4R3R<(((s,/usr/local/lib/python2.7/compiler/symbols.pyRs"					
							
			tModuleScopecBseZejZd„ZRS(cCs|jd|ƒdS(Ntglobal(t_ModuleScope__super_init(R((s,/usr/local/lib/python2.7/compiler/symbols.pyR¯s(RR=RRR@(((s,/usr/local/lib/python2.7/compiler/symbols.pyR>¬s	R8cBseZRS((RR=(((s,/usr/local/lib/python2.7/compiler/symbols.pyR8²stGenExprScopecBs,eZejZdZdd„Zd„ZRS(icCs@|j}|jd7_|jd|||ƒ|jdƒdS(Nisgenerator expression<%d>s.0(t_GenExprScope__countert_GenExprScope__super_initR#(RRRR((s,/usr/local/lib/python2.7/compiler/symbols.pyRºs	cCstj|ƒ}|S(N(RR'(RR%((s,/usr/local/lib/python2.7/compiler/symbols.pyR'ÀsN(RR=RRRCRBRR'(((s,/usr/local/lib/python2.7/compiler/symbols.pyRAµs	tLambdaScopecBs#eZejZdZdd„ZRS(icCs3|j}|jd7_|jd|||ƒdS(Nis	lambda.%d(t_LambdaScope__countert_LambdaScope__super_init(RRRR((s,/usr/local/lib/python2.7/compiler/symbols.pyRÉs	N(RR=RRRFRER(((s,/usr/local/lib/python2.7/compiler/symbols.pyRDÄs	R7cBseZejZd„ZRS(cCs|j|||ƒdS(N(t_ClassScope__super_init(RR
R((s,/usr/local/lib/python2.7/compiler/symbols.pyRÑs(RR=RRRG(((s,/usr/local/lib/python2.7/compiler/symbols.pyR7Îs	t
SymbolVisitorcBseZd„Zd„ZeZd„Zd„Zd„Zd„Zd„Z	dd„Z
d	„Zd
„Zd„Z
dd„Zd
„Zd„Zd„Zd„Zd„Zdd„Zdd„Zdd„Zdd„Zd„ZejejejfZd„Zd„ZRS(cCsi|_d|_dS(N(tscopesRR(R((s,/usr/local/lib/python2.7/compiler/symbols.pyRÕs	cCs2tƒ}|_|j|<|j|j|ƒdS(N(R>RRItvisittnode(RRKtscope((s,/usr/local/lib/python2.7/compiler/symbols.pytvisitModuleÛscCsÙ|jr|j|j|ƒn|j|jƒx!|jD]}|j||ƒq9Wt|j|j|jƒ}|js†t	|tƒr’d|_n||j
|<|j||jƒ|j|j
|ƒ|j||ƒdS(Ni(t
decoratorsRJRR
tdefaultsR8RRRR6RIt_do_argstargnamestcodethandle_free_vars(RRKtparenttnRL((s,/usr/local/lib/python2.7/compiler/symbols.pyt
visitFunctionás	
cCs|t|j|jƒ}|js<t|tƒs<t|tƒrHd|_n||j|<|j|j|ƒ|j	||ƒdS(Ni(
RARRRR6R8RIRJRRRS(RRKRTRL((s,/usr/local/lib/python2.7/compiler/symbols.pytvisitGenExprïs
cCs;x!|jD]}|j||ƒq
W|j|j|ƒdS(N(tqualsRJtexpr(RRKRLtgenfor((s,/usr/local/lib/python2.7/compiler/symbols.pytvisitGenExprInnerúscCsQ|j|j|dƒ|j|j|ƒx!|jD]}|j||ƒq3WdS(Ni(RJtassigntitertifs(RRKRLtif_((s,/usr/local/lib/python2.7/compiler/symbols.pytvisitGenExprForscCs|j|j|ƒdS(N(RJttest(RRKRL((s,/usr/local/lib/python2.7/compiler/symbols.pytvisitGenExprIfsicCs¤x!|jD]}|j||ƒq
Wt|j|jƒ}|jsQt|tƒr]d|_n||j|<|j	||j
ƒ|j|j|ƒ|j||ƒdS(Ni(
RORJRDRRRR6R8RIRPRQRRRS(RRKRTR\RURL((s,/usr/local/lib/python2.7/compiler/symbols.pytvisitLambda	s
cCsJxC|D];}t|ƒtjkr5|j||ƒq|j|ƒqWdS(N(ttypettypest	TupleTypeRPR#(RRLtargsR
((s,/usr/local/lib/python2.7/compiler/symbols.pyRPs
cCs|j|ƒ|jƒdS(N(R*R5(RRLRT((s,/usr/local/lib/python2.7/compiler/symbols.pyRS s
cCsë|j|jƒx!|jD]}|j||ƒqWt|j|jƒ}|jsat|tƒrmd|_n|j	dk	rŒ|jdƒn|jdƒ||j|<|j}|j|_|j|j
|ƒ||_|j||ƒdS(Nit__doc__R=(RR
tbasesRJR7RRR6R8tdocRRIRRRRS(RRKRTRURLtprev((s,/usr/local/lib/python2.7/compiler/symbols.pyt
visitClass$s

		cCs-|r|j|jƒn|j|jƒdS(N(RR
R (RRKRLR\((s,/usr/local/lib/python2.7/compiler/symbols.pyt	visitName;scCs_|j|j|dƒ|j|j|ƒ|j|j|ƒ|jr[|j|j|ƒndS(Ni(RJR\tlisttbodytelse_(RRKRL((s,/usr/local/lib/python2.7/compiler/symbols.pytvisitForCs
	cCsCx<|jD]1\}}|dkr(q
n|j|p7|ƒq
WdS(Nt*(R9R(RRKRLR
tasname((s,/usr/local/lib/python2.7/compiler/symbols.pyt	visitFromJscCsYxR|jD]G\}}|jdƒ}|dkr>|| }n|j|pM|ƒq
WdS(Nt.iÿÿÿÿ(R9tfindR(RRKRLR
RsR((s,/usr/local/lib/python2.7/compiler/symbols.pytvisitImportPs

cCs%x|jD]}|j|ƒq
WdS(N(R9R"(RRKRLR
((s,/usr/local/lib/python2.7/compiler/symbols.pytvisitGlobalWscCs>x$|jD]}|j||dƒq
W|j|j|ƒdS(s.Propagate assignment flag down to child nodes.

        The Assign node doesn't itself contains the variables being
        assigned to.  Instead, the children in node.nodes are visited
        with the assign flag set to true.  When the names occur in
        those nodes, they are marked as defs.

        Some names that occur in an assignment target are not bound by
        the assignment, e.g. a name occurring inside a slice.  The
        visitor handles these nodes specially; they do not propagate
        the assign flag to their children.
        iN(tnodesRJRY(RRKRLRU((s,/usr/local/lib/python2.7/compiler/symbols.pytvisitAssign[s
icCs|j|jƒdS(N(RR
(RRKRLR\((s,/usr/local/lib/python2.7/compiler/symbols.pytvisitAssNamelscCs|j|j|dƒdS(Ni(RJRY(RRKRLR\((s,/usr/local/lib/python2.7/compiler/symbols.pytvisitAssAttroscCsA|j|j|dƒx$|jD]}|j||dƒq WdS(Ni(RJRYtsubs(RRKRLR\RU((s,/usr/local/lib/python2.7/compiler/symbols.pytvisitSubscriptrscCs^|j|j|dƒ|jr8|j|j|dƒn|jrZ|j|j|dƒndS(Ni(RJRYtlowertupper(RRKRLR\((s,/usr/local/lib/python2.7/compiler/symbols.pyt
visitSlicews
		cCsX|j|j|ƒt|jtjƒrA|j|j|dƒn|j|j|ƒdS(Ni(RJRKR6RtNameRY(RRKRL((s,/usr/local/lib/python2.7/compiler/symbols.pytvisitAugAssign~scCsœxv|jD]k\}}t|tjƒrUt|jƒ|jkrU|jsRq
qRqUn|j||ƒ|j||ƒq
W|jr˜|j|j|ƒndS(N(	ttestsR6RtConstRdtvaluet_const_typesRJRp(RRKRLRaRo((s,/usr/local/lib/python2.7/compiler/symbols.pytvisitIfŠs		cCs d|_|j|j|ƒdS(Ni(RRJR†(RRKRL((s,/usr/local/lib/python2.7/compiler/symbols.pyt
visitYield—s	( RR=RRMtvisitExpressionRVRWR[R`RbRcRPRSRlRmRqRtRwRxRzR{R|R~RRƒRet
StringTypetIntTypet	FloatTypeR‡RˆR‰(((s,/usr/local/lib/python2.7/compiler/symbols.pyRHÔs4																
	
cCst|ƒt|ƒkS(N(tsorted(tl1tl2((s,/usr/local/lib/python2.7/compiler/symbols.pytlist_eq›st__main__(t	parseFiletwalkcCsTgg|jƒD]}|jƒ^qD]*}|jdƒpG|jdƒs&|^q&S(Ns_[Ru(tget_symbolstget_namet
startswith(tsymsts((s,/usr/local/lib/python2.7/compiler/symbols.pyR'£s,itexectoopstskippingi(((6RhtcompilerRtcompiler.constsRRRRRRt
compiler.miscRReR-t
MANGLE_LENRR>R8RARDR7RHR‘RR“R”tsymtableR'targvtfiletopentftreadtbuftcloseR˜t	mod_namesttreeR™RItnames2RŽtexitR&R$tvaluesR•tis_namespaceR;R
R–tlRt
get_namespace(((s,/usr/local/lib/python2.7/compiler/symbols.pyt<module>sj.ž
Ç		
	
	
!

Zerion Mini Shell 1.0