All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ast.spark.pyc Maven / Gradle / Ivy

Go to download

Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform.

There is a newer version: 2.7.4
Show newest version
?
k??Sc@s?dZddlZddlZddlZd?Zdfd??YZdfd??YZdfd	??YZd
efd??YZdfd
??YZ	dfd??YZ
defd??YZd?ZdS(sSPARK-0.7 (pre-alpha-5)i????NcCs?gi|jg}}}xr|D]j}x|jD]}|j|?q1Wx@|jj?D]/}|j|?sX|j|?d|||jjj?D]*\}}t|d|?|j|d%s)i(Rt__doc__(RRtdoctrv((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pytmakeRE0scCsxg}xIt|?D];}|d dkr|dkr|j|j|??qqW|j|jd??tj|d?S(NiRt	t_defaultt|(R
RR tstringtjoin(RRR((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR5scCsd|GHt?dS(NsLexical error at position %s(t
SystemExit(Rtstpos((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyterror>s	cCs?d}t|?}x?||kr?|jj||?}|dkrU|j||?n|j?}xNtt|??D]:}||rt|jj|?rt|j|||?qtqtW|j	?}qWdS(Ni(
tlenRtmatchtNoneR(tgroupstrangeRRtend(RR&R'tntmR,ti((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyttokenizeBscCsdGHt?dS(s( . | \n )+s$Specification error: unmatched inputN(R%(RR&((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR!Ps(t__name__t
__module__RR RR(R2R!(((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR's					t_StatecBseZd?ZRS(cCs*gg||_|_|_||_dS(N(tTtcompleteRtstateno(RR8R((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyRYs(R3R4R(((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR5Xst
GenericParsercBs.eZd?ZdZdZdZd?Zd?Zd?Zdd?Z	d	?Z
d
?Zd?Zd?Z
d
?Zd?Zd?Zd?Zd?Zd?Zdd?Zd?Zd?Zd?Zd?Zd"d"d"d?Zd?Zd?Zd?Zd?Zd?Zd?Z d ?Z!d!?Z"RS(#cCs?i|_i|_i|_|j?|j|?d|_dS(Ni(trulest	rule2funct	rule2nametcollectRulestaugmenttruleschanged(Rtstart((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyRis			

s\e_tSTARTs|-cCs>|jrw|j?i|_i|_|j?d|_ii|_|_i|j?d6|_|j	d|j
?nd}xv|r?d}xc|jj?D]R\}}|dkr?|\}}|jj
|?r?|j||?d}q?q?q?Wq?W|jj?}x|jj?D]}|`qW|d=|d=|d=|S(NiiR;tnullabletcores(R?tcomputeNulltnewrulestnew2oldtmakeNewRulestedgesRCt
makeState0tstatest	makeStatet_BOFRR+RtgotoRtcopytvalues(RtchangestktvtstatetsymRR&((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyt__getstate__zs2	
		
		
cCsvi|_i|_i|_|j?|d|jddd}|j|?|j|d<|j|d<||_dS(NR:iiR;tmakeSet(R:R;R<R=t_STARTR>tmakeSet_fastR(RtDR@((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyt__setstate__?s			



cCs
||fS(N((Rtruletfunc((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyt
preprocess?sicCsU|}tj|?}g}x>tt|??D]*}||dkr.|j|d?q.q.W|jt|??x?tt|?d?D]?}|||}|||d||d!}	|t|	?f}
|r?|j|
|?\}
}n|jj|?r|j|j|
?n|
g|j|<||j	|
<|j
d|j|
?si(RWRLRe(RR@R[((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR>?scCs4i|_g}x?|jj?D]?}|dd}d|j|}|jg?||gkr?Pn|j||||?q?W|jg?|jd|t
|??|j|?df}||dkrit
|?dkrY|j||d?qi|jd?n|j|j||t
|?d?S(Niiii????(ii(ii(tlinksR?RDRERFRGRHRCRIRJRKRLtxrangeR)RRVR+RmR(t	buildTreeRW(RRltsetsR1t	finalitem((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pytparse.s2		
		
	

cCs|j|dt|j?!kS(Ni(RoR)(RRT((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyt
isnullableRsicCsP|\}}t|?}x1||krK|j||?s>Pn|d}qW|S(Ni(R)R}(Rt.1R'RcRdR/((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pytskipYs	cCs|dk	st?g}xj|j|jD]X\}}|\}}|||d!|fkr)|j||j||d?f?q)q)W|}|j?t|?}	|jj	|	?r?|j|	St
|j?}
|j|	x+|j|D]\}}||kr|SqWds:t?dS(Ni(RwR?(RR?R?tpR
((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR?IscCs?|j|}t|?dkr+|ddSg}i}x5|D]-\}}|d}|j|?|||W||j|?S(Niii(RwR)Rt	ambiguity(RR?Rwtchoicest
rule2causeR?R
R[((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR?Os


cCs?t|j|?dkr2|j|j|?}n|j|d}|d}dgt|?}x;tt|?ddd?D]}|j||?||RDRIRmRGRvR(R|R}RRKRMR?R?R+R?RVRXR?R?R?RyR?R?(((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR9]s@		!					$				"			$		Q				%	L				!	tGenericASTBuildercBs5eZd?Zd?Zd?Zd?Zd?ZRS(cCstj||?||_dS(N(R9RtAST(RR?R@((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR?scCs(|d?}|\}}|||?fS(NcSs
||d?S(NcSs|j||?S(N(tbuildASTNode(RgRcR((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyRh?s((RcR((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyRh?s((RR[R\trebindRcRd((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR]?scCs_g}xF|D]>}t||j?r5|j|?q
|j|j|??q
W|j||?S(N(t
isinstanceR?Rtterminaltnonterminal(RRgRctchildrenR?((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR??s
cCs|S(N((RRu((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR??scCs#|j|?}||t|?*|S(N(R?R)(RttypeRgR((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR??s(R3R4RR]R?R?R?(((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR??s
					t#GenericASTTraversalPruningExceptioncBseZRS((R3R4(((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR??stGenericASTTraversalcBsDeZd?Zd?Zd?Zdd?Zdd?Zd?ZRS(cCs
||_dS(N(tast(RR?((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR?scCs|jS(N(R?(Rtnode((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyRv?scCs
t?dS(N(R?(R((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pytprune?scCs?|dkr|j}nyOd|j|?}t||?rYt||?}||?n
|j|?Wntk
r{dSXx|D]}|j|?q?W|d}t||?r?t||?}||?ndS(Ntn_t_exit(R+R?RvthasattrRtdefaultR?tpreorder(RR?RR\tkid((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR??s 



cCs?|dkr|j}nx|D]}|j|?qWd|j|?}t||?rtt||?}||?n
|j|?dS(NR?(R+R?t	postorderRvR?RR?(RR?R?RR\((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR??s

cCsdS(N((RR?((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR?sN(	R3R4RRvR?R+R?R?R?(((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR??s			tGenericASTMatchercBsAeZd?Zd?Zd?Zd?Zdd?Zd?ZRS(cCstj||?||_dS(N(R9RR?(RR@R?((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyRscCsJ|d?}|\}}t|?}|j?|t|?f||?fS(NcSs
||d?S(NcSs|j||?S(N(t
foundMatch(RgR\R((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyRhs((R\R((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyRhs(RntreverseR_(RR[R\R?RcRdtrhslist((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR]s

cCs||d?|dS(Ni????((RRgR\((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR?scCs?|jjd|?d}xG|D]?}|dkrH|jjdd?n|d}|j|?q W|dkr?|jjdd?ndS(Nit(it)(tinputtinserttmatch_r(RR?R?tchild((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR? s

cCsB|dkr|j}ng|_|j|?|j|j?dS(N(R+R?R?R?R|(RR?((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR*-s
	
cCs|dS(Ni????((RRn((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR?5sN(	R3R4RR]R?R?R+R*R?(((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyR?
s		
		
cCs?x?tt|??D]?}dG|GHxv||D]j}dG|GHxX||djD]E\\}}}dG|GdGtj|| ?GdGtj||?GHqNWq-W|t|?krHdGt||?GHHqqWdS(NR?s	is		s::=t.Ru(R-R)RR#R$tstr(RlRzRJR1R?RcRdR'((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyt_dump;s		$(
t__version__RtsysR#R
RR5R9R?R?R?R?R?(((s0/Users/fwierzbicki/hg/jython/jython/ast/spark.pyts	1??P&9.




© 2015 - 2025 Weber Informatics LLC | Privacy Policy