Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] AST for a C++ project

Yes exactly. If you don't specify the flags the whole compilation unit should be parsed.

If I got your intention correctly, I think it should be feasible to use the index to find such locations. But this will not give you AST nodes to work with, but only IIndexNames. But if the location of such a name is within the project you can parse the translation unit of the corresponding file and get the AST.

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of sim0s
Sent: Donnerstag, 1. Dezember 2016 12:16
To: cdt-dev@xxxxxxxxxxx
Subject: Re: [cdt-dev] AST for a C++ project

Thanks Thomas.

When you say "what flags", I suppose you mean the following command:
tu.getAST(index, aFlag);// e.g., aFlag = ITranslationUnit.AST_SKIP_INDEXED_HEADERS


Essentially what I am trying to achieve is the following:
Parse a C++ project and find some nodes (e.g., function calls) that belong to a specific namespace. 

Initially, I tried to achieve this through the index. However, there is the problem that a compilation unit (using the flag I say above) was only parsing a single C++ file. So not all nodes of interest were captured.
That's why I need to create the AST of the entire C++ project. However, I'd like to avoid creating AST for "conventional" libraries such as std etc.

Thanks again.



--
View this message in context: http://eclipse.1072660.n5.nabble.com/AST-for-a-C-project-tp186484p186488.html
Sent from the Eclipse CDT - Development mailing list archive at Nabble.com.
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top