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

I am sure that this is a lot of work, and obviously solution 3 is the
way to go. Without this effort I don't think there can be any reliable
refactoring tools. If only one configuration is analyzed, and you rename
or move elements that occur in different configurations, then the code
would be broken for all other configurations.
Best regards,


	From: cdt-dev-bounces@xxxxxxxxxxx
[mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Chris Recoskie
	Sent: Donnerstag, 11. September 2008 15:18
	To: CDT General developers list.
	Subject: Re: [cdt-dev] Parsing code under inactive #if or #ifdef

	Conditional compilation is very tricky to handle properly. It is
not a matter of just letting the preprocessor output all the code from
all paths through the code as this will generally result in incorrect
code, and thus an unsuccessful parse (or at lesast, one filled with
problem bindings).
	Here is a presentation I gave at last year's summit on how we
could handle this:
	Beforewarned, doing this feature right would mean a lot of work.
I think, in retrospect, that even my large estimates that I gave in that
presentation were somewhat naive.
	Chris Recoskie
	Team Lead, IBM CDT Team
	IBM Toronto
	 "Dmitry Smirnov" <divis1969@xxxxxxxxx>

				"Dmitry Smirnov" <divis1969@xxxxxxxxx> 
				Sent by: cdt-dev-bounces@xxxxxxxxxxx 

				09/11/2008 08:58 AM 
	Please respond to
"CDT General developers list." <cdt-dev@xxxxxxxxxxx>







[cdt-dev] Parsing code under inactive #if or #ifdef	

	I'm trying to use AST/PDOM for parsing a project in goal to
	browsable view of the code (outside of Eclipse, some set of WEB
	For this purpose I would like to have inactive code to be parsed
	As I can see, now this is prevented by CPreprocessor class.
	executeIfdef() and other similar methods call
	I would like to propose some enchancement for this. I believe
	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
	I suppose, some methods should also be changed (like values of
	defined inside active/inactive branches).
	What do you think about such feature? Perhaps, CDT already have
	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.
	cdt-dev mailing list

GIF image

GIF image

Back to the top