]Mc @sddlmZdddddddd d f Zd Zd Zd ZdZdZdZeZ dZ dZ dZ dZ dZddlZddlZddlZddlZejdZi dd6dd6dd6dd6d d!6d"d#6d$d%6d&d'6d(d)6Zd*Zd+efd,YZd-efd.YZed/krddljZejZddlZe ej!d0Z"e"j#Z$eeZ%e%j&e$ej!d0x/e're%j(Z)e) rPne%j*e)fGHqWndS(1i(t generatorstCPP_IDt CPP_INTEGERt CPP_FLOATt CPP_STRINGtCPP_CHARtCPP_WSt CPP_COMMENTt CPP_POUNDt CPP_DPOUNDs+-*/%|&~^<>=!?()[]{}.,;:\'"cCs"|jj|jjd7_|S(s\s+s (tlexertlinenotvaluetcount(tt((s+/usr/lib/python2.7/site-packages/ply/cpp.pytt_CPP_WSss\#s\#\#s[A-Za-z_][\w_]*cCs|S(sA(((((0x)|(0X))[0-9a-fA-F]+)|(\d+))([uU]|[lL]|[uU][lL]|[lL][uU])?)((R((s+/usr/lib/python2.7/site-packages/ply/cpp.pyR$ss?((\d+)(\.\d+)(e(\+|-)?(\d+))? | (\d+)e(\+|-)?(\d+))([lL]|[fF])?cCs"|jj|jjd7_|S(s\"([^\\\n]|(\\(.|\n)))*?\"s (R R R R (R((s+/usr/lib/python2.7/site-packages/ply/cpp.pyt t_CPP_STRING.scCs"|jj|jjd7_|S(s(L)?\'([^\\\n]|(\\(.|\n)))*?\'s (R R R R (R((s+/usr/lib/python2.7/site-packages/ply/cpp.pyt t_CPP_CHAR4scCs"|jj|jjd7_|S(s(/\*(.|\n)*?\*/)|(//.*?\n)s (R R R R (R((s+/usr/lib/python2.7/site-packages/ply/cpp.pyt t_CPP_COMMENT:scCs4|jd|_|jd|_|jjd|S(Nii(R ttypeR tskip(R((s+/usr/lib/python2.7/site-packages/ply/cpp.pytt_error?sNs\?\?[=/\'\(\)\!<>\-]t#t=s\t/t^t't[t(t]t)t|t!t{tt~t-cCstjd|S(NcSst|jdS(Ni(t _trigraph_reptgroup(tg((s+/usr/lib/python2.7/site-packages/ply/cpp.pytis(t _trigraph_pattsub(tinput((s+/usr/lib/python2.7/site-packages/ply/cpp.pyttrigraphhstMacrocBseZdedZRS(cCsG||_||_||_||_|r:|d|_nd|_dS(Ni(tnameR targlisttvariadictvarargtNonetsource(tselfR0R R1R2((s+/usr/lib/python2.7/site-packages/ply/cpp.pyt__init__|s    N(t__name__t __module__R4tFalseR7(((s+/usr/lib/python2.7/site-packages/ply/cpp.pyR/{st PreprocessorcBseZddZdZdZdZdZdZdZ dZ dZ d Z dd Z d Zdd Zd ZdZdZdidZdZRS(cCs|dkrtj}n||_i|_g|_g|_|jtj}|j dtj d||j dtj d|d|_ dS(Ns __DATE__ "%s"s%b %d %Ys __TIME__ "%s"s%H:%M:%S( R4tlexR tmacrostpatht temp_pathtlexprobettimet localtimetdefinetstrftimetparser(R6R ttm((s+/usr/lib/python2.7/site-packages/ply/cpp.pyR7s        cCsMg}|jj|x0trH|jj}|s8Pn|j|qW|S(N(R R-tTruettokentappend(R6ttextttokensttok((s+/usr/lib/python2.7/site-packages/ply/cpp.pyttokenizes cCsd|||fGHdS(Ns%s:%d %s((R6tfiletlinetmsg((s+/usr/lib/python2.7/site-packages/ply/cpp.pyterrorscCs|jjd|jj}| s5|jdkr=dGHn |j|_|jjd|jj}| st|jdkrdGHn|j|_t|j|_|jjd|jj}| s|jdkrdGHn |j|_ |jjd|jj}| s(|jdkr4d|_ n |j|_ |jjd |jj}| su|jd krd|_ d GHn |j|_ |j |j f|_ d d d ddddddg }xO|D]G}|jj||jj}| s |j|krd|GHqqWdS(Nt identifiers"Couldn't determine identifier typet12345i90sCouldn't determine integer types "filename"sCouldn't determine string types s s%Couldn't determine token for newlinesR"R$Rs##s\RRt,t.s,Unable to lex '%s' required for preprocessor(R R-RHR Rtt_IDtintt t_INTEGERtt_INTEGER_TYPEtt_STRINGR4tt_SPACEt t_NEWLINEtt_WS(R6RLtcharstc((s+/usr/lib/python2.7/site-packages/ply/cpp.pyR@sD       ! cCs|jj|dS(N(R>RI(R6R>((s+/usr/lib/python2.7/site-packages/ply/cpp.pytadd_pathsc csQ|jj}g|jD]}|j^q}x~tt|D]j}|d}xW||jdr|t|kr||d |||||j }|sPn|j ||j |jkrd|jkr|Vg}qqW|rM|VndS(Nis\its (R tclonet splitlinestrstriptxrangetlentendswithtjoinR-R RGRHRIRR]R ( R6R-R<txtlinestitjt current_lineRL((s+/usr/lib/python2.7/site-packages/ply/cpp.pyt group_liness,% (      ! cCsd}x6|t|kr>||j|jkr>|d7}q W||4t|d}x0|dkr||j|jkr|d8}qYW||d3|S(Nii(RfRR](R6RKRk((s+/usr/lib/python2.7/site-packages/ply/cpp.pyt tokenstrip's+% c Csg}g}g}d}t|}d}x0||kr\||j|jkr\|d7}q-W||kr||jdkr|j|dn*|j|j|djddggfS|d7}x||kr||}|jdkr|j||d7}n|jdkrx|d8}|dkrh|rW|j|j||j|n|d||fS|j|nX|jdkr|dkr|j|j||j|dg}n |j||d7}qW|j|j|djddggfS( NiiRsMissing '(' in macro argumentsRRTisMissing ')' in macro arguments( RfRR]R RIRQR5R Ro( R6t tokenlisttargst positionst current_argtnestingttokenlenRkR((s+/usr/lib/python2.7/site-packages/ply/cpp.pyt collect_argsCsD %         c Csg|_g|_g|_d}xv|t|jkr|j|j|jkr|j|j|jkr|jj|j|j}|dkr |j|djdkr t j |j||j|<|j |j|_|j|d=|jj ||dfq$q|dkrb|j|djdkrb|jj d||df|j|d=q$q|dt|jkr|j|djdkr|jj d||f|d7}q$q|jj d||fn|j|jdkr|j r|dkr|j|djdkr|dt|jkr|j|dj|jkr|j|dj|j kr|jj |dqn|d7}q$W|jjdd d tdS( NiiRs##R_teRTtkeycSs|dS(Ni((Ri((s+/usr/lib/python2.7/site-packages/ply/cpp.pyR*streverse(tpatcht str_patchtvar_comma_patchRfR RRVR1tindextcopyRZRIR2R3tsortRG(R6tmacroRktargnum((s+/usr/lib/python2.7/site-packages/ply/cpp.pyt macro_prescanxs:   2&&3 /6c Csg|jD]}tj|^q }i}x|jD]\}}||krddjg||D]}|j^qajdd||t}t}qGt}q}q| dkr|r|ddr|ryt}q|s|j|}|rt}t}qqqq}|j|j| djdq| dkr6|r|ddr3|rt}q|st}t}qq3q}|j|j| djdq| dkr|r]|j\}}q}|j|j| djdqqc|rc|j| qcqcWx|j |D] } | VqWg}dS(NRas __FILE__ "%s"Rs iiRCtincludet__FILE__tundeftifdeftifndeftiftelifisMisplaced #eliftelsesMisplaced #elsetendifsMisplaced #endif(R.RnRCR5RGR:RRR]R RIRoRR=RRRRQR tpoptextend(R6R-R5RRjtchunktenablet iftriggertifstackRiRkRLt dirtokensR0RqtoldfileR((s+/usr/lib/python2.7/site-packages/ply/cpp.pytparsegenRs                                 c cs|s dS|r=|djdkrK|dj|jkrK|j|}n|djdkrd}x@|t|kr||jdkrPn|d7}qgWdGHdSdjg|d|!D]}|j^q}|jdg|j}q=|dj|jkr1|djdd!}|jdg|j}q=dGHdSnx|D]}tjj||}y}t |d j }tjj |} | r|jj d| nx|j ||D] } | VqW| r|jd=nPWqDtk rqDXqDWd |GHdS( NiR"iR$sMalformed #include <...>RaisMalformed #include statementRsCouldn't find '%s'(R RRZRRfRhR>R?tostopentreadtdirnametinsertRtIOError( R6RKRkRitfilenameR>tptinametdatatdnameRL((s+/usr/lib/python2.7/site-packages/ply/cpp.pyRsF),    cCskt|ttfr'|j|}n|}y!|d}t|dkrY|d}nd}|st|jg}||j|j s\!