Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Programmatically update macros in a header file

One idea is to take a look at the Refactoring code. For example ExtractFunctionRefactoring. I’ve been using that as an example for a new editor I’m building which edits the code based on changes in the Properties View. Essentially you just need to create TextEdits and wrap them up in a Change object and the Refactoring engine takes care of the rest.





From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Richmond Umagat
Sent: Friday, August 4, 2017 4:52 AM
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] Programmatically update macros in a header file





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?


So far I am able to read macros in a file via IIndexManager or ITranslationUnit. However, these options do not seem to provide a way to update the macros.


Any help will be appreciated. Thank you.





Back to the top