Re: [boost] [wave] found_include_directive

On 20070519, Felipe Magno de Almeida wrote:
I wanted to propose found_include_directive returning a bool. Where false would skip including the file. I need this so that I can selectively skip including files. I'm writing a dependency analysis for C++ files.
This analysis may fail unless all the files are processed... An #include file may #define something that changes how the rest of the source is processed (e.g. "#define USE_FALLBACK_LIB"). Instead, you probably want a filter which eliminates tokens based on their #include depth (obtained from context::get_iteration_depth()). This is convenient since the context is already passed to found_include_directive. To filter tokens before they are parsed, construct the context object, loop over context::begin() to end(), populate a new list with tokens of depth=0, and hand this second list to the parser. - Daniel Who learned this issue/solution from another user.
participants (1)
-
dherring@ll.mit.edu