Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Programatically read and update macros in a header file(Programatically read and update macros in a header file)
Programatically read and update macros in a header file [message #1769742] Thu, 03 August 2017 06:27 Go to next message
Richmond Umagat is currently offline Richmond UmagatFriend
Messages: 18
Registered: July 2017
Junior Member
I need to create a view where user can READ and UPDATE the macro values in a header file of a C application.

Is there an efficient way for Eclipse CDT to programmatically READ and MODIFY the macro definitions in a header file of a C application? How? Or do I have to manually read, parse and update the file?
Re: Programatically read and update macros in a header file [message #1769790 is a reply to message #1769742] Thu, 03 August 2017 12:11 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
:-) Actually I have a better place to ask questions like this, the cdt-dev mailing list:

Quote:
questions regarding CDT guts and extending CDT should be asked on
cdt-dev mailing list, it is intention on this list


https://dev.eclipse.org/mhonarc/lists/cdt-dev/msg32224.html

Sign-up here https://dev.eclipse.org/mailman/listinfo/cdt-dev
Re: Programatically read and update macros in a header file [message #1769854 is a reply to message #1769790] Fri, 04 August 2017 08:44 Go to previous messageGo to next message
Richmond Umagat is currently offline Richmond UmagatFriend
Messages: 18
Registered: July 2017
Junior Member
Thanks, found out its possible to read the macros in a file via IIndexManager or via ITranslationUnit. However, both classes do not seem to provide a way to update the macro values to a file.
Re: Programatically read and update macros in a header file [message #1769856 is a reply to message #1769854] Fri, 04 August 2017 08:53 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
Working in the same way as refactoring does you can edit the file. Its not my area (so I don't know limitations). I see you have posted to cdt-dev, hopefully you can get a better quality answer there.
Re: Programatically read and update macros in a header file [message #1769976 is a reply to message #1769856] Mon, 07 August 2017 09:00 Go to previous messageGo to next message
Richmond Umagat is currently offline Richmond UmagatFriend
Messages: 18
Registered: July 2017
Junior Member
Using the CRefactoring class is not appropriate for my case because I will be providing my own view. (I think it was you who mentioned that in some thread long ago). Anyway, I tried using ASTRewrite instead but ASTRewrite does not support rewriting preprocessor statements yet. Can you confirm this? Thanks.
Re: Programatically read and update macros in a header file [message #1770014 is a reply to message #1769976] Mon, 07 August 2017 14:02 Go to previous message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
Hi, I can't confirm because I don't know. Nate or Doug on the cdt-dev list should hopefully know.
Previous Topic:Secure storage - need some clarification
Next Topic:error compiling project in eclipse C++ for intel galileo
Goto Forum:
  


Current Time: Fri Mar 29 09:32:39 GMT 2024

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

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

Back to the top