ó {fc@s‡ddlmZmZmZdejfd„ƒYZdefd„ƒYZdefd„ƒYZdefd „ƒYZ d d „Z d S( i(tgrammarttokenttokenizet PgenGrammarcBseZRS((t__name__t __module__(((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRstParserGeneratorcBs°eZdd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „Zd „Zd „Zd„Zdd„Zd„Zd„ZRS(cCs d}|dkr*t|ƒ}|j}n||_||_tj|jƒ|_|j ƒ|j ƒ\|_ |_ |dk r‰|ƒni|_ |jƒdS(N(tNonetopentclosetfilenametstreamRtgenerate_tokenstreadlinet generatortgettokentparsetdfast startsymboltfirstt addfirstsets(tselfR R t close_stream((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyt__init__ s         c CsŽtƒ}|jjƒ}|jƒ|j|jƒ|jd|jƒx;|D]3}dt|jƒ}||j|<||j | %ds %s -> %d(t enumerateR R$RR"R( RR+R(R\ttodoR,R.R/R0tj((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pytdump_nfaÍs       cCs„dG|GHxtt|ƒD]f\}}dG|G|jr9dp<dGHx;t|jjƒƒD]$\}}d||j|ƒfGHqTWqWdS(NsDump of DFA fors States(final)R_s %s -> %d(R`R%RR R!R$(RR+R-R,R.R/R0((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pytdump_dfaÝs  "cCs¦t}x™|r¡t}x†t|ƒD]x\}}xit|dt|ƒƒD]N}||}||krH||=x|D]}|j||ƒqrWt}PqHqHWq"Wq WdS(Ni(tTruetFalseR`trangeRt unifystate(RR-tchangesR,tstate_iRbtstate_jR.((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRPäs     cCs±|jƒ\}}|jdkr+||fStƒ}tƒ}|j|ƒ|j|ƒxI|jdkr¢|jƒ|jƒ\}}|j|ƒ|j|ƒqZW||fSdS(Nt|(t parse_altR>tNFAStateR[R(RRQRRtaatzz((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRNùs       cCsr|jƒ\}}xS|jdks?|jtjtjfkrg|jƒ\}}|j|ƒ|}qW||fS(Nt(t[(RqRr(t parse_itemR>RIRR;tSTRINGR[(RRQtbR)td((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRm s  cCsÁ|jdkrU|jƒ|jƒ\}}|jtjdƒ|j|ƒ||fS|jƒ\}}|j}|dkr†||fS|jƒ|j|ƒ|dkr³||fS||fSdS(NRrt]t+t*(RxRy(R>RRNRLRRMR[t parse_atom(RRQRRR>((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRss          cCs¹|jdkrH|jƒ|jƒ\}}|jtjdƒ||fS|jtjtjfkrœt ƒ}t ƒ}|j ||jƒ|jƒ||fS|j d|j|jƒdS(NRqt)s+expected (...) or NAME or STRING, got %s/%s( R>RRNRLRRMRIR;RtRnR[t raise_error(RRQRR((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRz(s       cCsc|j|ks*|dk rL|j|krL|jd|||j|jƒn|j}|jƒ|S(Nsexpected %s/%s, got %s/%s(RIRR>R|R(RRIR>((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRL9s *   cCsi|jjƒ}x/|dtjtjfkr@|jjƒ}qW|\|_|_|_|_|_ dS(Ni( RR0RtCOMMENTtNLRIR>tbegintendtline(Rttup((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRAscGss|r@y||}Wq@dj|gtt|ƒƒ}q@Xnt||j|jd|jd|jfƒ‚dS(Nt ii(tjointmaptstrt SyntaxErrorR R€R(Rtmsgtargs((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyR|Hs&N(RRRRR1R'R#RR?RRORcRdRPRNRmRsRzRLRR|(((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyR s$   .    $        RncBseZd„Zdd„ZRS(cCs g|_dS(N(R (R((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRSscCs|jj||fƒdS(N(R R"(RR0R/((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyR[VsN(RRRRR[(((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRnQs RXcBs2eZd„Zd„Zd„Zd„ZdZRS(cCs%||_||k|_i|_dS(N(RYR%R (RRYtfinal((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyR]s cCs||j|s ÿH %