Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] AST: How to discover that function has "const" qualifier?

I've already debug half Eclipse-CDT and discovered, that it gets ALL Declarations for parsed Translation Unit and for each item receives ICPPASTFunctionDeclarator (org.eclipse.cdt.internal.core.model.CModelBuilder2.createFunctionDefinition()). I don't want to parse TU and get ALL Delcarations, it's too long. Is there method to get ICPPASTFunctionDeclarator from IBinding (ICPPFunction)?

On Wed, 20 May 2009 17:54:04 +0400, Christian W. Damus <cdamus@xxxxxxx> wrote:

Hi, Andrey,

If the label provider in the Outline View shows the const-ness, then you
should be able to debug it to determine how it works.  Then, just do the
same in your code.




On Wed, 2009-05-20 at 17:47 +0400, Andrey Tretyakov wrote:


For instance, in "/urs/include/c++/4.3/bits/locale_classes.h" I have

     string name() const;

and in my C++ program:

	locale *l = new locale();

And my plug-in has IBinding for "l->name()" (instanceof ICPPFunction), but
I can't discover, that this method has "const" qualifier.
I know, that Eclipse provides this information in "Outline", but I can't
use it. :(

How can I receive this information from AST?

Best regards,
cdt-dev mailing list


Christian W. Damus
Software Developer, IDE Team
QNX Software Systems

Back to the top