Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] How to create a IASTPreprocessorIncludeStatement

Hi,

I’m not sure preprocessor statements are supported by the node factory, I don’t see it right now.
I have noticed the “StyledInclude” class that seems to help generate the String for include statements (it is used in a few places in refactoring, organize includes). So maybe you can use that to help write to the file buffer, then the rest or non-preprocessor AST nodes should be doable with the node factory.

Marc-André

On Nov 18, 2019, at 2:41 AM, Ming Cheng <chengm349@xxxxxxxxxxx> wrote:

Hi Marc-André,
 
Hope you are not too busy.
 
Assume I have a ITranslationUnit tu object and now I want to add a simple “#include <>” into the tu. How to achieve this simple action? My guessing is that I should create a IASTPreprocessorIncludeStatement object and add it to tu.
 
Looking forward to your kind advice.
 
Ming Cheng
Sent from Mail for Windows 10
 
 
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev


Back to the top