[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Acquire the body of preprocessor #if()/#elseif() statements

Hi together,

my name is Markus and I am currently working at a solution which can find the elements inside of a preprocessor #if() body. 
Here a small sample what I mean:
void foo(void){
     #if(x) {
        int a;
     }
     #else ......  
}

With this part of code in the code completion list of the cdt editor the element "a" isn't listed. Important to know is that the element "x" has in my scope of the project no value. So it isn't possible for the parser/preprocessor to know if the _expression_ is true or false and will add the elements of the #else part to the ast. As I can get all preprocessor statements from the IASTTranslationUnit I think there should be a way to acquire also the body of such preprocessor #if statements with unknown _expression_ result, isn't it. And that is the point for my idea. If I can get out the preprocessor #if body of the cdt everything would be fine. 
Is there a possibility to get this skiped part? 

Thanks in advance for all your support!!!!

Cheers,
Markus