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?

Thanks, Richard!
I forgot about IASTTranslationUnit's methods! :))
I'll try it later.

Regards,
Andrey.

On Wed, 20 May 2009 18:41:04 +0400, Richard Miskin <Richard.Miskin@xxxxxxx> wrote:

In fact it looks like the IType of the IBinding would give you what you need. ICPPFunctionType has an isConst() and an isVolatile() method.

Cheers,
Richard


-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Richard Miskin
Sent: Wednesday 20 May 2009 15:31
To: 'CDT General developers list.'
Subject: RE: [cdt-dev] AST: How to discover that function has "const"
qualifier?

If you've got the IBinding then you should be able to find declarations
using IASTTranslationUnit.getDeclarations(IBinding).

That'll give you an IName that would presumably belong to a
ICPPASTFunctionDeclarator.

Maybe ICPPMethod should also store if the member function is
const/volatile?

Cheers,
Richard


> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-
bounces@xxxxxxxxxxx]
> On Behalf Of Andrey Tretyakov
> Sent: Wednesday 20 May 2009 15:08
> To: CDT General developers list.
> Subject: 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.createFunctionDefi
> n
> ition()).
> 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.
> >
> > :-)
> >
> > HTH,
> >
> > Christian
> >
> > On Wed, 2009-05-20 at 17:47 +0400, Andrey Tretyakov wrote:
> >
> >> Hello!
> >>
> >> For instance, in "/urs/include/c++/4.3/bits/locale_classes.h" I
> >> have
> >> declaration:
> >>
> >>      string name() const;
> >>
> >> and in my C++ program:
> >>
> >> 	locale *l = new locale();
> >> 	l->name();
> >>
> >> 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,
> >>                Andrey.
> >> _______________________________________________
> >> cdt-dev mailing list
> >> cdt-dev@xxxxxxxxxxx
> >> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> >
> >
> >
>
______________________________________________________________________
> _
> _
> >
> > Christian W. Damus
> > Software Developer, IDE Team
> > QNX Software Systems
>
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev


The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or privileged
material. If you are not the addressee, any disclosure, reproduction,
copying, distribution, or other dissemination or use of this
communication is strictly prohibited. If you have received this
transmission in error please notify the sender immediately and then
delete this email.

Any representations or commitments expressed in this email are subject
to contract.

This message has been scanned for viruses and dangerous content.
However, it is essential that the recipient also checks this message
using commercially available mail scanning and anti-virus software. IPL
Information Processing Limited accepts no liability for any loss or
damage resulting from any virus or other dangerous content in this
message.

IPL Information Processing Limited is registered in England and Wales
under company registration number 1418818.
Registration took place at Cardiff on 10 May 1979. IPL Information
Processing Limited's registered office and normal place of business is
Eveleigh House, Grove Street, Bath, BA1 5LR, United Kingdom. IPL is
also registered for Value Added Tax (VAT) under registration number GB
601 2931 83.



The information transmitted is intended only for the person
or entity to which it is addressed and may contain
confidential and/or privileged material. If you are not the
addressee, any disclosure, reproduction, copying,
distribution, or other dissemination or use of this
communication is strictly prohibited. If you have received
this transmission in error please notify the sender
immediately and then delete this email.

Any representations or commitments expressed in this email
are subject to contract.

This message has been scanned for viruses and dangerous
content. However, it is essential that the recipient also
checks this message using commercially available mail
scanning and anti-virus software. IPL Information Processing
Limited accepts no liability for any loss or damage resulting
from any virus or other dangerous content in this message.

IPL Information Processing Limited is registered in England
and Wales under company registration number 1418818.
Registration took place at Cardiff on 10 May 1979. IPL
Information Processing Limited's registered office and
normal place of business is Eveleigh House, Grove Street,
Bath, BA1 5LR, United Kingdom. IPL is also registered for
Value Added Tax (VAT) under registration number GB 601 2931 83.





Back to the top