Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Parsing code under inactive #if or #ifdef

As Mike, Chris and Gerhard mentioned there is no easy solution to that.
As a minimum you need the cooperation of the preprocessor with the
syntax-parsers and also the name-resolution.
I do have some ideas on how we can start working on this, which I plan
to discuss on the cdt-summit in a few weeks. There are chances that we
can come up with an Outline View that handles inactive code in CDT 5.1
next year, but that is not decided, yet.

Markus.  

> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Dmitry Smirnov
> Sent: Thursday, September 11, 2008 2:59 PM
> To: cdt-dev@xxxxxxxxxxx
> Subject: [cdt-dev] Parsing code under inactive #if or #ifdef
> Importance: Low
> 
> Hi,
> 
> I'm trying to use AST/PDOM for parsing a project in goal to 
> build browsable view of the code (outside of Eclipse, some 
> set of WEB pages).
> 
> For this purpose I would like to have inactive code to be parsed too.
> As I can see, now this is prevented by CPreprocessor class. Method
> executeIfdef() and other similar methods call 
> skipOverConditionalCode().
> 
> I would like to propose some enchancement for this. I believe 
> some scanner options could be added that changes default 
> behaviour. If this option is active, CPreprocessor will not call
> skipOverConditionalCode() thus making parser to handle all the code.
> 
> I suppose, some methods should also be changed (like values 
> of macro defined inside active/inactive branches).
> 
> What do you think about such feature? Perhaps, CDT already 
> have some plans for similar enchancement?
> 
> I'm going to test this approach with CDT 5.0. If you have 
> some thoughts that could help me with it, please let me know.
> 
> Dmitry
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 


Back to the top