ó {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(RdttodoR,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)Rgs %s -> %d(RhR%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(tTruetFalseRhtrangeRt unifystate(RR-tchangesR,tstate_iRjtstate_jR.((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRWäs     cCs±|jƒ\}}|jdkr+||fStƒ}tƒ}|j|ƒ|j|ƒxI|jdkr¢|jƒ|jƒ\}}|j|ƒ|j|ƒqZW||fSdS(Nt|(t parse_altRER_RcR(RRXRYtaatzz((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRUùs       cCsr|jƒ\}}xS|jdks?|jtjtjfkrg|jƒ\}}|j|ƒ|}qW||fS(Nt(t[(RxRy(t parse_itemRERPRRBtSTRINGRc(RRXtbR)td((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRu s  cCsÁ|jdkrU|jƒ|jƒ\}}|jtjdƒ|j|ƒ||fS|jƒ\}}|j}|dkr†||fS|jƒ|j|ƒ|dkr³||fS||fSdS(NRyt]t+t*(RR€(RERRURSRRTRct parse_atom(RRXRYRE((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRzs          cCs¹|jdkrH|jƒ|jƒ\}}|jtjdƒ||fS|jtjtjfkrœt ƒ}t ƒ}|j ||jƒ|jƒ||fS|j d|j|jƒdS(NRxt)s+expected (...) or NAME or STRING, got %s/%s( RERRURSRRTRPRBR{R_Rct raise_error(RRXRY((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyR(s       cCsc|j|ks*|dk rL|j|krL|jd|||j|jƒn|j}|jƒ|S(Nsexpected %s/%s, got %s/%s(RPRRERƒR(RRPRE((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRS9s *   cCsi|jjƒ}x/|dtjtjfkr@|jjƒ}qW|\|_|_|_|_|_ dS(Ni( RR0RtCOMMENTtNLRPREtbegintendtline(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#RRFRRVRkRlRWRURuRzRRSRRƒ(((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyR s$   .    $        R_cBseZd„Zdd„ZRS(cCs g|_dS(N(R (R((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRSscCsP|dks!t|tƒs!t‚t|tƒs6t‚|jj||fƒdS(N(RR:RR=R_R R"(RR0R/((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyRcVs!N(RRRRRc(((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyR_Qs R`cBs2eZd„Zd„Zd„Zd„ZdZRS(cCspt|tƒst‚tt|ƒjƒtƒs6t‚t|tƒsKt‚||_||k|_i|_dS(N( R:tdictR=titerR0R_RaR%R (RRatfinal((s*/usr/lib64/python2.7/lib2to3/pgen2/pgen.pyR]s ! cCsPt|tƒst‚||jks*t‚t|tƒs?t‚||j|s ÿH %