gf \ddlZejjdkreefZneZeZdZdZ dZ dZ dZ dZ d ZeZd Zd Zd Zd ZdZdZddlZddlZddlZddlZejdZdddddddddd ZdZGddeZ GddeZ!e"d krddl#m$Z$e$j$Z%ddlZe&ej'd!Z(e()Z*e!e%Z+e+,e*ej'd! e+-Z.e.sdSe/e+j0e.*dS)"N) CPP_ID CPP_INTEGER CPP_FLOAT CPP_STRINGCPP_CHARCPP_WS CPP_COMMENT1 CPP_COMMENT2 CPP_POUND CPP_DPOUNDz+-*/%|&~^<>=!?()[]{}.,;:\'"c`|jxj|jdz c_|S)z\s+ lexerlinenovaluecountts q/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pycparser/ply/cpp.pyt_CPP_WSr'GNNagmmD)))NN Hz\#z\#\#z[A-Za-z_][\w_]*c|S)zA(((((0x)|(0X))[0-9a-fA-F]+)|(\d+))([uU][lL]|[lL][uU]|[uU]|[lL])?)rs rrr+s Hrz?((\d+)(\.\d+)(e(\+|-)?(\d+))? | (\d+)e(\+|-)?(\d+))([lL]|[fF])?c`|jxj|jdz c_|S)z\"([^\\\n]|(\\(.|\n)))*?\"rrrs r t_CPP_STRINGr5rrc`|jxj|jdz c_|S)z(L)?\'([^\\\n]|(\\(.|\n)))*?\'rrrs r t_CPP_CHARr ;rrc|jd}|jxj|z c_d|_|rd|znd|_|S)z(/\*(.|\n)*?\*/)rr  )rrrrtype)rncrs rt_CPP_COMMENT1r%AsF '--  CGNNcNN AFs!;qw Hrc"d|_d|_|S)z (//.*?(\n|$))r r)r#rrs rt_CPP_COMMENT2r'JsAFqw Hrc|jd|_|jd|_|jd|SNr)rr#rskiprs rt_errorr,Ps2 WQZAFgajAGGLLOOO Hrz\?\?[=/\'\(\)\!<>\-]#\^[]|{}~) =/'()!<>-c:td|S)NcLt|dSN) _trigraph_repgroup)gs rztrigraph..zs}QWWYYr]'Cr) _trigraph_patsub)inputs rtrigraphrJys   CCE J JJrceZdZddZdS)MacroNFcj||_||_||_||_|r |d|_d|_dSrA)namerarglistvariadicvarargsource)selfrNrrOrPs r__init__zMacro.__init__s<      &!"+DK r)NF)__name__ __module__ __qualname__rTrrrrLrLs(rrLceZdZddZdZdZdZdZdZdZ d Z d Z d Z dd Z d ZddZdZdZdZdifdZdZdS) PreprocessorNcb| tj}||_i|_g|_g|_|t j}|dt j d|z|dt j d|zd|_ dS)Nz __DATE__ "%s"z%b %d %Yz __TIME__ "%s"z%H:%M:%S) lexrmacrospath temp_pathlexprobetime localtimedefinestrftimeparser)rSrtms rrTzPreprocessor.__init__s =IE     ^   % j(D(DDEEE % j(D(DDEEE rcg}|j| |j}|sn||2|SN)rrItokenappend)rStexttokenstoks rtokenizezPreprocessor.tokenizes[  *""$$C  MM#     rc0td|||fzdS)Nz%s:%d %s)print)rSfilelinemsgs rerrorzPreprocessor.errors! jDc?*+++++rc|jd|j}|r |jdkrt dn |j|_|jd|j}|rt|jdkrt dn%|j|_t |j|_ |jd|j}|r |jdkrt dn |j|_ |jd|j}|r |jdkrd|_ n |j|_ |jd |j}|r |jd krd|_ t d n |j|_ |j |j f|_ gd }|D]T}|j||j}|r |j|krt d |zUdS) N identifierz"Couldn't determine identifier type12345i90zCouldn't determine integer typez "filename"zCouldn't determine string typez rz%Couldn't determine token for newlines) r<r=r-##r.r9r:,.z,Unable to lex '%s' required for preprocessor)rrIrhrror#t_IDint t_INTEGERt_INTEGER_TYPEt_STRINGt_SPACE t_NEWLINEt_WS)rSrlcharscs rr_zPreprocessor.lexprobesc &&&j   !ci<// 6 7 7 7 7DI !!!j   2c#)nn-- 3 4 4 4 4 XDN"&sy//D  (((j   %ci>11 2 3 3 3 3HDM j   $ci4''DLL8DL j   &ci4''!DN 9 : : : : XDN\4>2 988 J JA J  Q   *""$$C J#)q..DqHIII  J Jrc:|j|dSrg)r]ri)rSr]s radd_pathzPreprocessor.add_path s rc#K|j}d|D}tt |D]}|dz}||drg|t |krT||dd||z||<d||<|dz }||dr|t |kTd|}|j|d|_g} |j }|sn3| ||j |j vrd|j vr|Vg}E|r|VdSdS)Nc6g|]}|Sr)rstrip.0xs r z,Preprocessor.group_lines..s 888888rr*r.rBr)rclone splitlinesxrangelenendswithjoinrIrrhrir#rr)rSrIr[linesij current_linerls r group_lineszPreprocessor.group_linessj  88U%5%5%7%7888E ##  A!A(##D)) q3u::~~ 8CRC=q1aaQ(##D)) q3u::~~  %   %   "#)++C     $ $ $x49$$):):""""!  "         rc`d}|t|kr@||j|jvr,|dz }|t|kr||j|jv,|d|=t|dz }|dkr3||j|jvr|dz}|dkr||j|jv||dzd=|Sr))rr#r)rSrkrs r tokenstripzPreprocessor.tokenstrip8s #f++oo&).DI"="= FA#f++oo&).DI"="= 2A2J KKM1ff4944 FA1ff4944 1Q344L rcg}g}g}d}t|}d}||kr3||j|jvr|dz }||kr||j|jv||kr*||jdkr||dzn,||j|djddggfS|dz }||kr||}|jdkr|||dz }n|jdkrh|dz}|dkrG|r=||||||dz||fS||ni|jdkrI|dkrC|||||dzg}n|||dz }||k||j|djddggfS) Nr*rr9zMissing '(' in macro argumentsr:rxrBzMissing ')' in macro arguments) rr#rrrirsrRrr) rS tokenlistargs positions current_argnestingtokenlenrrs r collect_argszPreprocessor.collect_argsTs7  y>> 8||)A,"3ty"@"@ FA8||)A,"3ty"@"@ LLy|1S88   QqS ! ! ! ! JJt{9Q<#67W X X Xb"9  Q(ll! Aw#~~""1%%%1 C1 a<<", DOOK$@$@AAA!((+++Q3tI--""1%%%%CGqLL DOOK88999  1%%% ""1%%% FA'(ll, 4;y}34TUUU"Rxrcg|_g|_g|_d}|t|jkry|j|j|jkr|j|j|jvru|j|j|j}|dkr|j|dz jdkrjtj |j||j|<|j |j|_|j|dz =|j ||dz f|dkrF|j|dz jdkr-|j d||dz f|j|dz =N|dzt|jkr=|j|dzjdkr$|j d||f|dz }|j d||fn|j|jdkr|j r|dkr|j|dz jdkrt|dzt|jkrY|j|dzj|jkr;|j|dzj|j kr|j |dz |dz }|t|jky|jdd dS) Nrr*r-rwrerxc|dS)Nr)rs rrFz,Preprocessor.macro_prescan..s qtrT)keyreverse)patch str_patchvar_comma_patchrrr#rzrOindexcopyr~rirPrQsort)rSmacrorargnums r macro_prescanzPreprocessor.macro_prescans  " #ek""""{1~"di//EKN4HEM4Y4Y,,U[^-ABBq55U[1-3s::%)Yu{1~%>%>EKN*.-EKN' AaC(O**F1Q3<888!ee AaC 0 6$ > >K&&F1Q3'7888 AaC(sc%+....5;qs3C3IT3Q3QK&&F1~666FAK&&F1~6666Q%-->6q1uu5;qs3C3IS3P3PA#U[!1!111 AaC8H8MQUQZ8Z8ZQqS)/5<??)001555 FA7#ek""""8  ^^D99999rcJd|jD}i}|jD]x\}}||vr?ddd||Dzdd||<t j||||<||||_yd}|jr|ds|jD] }d||<d } i}|jD]U\} }}| d kr|||||d z<| d kr2||vr|||||<|||||d z<V|r d |D}|S)Nc6g|]}tj|Srrr_xs rrz2Preprocessor.macro_expand_args..s 333ty}}333rz"%s"rcg|] }|j Srrrs rrz2Preprocessor.macro_expand_args..s:Y:Y:Yq17:Y:Y:Yrr.z\\FrBTrr*rcg|]}||Srrr_is rrz2Preprocessor.macro_expand_args..s***"r*2***r) rrrreplacerrPrr expand_macros) rSrrrep str_expansionrr comma_patchexpandedptypes rmacro_expand_argszPreprocessor.macro_expand_argss33u{333  1 1IFA]**)/"'':Y:YDQWL:Y:Y:Y2Z2Z)Z(c(cdhio(p(p f%Ys1v&&CF(0CFLL > #$r( #* # #A"  %  . . E61||!&\AacE #))'+'9'9$v,'G'GHV$%f-AacE   +*****C rc |i}d}|t|kr||}|j|jkr|j|jvrO|j|vrEd||j<|j|j}|jsT|d|jD|}|D]}|j|_||||dz<|t|z }n|dz}|t|kr@||j|jvr,|dz }|t|kr||j|jv,||jdkrZ| ||d\} } } |j sit| t|jkrD| |j |jd|jt|jfz|| z}n|j rt| t|jdz krt|jdkrA| |j |jd|jt|jdz fzn@| |j |jd |jt|jdz fz|| z}n|j rt| t|jdz kr| gn]||| t|jdz z|| zdz | t|jdz <| t|jd=||| } || |} | D]} |j| _| |||| z<|t| z }||j=|jd kr+|j|_||j|_|dz }|t|k|S) NrTc6g|]}tj|Srrrs rrz.Preprocessor.expand_macros..s 0Q0Q0Q220Q0Q0Qrr*r9zMacro %s requires %d argumentsrz(Macro %s must have at least %d argumentsz'Macro %s must have at least %d argument__LINE__)rr#rzrr\rOrrrrrPrsrRrirr|r})rSrkrrrmexrrtokcountrrrrs rrzPreprocessor.expand_macross7  H #f++ooq Av""7dk))agX.E.E(,HQW% AG,A9%.!//0Q0Q0Q0Q0QRZ[[!#00A'(xAHH(*q1u SWW E#f++oo&).DI2M2MFA #f++oo&).DI2M2M!!9?c116:6G6Gqrr 6S6S3HT)#$:.#d))AI2N2N $ 4;qx@`dedklopqpylzlzc{@{ | | |$%L!".D C NN1>A#5#5$(JJt{18Dnrsry{~@A@I|J|JKL|LrMEM%N%N%N%N$(JJt{18Dmqrqxz}~H{I{IJK{KqLEL%M%M%M$%L#$:!B'*4yyC NN14D'D'D(, BAG)TWXYXaTbTbcdTdJeHefghpfpqrfrHrAsS^^A-=(>,0QY,A'+&<&.Ss 555AG 555rz&&z and z||z or r;z not zCouldn't evaluate expression)rr#rzrrr\rsrRrr|r}r enumeraterrrreval Exception)rSrkrr needparenresultrexprs revalexprzPreprocessor.evalexpr(s( #f++ooay~**vay)/K/KE! #f++ooay~22Q 4944!!9?dk99%)FF%)F(/%/C//$( C// 4;vay/?@UVVVFA!#f++oo""&q "&"5"5f"="=q 1Q3qs7O FA3#f++oo4##F++V$$ ; ;CAav"" IaLLq !%q "&"5"5d";";q 4>)) IaLLq "%fQio"6"6q Qiob)1III&,Qiocrc&:F1IOQiob)1IIIww55f55566||D))||D((||C(( $ZZFF    JJt{6!9#34R S S SFFF  s K003L&%L&c#Kt|}||}|sd}|d|z||_g}d}d}g}|D]_} t | D]\} } | j|jvrn| jdkr| D].} | j|jvrd| jvr|| /| | | dzd} | r+| dj} | | dd}nd} g}| d kr6|r3| |D]} | Vg}||| d kr\|rX| |D]} | Vg}|j d }| |D]} | V||j d <||_T| d kr7|r3| |D]} | Vg}| || d kr7|||f|r|dj|j vrd}d}d}| dkr7|||f|r|dj|j vrd}d}d} | dkr:|||f|r||}|sd}d}Gd}K| dkr^|r3|ddr#|rd}g|s||}|rd}d}||j| djd| dkrG|r|ddr |rd}|sd}d}||j| djd| dkrD|r|\}}||j| djdFH|r|| a| |D]} | Vg}dS)Nrz __FILE__ "%s"TFr-rr*rrbinclude__FILE__undefifdefifndefifelifrBzMisplaced #elifelsezMisplaced #elseendifzMisplaced #endif)rJrrbrRrr#rrrirrr\rrrrsrpopextend)rSrIrRrrchunkenable iftriggerifstackrrrl dirtokensrNroldfilers rparsegenzPreprocessor.parsegencs UOO  ## F %.///  f $f $A"1 4 4#849,,ee,yC**Cx49,,1B1B S))) OOAacddG44 $Q<-D??9QRR=99DDDD8##*#'#5#5e#<#<&&C"%IIII " D)))Y&&-#'#5#5e#<#<&&C"%IIII ""&+j"9#'<<#5#5&&C"%IIII29 J/&, W__)#'#5#5e#<#<&&C"%IIII " 4(((W__NNF9#5666-#Aw} ;;%*F(-II(,IX%%NNF9#5666-7=DK77%*F(-II(,IT\\NNF9#5666-!%t!4!4%-%*F(-II(,IV^^ V"2;q>5%5).%.5)-t)<)<#)!5.2F04I 4;y|/BCTUUUUV^^V"2;q>1%1).%.1)-,0  4;y|/BCTUUUUW__W+2;;==(yy 4;y|/BCUVVVV$LLOOO%%e,,  CIIIIrc#K|sdS|r(|djdkr+|dj|jkr||}|djdkrd}|t |kr*||jdkrn)|dz }|t |k*t ddSdd|d|D}|jdgz|jz}nP|dj|jkr)|djdd}|jdgz|jz}nt d dS|D]}tj||} t|d  }tj |}|r|j d||||D]} | V|r|jd=dS#t$rYwxYwt d |zdS) Nrr<r*r=zMalformed #include <...>rcg|] }|j Srrrs rrz(Preprocessor.include..s#A#A#AAG#A#A#ArrBzMalformed #include statementrzCouldn't find '%s')rr#r~rrrorr]r^osopenreaddirnameinsertrIOError) rSrkrfilenamer]pinamedatadnamerls rrzPreprocessor.includes=  F  ay#%%&).DM*I*I++F33ay#%%#f++ooay#--FA#f++oo 4555F77#A#AVAaC[#A#A#ABByB4'$.84=00!!9?1R40~,ty84555 3 3AGLL8,,E E#++--..3N))!E222==h77CIIII*q)     &1 2 2 2 2 2sBG G,+G,cxt|tr||}|} |d}t|dkr |d}nd}|s&t |jg}||j|j<dS|j|jvrAt |j| |dd}||j|j<dS|jdkr4| |dd\}}}d} |D]} | rtdnd d| D} | d kr)d } |j | d_d | d_d } | dd=e| d dd krW| dj|j krAd } | dd=| djd dd kr | djdd | d_t| dks| dj|j krtd n| |d|zd} d} | t| kr| dzt| krZ| | j|jvr| | dzjdkr| | =U| | jdkr| | dzj|jvr| | dz=| dz } | t| kt |j| d|D| }||||j|j<dSdSdStddS#t$rtdYdSwxYw)Nrr*rr9Fz0No more arguments may follow a variadic argumentrc6g|]}t|jSrrrs rrz'Preprocessor.define..1s #>#>#>bCMM#>#>#>rz...T __VA_ARGS__zInvalid macro argumentrwc(g|]}|djS)rrrs rrz'Preprocessor.define..Os0J0J0J10J0J0JrzBad macro definition) isinstance STRING_TYPESrmrrLrr\r#rrrrorrzr LookupError)rSrklinetokrNmtyperrrrrPaastrmvaluers rrbzPreprocessor.defines f\ * * +]]6**F9 *1:D7||a 1 .$*R((*+ DJ'''ty(($*T__WQRR[%A%ABB*+ DJ'''##,0,=,=gabbk,J,J)$  $0$0APQQQ77#>#>A#>#>#>??Du}}#'$(I! %2! #'abbE bcce++! TY0F0F#'abbEQ4:bcc?e33)*1CRCAaDJ 1vvzzQqTY$)%;%;6777&<"__WQxZ[[-ABBFAc&kk//Q3V,,%ay~::vac{?PTX?X?X$*1I (!'D!8!8VAaC[=MQUQZ=Z=Z$*1Q3KQc&kk//dj0J0JT0J0J0J8TTA&&q)))./DK +++C& ,----- * * * ( ) ) ) ) ) ) *s&A L*>*>*L!%B2222rrY__main__r*)1sys version_infomajorrunicoderrangerrkliteralsr t_CPP_POUND t_CPP_DPOUNDt_CPP_IDr t_CPP_INTEGER t_CPP_FLOATrr r%r'r,rerr`os.pathrcompilerGrCrJobjectrLrYrUply.lexr[rrargvfrrIrr rhrlrorRrrrr"s` A>LLL F  ,          Q                 & 677             KKK&F"\ \ \ \ \ 6\ \ \ | z CGIIEJJJ SXa[A FFHHE UAGGE#(1+ggiiEE ahr