Ñò rê$Lc@s³dZdZddkZddkZddkZhdddddf6d d d d f6d ddf6ddf6ddf6ZhaxDeiƒD]6\Z Z ei e ƒZ xe D]Z e te }stkeycCs t|ƒS((tlen(ta((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyR…streversesdefined\s+(\w+)s"\1" in __dict__sdefined\s*\((\w+)\)s/\*.*\*/s/\*.*s//.*s(0x[0-9A-Fa-f]*)[UL]+s\1icCs?tit|ƒ}x&tD]\}}|i||ƒ}qW|S(so Converts a C pre-processor expression into an equivalent Python expression that can be evaluated. (tCPP_to_Python_Ops_ExpressiontsubtCPP_to_Python_Ops_SubtCPP_to_Python_Eval_List(tstexprtrepl((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyt CPP_to_PythonŸs  tFunctionEvaluatorcBs eZdZd„Zd„ZRS(s@ Handles delayed evaluation of a #define function call. cCsQ||_ti|ƒ|_y|idƒ}Wntj onX||_dS(s¶ Squirrels away the arguments and expansion value of a #define macro function for later evaluation when we must actually expand a value that uses it. s##N(tnametfunction_arg_separatortsplittargstAttributeErrort expansion(tselfR!R$R&((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyt__init__µs cGsÏt|iƒt|ƒjotd|iƒ‚nh}x*t|i|ƒD]\}}||||iD]3}||ijot|ƒ}n|i|ƒqvWdi|ƒ}t |t ƒ|ƒS(so Evaluates the expansion of a #define macro function called with the specified values. s%Incorrect number of arguments to `%s's + ( RR$t ValueErrorR!tzipR&treprtappendtjointevaltglobals(R'tvaluestlocalstktvtpartsRt statement((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyt__call__Âs  (t__name__t __module__t__doc__R(R6(((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyR ±s s\\ ? s(\S+)\(([^)]*)\)s,\s*t PreProcessorcBs(eZdZeidhdd„Zd„Zd„Zdd„Z d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „Zd„Zdd„Zdd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZeZ d„Z!d„Z"RS( sA The main workhorse class for handling C pre-processing. icCs²t|ƒ}h|f|d6||fd6|_|iƒ|_|i|id<|o|i|_nh|id6}x+tiƒD]}t |d|ƒ||tTabletkeystgetattrt default_table(R'tcurrenttcpppathtdicttalltdtop((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyR(îs    cCsftid|ƒ}ti|ƒ}g}|D]3}||dft|di|dƒiƒq,~S(s‰ Turns the contents of a file into a list of easily-processed tuples describing the CPP lines in the file. The first element of each tuple is the line's preprocessor directive (#if, #include, #define, etc., minus the initial '#'). The remaining elements are specific to the type of directive, as pulled apart by the regular expression. Rii(tline_continuationsRtCPP_ExpressiontfindallRFtmatchtgroups(R'tcontentst cpp_tuplest_[1]R((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyttupleizes cCs"||_|i|i|ƒ|ƒS(sU Pre-processes a file. This is the main public entry point. (t current_filetprocess_contentst read_file(R'tfile((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyR6"s cCs‰g|_|iiƒ|_||_|i|ƒ|_|i|ƒx6|io+|iidƒ}|i|d|ƒqFW|i |ƒS(s` Pre-processes a file contents. This is the main internal entry point. i( tstackRIRBtdispatch_tableRYRXttuplestinitialize_resulttpoptfinalize_result(R'RUtfnamett((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyRZ+s    cCs)|ii|iƒ|iiƒ|_dS(s† Pushes the current dispatch table on the stack and re-initializes the current dispatch table to the default. N(R]R,R^RIRB(R'((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pytsaveAscCs0y|iiƒ|_Wntj onXdS(sf Pops the previous dispatch table off the stack and makes it the current one. N(R]RaR^t IndexError(R'((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pytrestoreIscCsdS(s Null method for when we explicitly want the action for a specific preprocessor directive to do nothing. N((R'Rd((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyt do_nothingSscCs|d|_dS(Ni(RY(R'Rd((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyR>ZscCsNtdi|dƒƒ}yt||iƒSWnttfj odSXdS(s× Evaluates a C preprocessor expression. This is done by converting it to a Python equivalent and eval()ing it in the C preprocessor namespace we use to track #define values. t iiN(RR-R.RCt NameErrort TypeError(R'Rd((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyteval_expression]s cCs|g|_dS(N(tresult(R'Rc((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyR`iscCs |idS(Ni(Rm(R'Rc((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyRblscCsq|d}x`|i|dD]M}|tijo |}ntii||ƒ}tii|ƒo|SqWdS(sI Finds the #include file for a given preprocessor tuple. iiN(RAtostcurdirtpathR-tisfiletNone(R'RdRcRNtf((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pytfind_include_fileos   cCst|ƒiƒS(N(topentread(R'R\((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyR[}scCs4|i}|i|d<|i|d<|i|dN(tresolve_includeRtRmR,R[RXRYR_(R'Rdt include_fileRUt new_tuples((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyREùscCsÌ|d}x£|ddjo‘y|i|}Wnmtj oati|ƒ}|i|idƒ}t|ƒo(ti|idƒƒ}||Œ}qŸnX|pdSq W|d|d|dd!fS(sResolve a tuple-ized #include line. This handles recursive expansion of values without "" or <> surrounding the name until an initial " or < is found, to handle #include FILE where FILE is a #define somewhere else. iis<"iiÿÿÿÿN( RCR†t function_nametsearchRtcallableR"R#Rr(R'RdRRR$((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyRˆs   cCs|ii|i|ƒƒdS(s N(RmR,Rˆ(R'Rd((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyRD2s(N(#R7R8R9RnRoR(RXR6RrRZReRgRhR>RlR`RbRtR[RxRyR|R}R~RRzR€RR…R‡RwREtdo_include_nextRˆRD(((s,install/lib/scons-2.0.0.final.0/SCons/cpp.pyR:ês<%                      tDumbPreProcessorcBseZdZd„ZRS(s“A preprocessor that ignores all #if/#elif/#else/#endif directives and just reports back *all* of the #include files (like the classic SCons scanner did). This is functionally equivalent to using a regular expression to find all of the #include lines, only slower. It exists mainly as an example of how the main PreProcessor class can be sub-classed to tailor its behavior. cOsXti|||Ž|i}x5ddddddgD]}|i||<||st        3  !      ,ÿN