Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Parsing macros in the declaration

Hi Sanjesh,

The CDT parser preprocesses the source code (which includes expanding macros) and creates an AST for the result. However, the AST does not have a representation for ‘__declspec(dllimport)’, this particular information is dropped.

As a workaround you can look at the tokens before the name ‘X’, using ASTNode.getLeadingTokens() on the ASTNode representing the name ‘X’.

Markus.

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Sanjesh R Nair
Sent: Thursday, June 30, 2011 11:33
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] Parsing macros in the declaration
Importance: Low

 

Hi All,

Does CDT parse and load the following declaration in the AST model?
       

                #define IMPORT __declspec(dllimport)
                class IMPORT X {};

Would I get the __declspec(dllimport) or the macro as part of the AST?

Thanks,
Sanjesh.


Back to the top