[wave] comparing context states

Hi, I would like to be able to compare preprocessor state between different points / different contexts. But I can't see a way to inspect such preprocessing state (include paths, pragma's and macro definitions). This is not asking for access to implementation data, since all this information is C++ related and exists in any preprocessing step. Thanks and best regards, -- Felipe Magno de Almeida

Felipe,
I would like to be able to compare preprocessor state between different points / different contexts. But I can't see a way to inspect such preprocessing state (include paths, pragma's and macro definitions). This is not asking for access to implementation data, since all this information is C++ related and exists in any preprocessing step.
I'm not sure I understand correctly. The wave context allows you to access all the information about defined macros, current include paths etc. Is there anything missing in the API you want to access? Regards Hartmut

On 5/18/07, Hartmut Kaiser <hartmut.kaiser@gmail.com> wrote:
Felipe,
I would like to be able to compare preprocessor state between different points / different contexts. But I can't see a way to inspect such preprocessing state (include paths, pragma's and macro definitions). This is not asking for access to implementation data, since all this information is C++ related and exists in any preprocessing step.
I'm not sure I understand correctly.
The wave context allows you to access all the information about defined macros, current include paths etc. Is there anything missing in the API you want to access?
Sorry, but I'm not finding out how to do that.
Regards Hartmut
regards, -- Felipe Magno de Almeida

I would like to be able to compare preprocessor state between different points / different contexts. But I can't see a way to inspect such preprocessing state (include paths, pragma's and macro definitions). This is not asking for access to implementation data, since all this information is C++ related and exists in any preprocessing step.
I'm not sure I understand correctly.
The wave context allows you to access all the information about defined macros, current include paths etc. Is there anything missing in the API you want to access?
Sorry, but I'm not finding out how to do that.
Hmmm. Could you please a bit more specific? What type of information do you want to extract from the wave context and you're not able to find a way to do so? Regards Hartmut

On 5/19/07, Hartmut Kaiser <hartmut.kaiser@gmail.com> wrote:
[snip]
Sorry, but I'm not finding out how to do that.
Hmmm. Could you please a bit more specific? What type of information do you want to extract from the wave context and you're not able to find a way to do so?
include paths, pragma's and macro definitions
Regards Hartmut
Best regards, -- Felipe Magno de Almeida

Felipe,
Sorry, but I'm not finding out how to do that.
Hmmm. Could you please a bit more specific? What type of information do you want to extract from the wave context and you're not able to find a way to do so?
include paths, pragma's and macro definitions
Ok. - Introspecion of defined include paths is currently not available. I'll think of a possible interface. - I don't know what you want to get from introspecting #pragma's. There is no data structure in Wave collecting information about these. But what you can do is to implement the 'interpret_pragma' preporcessing hook, which get's called whenever a #pragma directive has been detected in the input stream not known to the core Wave library itself (you may want to have a look at the wave driver tool to see how it works). - Macro management is fully implemented as long as you know the name of the macro to analyse. The context object has several functions useful for that: add_macro_definition(), is_defined_macro(), get_macro_definition(), remove_macro_definition() and reset_macro_definitions(). What's missing here is a function returning all defined macros - is this something you might want to have? Regards Hartmut

On 5/20/07, Hartmut Kaiser <hartmut.kaiser@gmail.com> wrote:
Felipe,
[snip]
Ok.
- Introspecion of defined include paths is currently not available. I'll think of a possible interface.
Thanks.
- I don't know what you want to get from introspecting #pragma's. There is no data structure in Wave collecting information about these. But what you can do is to implement the 'interpret_pragma' preporcessing hook, which get's called whenever a #pragma directive has been detected in the input stream not known to the core Wave library itself (you may want to have a look at the wave driver tool to see how it works).
I've seen it. I'm not sure if pgrama's are really that important. It is just that it may be part of the preprocessor state.
- Macro management is fully implemented as long as you know the name of the macro to analyse. The context object has several functions useful for that: add_macro_definition(), is_defined_macro(), get_macro_definition(), remove_macro_definition() and reset_macro_definitions(). What's missing here is a function returning all defined macros - is this something you might want to have?
That's exactly what I want. I want to know which macros are defined in some "random" point of the preprocessing. For that I need iterators for all macro definitions.
Regards Hartmut
Best regards, -- Felipe Magno de Almeida
participants (2)
-
Felipe Magno de Almeida
-
Hartmut Kaiser