Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] PDOM and IASTTranslationUnit

Thanks for the inputs.
I found following way, than using PDOM.
Its works for Managed C++ Project.
       
ITranslationUnit tu = (ITranslationUnit) CCorePlugin.getDefault().getCoreModel().create(file);
if(tu != null) {
IASTTranslationUni ast = tu.getLanguage().getASTTranslationUnit(tu,ILanguage.AST_SKIP_ALL_HEADERS);
declarations = ast.getDeclarations();
}

This way I get only declarations in a file and not whole. (no headers file parsed) and this make parsing fast till finding abstract base classes.

thanks,
abhijit

On Tue, May 13, 2008 at 3:28 PM, Schorn, Markus <Markus.Schorn@xxxxxxxxxxxxx> wrote:
The indexer in 3.1.2 does not work well, you probably need to upgrade to 4.0.3 or 5.0 (once it's available),
then it will be best to use ITranslationUnit.getAST(...).
Markus.


From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Abhijit Dhariya
Sent: Sunday, May 11, 2008 12:16 PM
Subject: [cdt-dev] PDOM and IASTTranslationUnit
Importance: Low

Hi,

in a workspace I have a Managed C++ project and I want to parse only abstract classes in workspace. Any idea how this can be achieved using PDOM? (I am using CDT 3.1.2)

I tried CDOM.getInstance() way, but its very slow (and performance goes bad if I have more than 1 managed C++ project), because it tries to visit all files in included PATH. (around 200+ files).
I just want to parse header files and get abstract classes.
Also I tried translationUnit.getLanaguage().getASTTranalationUnit(...., AST_SKIP_ALL_HEADERS option. not working for me either.

I checked CCorePlugin.getPOMManager(), but it has some unimplmented things, so it fails to give if function is PureVirtual.

any pointers? using indexer? how?

Thanks in advance for your help

thanks,
abhijit


_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top