Ñò §ÚêLc @sdZddkZddkZddklZyddklZWn#ej oddklZnXddgZ dd d„ƒYZ e e d„Z ed joveeiƒd jo e ƒZn#eid Ze eeƒeƒZx.eiƒZeod eeƒGHqëPqëndS( s8A lexical analyzer class for simple shell-like syntaxes.iÿÿÿÿN(tdeque(tStringIOtshlextsplitcBszeZdZd d ed„Zd„Zd d„Zd„Zd„Z d„Z d„Z d d d„Z d „Z d „ZRS( s8A lexical analyzer class for simple shell-like syntaxes.cCsFt|tƒot|ƒ}n|dj o||_||_nti|_d|_||_|o d|_ n d|_ d|_ d|_ |io|i d7_ nd|_ t |_d|_d|_d|_d |_tƒ|_d |_d |_d|_tƒ|_d|_|iod |i|ifGHndS( Ntt#t?abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_s>ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞs s'"s\t"t iisshlex: reading from %s, line %d(t isinstancet basestringRtNonetinstreamtinfiletsyststdintposixteoft commenterst wordcharst whitespacetFalsetwhitespace_splittquotestescapet escapedquoteststateRtpushbacktlinenotdebugttokent filestacktsource(tselfR R R((s/usr/lib64/python2.6/shlex.pyt__init__s<                        cCs7|idjodt|ƒGHn|ii|ƒdS(s:Push a token onto the stack popped by the get_token methodisshlex: pushing token N(RtreprRt appendleft(R!ttok((s/usr/lib64/python2.6/shlex.pyt push_token;scCsžt|tƒot|ƒ}n|ii|i|i|ifƒ||_||_d|_|io3|dj od|ifGHqšd|ifGHndS(s9Push an input source onto the lexer's input source stack.isshlex: pushing to file %ssshlex: pushing to stream %sN( R R RRR$R R RRR (R!t newstreamtnewfile((s/usr/lib64/python2.6/shlex.pyt push_sourceAs"     cCs^|iiƒ|iiƒ\|_|_|_|iod|i|ifGHnd|_dS(sPop the input source stack.sshlex: popping to %s, line %dRN(R tcloseRtpopleftR RRR(R!((s/usr/lib64/python2.6/shlex.pyt pop_sourceOs  ! cCsA|io7|iiƒ}|idjodt|ƒGHn|S|iƒ}|idj odxa||ijoL|i|iƒƒ}|o |\}}|i||ƒn|i ƒ}q`Wnx=||i jo,|i p|i S|i ƒ|i ƒ}qÄW|idjo,||i jodt|ƒGHq=dGHn|S(sBGet a token from the input stream (or from stack if it's nonempty)isshlex: popping token s shlex: token=sshlex: token=EOFN( RR+RR#t read_tokenR R t sourcehookR)t get_tokenRRR,(R!R%trawtspecR(R'((s/usr/lib64/python2.6/shlex.pyR/Xs2      cCsÕt}d}xTtoL|iidƒ}|djo|id|_n|idjo$dGt|iƒGdGt|ƒGHn|idjod|_ Pq|idjom|pd|_Pq^||i jo@|idjo d GHn|i p|i o |oPqqq^||i jo!|ii ƒ|id|_q^|i o#||ijod }||_q^||ijo||_ d |_q^||ijo$|i p ||_ n||_q^|io||_ d |_q^||_ |i p|i o |oPq^qq|i|ijoÏt}|p&|idjo d GHntd ‚n||ijo5|i p|i ||_ d|_Pqöd |_q^|i o9||ijo)|i|ijo|i}||_q^|i ||_ q|i|ijoŽ|p&|idjo d GHntd‚n||ijo4||ijo$||jo|i |i|_ n|i ||_ ||_q|id jo³|pd|_Pq^||i joI|idjo dGHnd|_|i p|i o |oPqZqq^||i jo[|ii ƒ|id|_|i o0d|_|i p|i o |oPq€qqZq^|i o||ijo ||_q^|i o#||ijod }||_q^||ijp||ijp |io|i ||_ q^|ii|ƒ|idjo dGHnd|_|i oPq^qqqW|i }d|_ |i o| o|djo d}n|idjo#|odt|ƒGHqÑdGHn|S(NRis isshlex: in statesI see character:Ris+shlex: I see whitespace in whitespace statetas shlex: I see EOF in quotes statesNo closing quotations shlex: I see EOF in escape statesNo escaped characters%shlex: I see whitespace in word states&shlex: I see punctuation in word statesshlex: raw token=sshlex: raw token=EOF(RtTrueR treadRRR#RR RRRRtreadlineRRRRt ValueErrorRRR$(R!tquotedt escapedstatetnextchartresult((s/usr/lib64/python2.6/shlex.pyR-xsâ                                            cCs„|ddjo|dd!}nt|itƒo<tii|ƒ o(tiitii|iƒ|ƒ}n|t|dƒfS(s(Hook called on a filename to be sourced.iRiiÿÿÿÿtr( R R R tostpathtisabstjointdirnametopen(R!R(((s/usr/lib64/python2.6/shlex.pyR.øs '(cCsB|djo |i}n|djo |i}nd||fS(s<Emit a C-compiler-like, Emacs-friendly error-message leader.s"%s", line %d: N(R R R(R!R R((s/usr/lib64/python2.6/shlex.pyt error_leaders     cCs|S(N((R!((s/usr/lib64/python2.6/shlex.pyt__iter__ scCs*|iƒ}||ijo t‚n|S(N(R/Rt StopIteration(R!R((s/usr/lib64/python2.6/shlex.pytnext s  N(t__name__t __module__t__doc__R RR"R&R)R,R/R-R.RBRCRE(((s/usr/lib64/python2.6/shlex.pyRs$   €  cCs9t|d|ƒ}t|_|p d|_nt|ƒS(NRR(RR3RRtlist(tstcommentsRtlex((s/usr/lib64/python2.6/shlex.pyRs   t__main__isToken: ((RHtos.pathR<Rt collectionsRt cStringIORt ImportErrort__all__RRR3RRFtlentargvtlexertfileRAR/tttR#(((s/usr/lib64/python2.6/shlex.pyts(   ý