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


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.


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
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top