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

ast.asdl.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@sqdZddlZddlZddlZdefd??YZdefd??YZdefd??YZd	efd
??YZ	dej
efd??YZd
ejefd??YZ
d/Zdefd??YZdefd??YZdefd??YZdefd??YZdefd??YZdefd??YZd efd!??YZd"efd#??YZd$efd%??YZd&?Zd'?Zed(krmddlZddlZeej?d)kr?ejd)Znd*Z eje d+?ZxpeD]eZ!e!GHee!?Z"d,Ge"j#GHee"j$?Gd-GHee"?sJd.GHqxe"j$D]Z%e%j&GHqTWqWndS(0syAn implementation of the Zephyr Abstract Syntax Definition Language.

See http://asdl.sourceforge.net/ and
http://www.cs.princeton.edu/~danwang/Papers/dsl97/dsl97-abstract.html.

Only supports top level module decl, not view.  I'm guessing that view
is intended to support the browser and I'm not interested in the
browser.

Changes for Python: Add support for module versions
i????NtTokencBs#eZd?Zd?Zd?ZRS(cCs||_||_dS(N(ttypetlineno(tselfRR((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt__init__s	cCs|jS(N(R(R((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt__str__scCs
t|?S(N(tstr(R((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt__repr__s(t__name__t
__module__RRR(((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyRs		tIdcBseZd?Zd?ZRS(cCsd|_||_||_dS(NR
(RtvalueR(RRR((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyR s		cCs|jS(N(R(R((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyR%s(RR	RR(((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyR
s	tStringcBseZd?ZRS(cCsd|_||_||_dS(NR(RRR(RRR((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyR)s		(RR	R(((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyR(stASDLSyntaxErrorcBs eZddd?Zd?ZRS(cCs||_||_||_dS(N(Rttokentmsg(RRRR((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyR0s		cCs;|jdkr#d|j|jfSd|j|jfSdS(NsError at '%s', line %ds%s, line %d(RtNoneRR(R((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyR5sN(RR	RRR(((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyR
.stASDLScannercBsYeZd?Zd?Zd?Zd?Zd?Zd?Zd?Zd?Z	d?Z
RS(	cCs/g|_d|_tt|?j|?|jS(Ni(trvRtsuperRttokenize(Rtinput((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyR=s		cCs |jjt||j??dS(s[\w\.]+N(RtappendR
R(Rts((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytt_idCscCs |jjt||j??dS(s"[^"]*"N(RRRR(RR((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytt_stringIscCs |jjt||j??dS(s<=N(RRRR(RR((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytt_xxxMscCs |jjt||j??dS(s[\{\}\*\=\|\(\)\,\?\:]N(RRRR(RR((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt
t_punctuationQscCsdS(s
\-\-[^\n]*N((RR((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt	t_commentUscCs|jd7_dS(s\niN(R(RR((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt	t_newlineYscCsdS(s[ \t]+N((RR((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytt_whitespace]scCstd|
?dS(s . +sunmatched input: %sN(t
ValueError(RR((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt	t_defaultas(RR	RRRRRRRRR (((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyR;s								t
ASDLParsercBs?eZd?Zd?Zd?Zd?Zd?Zd?Zd?Zd?Z	d?Z
d	?Zd
?Zd?Z
d?Zd
?Zd?Zd?Zd?Zd?Zd?Zd?Zd?Zd?Zd?Zd?Zd?Zd?ZRS(cCstt|?jd?dS(Ntmodule(RR!R(R((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyRfscCs|jS(N(R(Rttok((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt
typestringiscCst|j|??dS(N(R
R(RR#((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyterrorlscCsP|\}}}}}|jdkr@t|jdd|??nt|d|?S(s module ::= Id Id version { } R"Rsexpected 'module', found %sN(RR
RtModuleR(Rt.1R"tnametversiont_0t_1((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt
p_module_0os
cCsS|\}}}}}}|jdkrCt|jdd|??nt|||?S(s* module ::= Id Id version { definitions } R"Rsexpected 'module', found %s(RR
RR&(RR'R"R(R)R*tdefinitionsR+((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytp_modulevs
cCs;|\}}|jdkr7t|jdd|??n|S(sversion ::= Id StringR)Rsexpected 'version', found %(RR
R(RR'R)tV((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt	p_version}s
	cCs
|\}|S(s definitions ::= definition ((RR't
definition((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytp_definition_0?scCs|\}}||S(s( definitions ::= definition definitions ((RR'R-R1((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytp_definition_1?s	cCs|\}}}t||?gS(s definition ::= Id = type (tType(RR'tidt_R((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytp_definition?scCs
|\}|S(s type ::= product ((RR'tproduct((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytp_type_0?scCs|\}t|?S(s type ::= sum (tSum(RR'tsum((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytp_type_1?scCs`|\}}}}}|jdkr@t|jdd|??n|rS|j?nt||?S(s type ::= sum Id ( fields ) t
attributesRsexpected attributes, found %s(RR
RtreverseR:(RR'R;R5R*R=R+((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytp_type_2?s
cCs#|\}}}|j?t|?S(s product ::= ( fields ) (R>tProduct(RR'R*tfieldsR+((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt	p_product?s
cCs|\}|gS(s sum ::= constructor ((RR'tconstructor((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytp_sum_0?scCs|\}}}|g|S(s sum ::= constructor | sum ((RR'RCR6R;((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytp_sum_1?scCs|\}}}|g|S(s sum ::= constructor | sum ((RR'RCR6R;((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytp_sum_2?scCs|\}t|?S(s constructor ::= Id (tConstructor(RR'R5((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytp_constructor_0?scCs)|\}}}}|j?t||?S(s constructor ::= Id ( fields ) (R>RG(RR'R5R*RAR+((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pytp_constructor_1?s
cCs|\}|gS(s fields ::= field ((RR'tfield((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt
p_fields_0?scCs|\}}}||gS(s fields ::= field , fields ((RR'RJR6RA((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt
p_fields_1?scCs|\}t|?S(s field ::= Id (tField(RR'R((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt	p_field_0?scCs|\}}t||?S(s field ::= Id Id (RM(RR'RR(((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt	p_field_1?s	cCs"|\}}}t||dt?S(s field ::= Id * Id tseq(RMtTrue(RR'RR6R(((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt	p_field_2?scCs"|\}}}t||dt?S(s field ::= Id ? Id topt(RMRQ(RR'RR6R(((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt	p_field_3?scCs|\}}t|dt?S(s field ::= Id * RP(RMRQ(RR'RR6((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt	p_field_4?s	cCs|\}}t|dt?S(s field ::= Id ? RS(RMRQ(RR'RR6((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyt	p_field_5?s	(RR	RR$R%R,R.R0R2R3R7R9R<R?RBRDRERFRHRIRKRLRNRORRRTRURV(((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyR!es4																										t
identifiertstringtinttbooltobjecttASTcBseZRS((RR	(((s//Users/fwierzbicki/hg/jython/jython/ast/asdl.pyR\?sR&cBseZd?Zd?ZRS(cCsO||_||_||_i|_x$|D]}|j|j|jjsJ
	
*x"(		






© 2015 - 2024 Weber Informatics LLC | Privacy Policy