Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » CDT parser and Preprocessor Directives(CDT doesnt parse Preprocessor Directives properly)
CDT parser and Preprocessor Directives [message #491424] Wed, 14 October 2009 10:00 Go to next message
Eclipse UserFriend
Hello all,

i have a sort of blocker with my requirement + CDT.

consider the code below

#if (SYSCONDITION1){
PARTA
}#elseif(SYSCONDITION2){
PARTB
}
and so on.

when i parse this file, i want to have both PARTA and PARTB read. so that i can take a call to delete/modify any one and serialize back.

But Currently while i parse this through CDT, it either reads PARTA or PARTB.

What can i do to make both the PARTA and PARTB read so that it can be processed for any modification to PARTC and PARTD respectively.

Thanks & Regards,
Jagadeesh. P
Re: CDT parser and Preprocessor Directives [message #693911 is a reply to message #491424] Thu, 07 July 2011 09:29 Go to previous messageGo to next message
Eclipse UserFriend
I have the same annoying problem. Is there any solution to it?
Re: CDT parser and Preprocessor Directives [message #694008 is a reply to message #693911] Thu, 07 July 2011 12:07 Go to previous messageGo to next message
Eclipse UserFriend
Currently there is no solution because CDT creates only one version of AST per file, even for header files that can be included several times in different contexts.
Re: CDT parser and Preprocessor Directives [message #694038 is a reply to message #694008] Thu, 07 July 2011 13:04 Go to previous messageGo to next message
Eclipse UserFriend
In my case I think it would be enough with just ignoring the "#if defined()" lines. I just want color syntax and indexing of the functions contained inside the "#if defined" directives.

Would that be possible? Just making the parser ignore those lines?
Re: CDT parser and Preprocessor Directives [message #1827569 is a reply to message #491424] Mon, 18 May 2020 09:11 Go to previous messageGo to next message
Eclipse UserFriend
Do you found any solution for this issue?
Re: CDT parser and Preprocessor Directives [message #1827590 is a reply to message #1827569] Mon, 18 May 2020 18:19 Go to previous message
Eclipse UserFriend
Not really sure why one would want to scan both files when the code clearly does not
but you can force the parser to consider code hidden from the compiler with
#ifdef __CDT_PARSER__
:
:
#endif


Be aware that if there are conflicting definitions then only one will be used.
The Indexer/Parser is not a compiler and doesn't necessarily scan headers every time.
Doing otherwise defeats the purpose of Indexing.

[Updated on: Mon, 18 May 2020 18:21] by Moderator

Previous Topic:Breakpoints half working
Next Topic:debug mode max array size question
Goto Forum:
  


Current Time: Thu Jul 10 07:20:30 EDT 2025

Powered by FUDForum. Page generated in 0.06155 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top