Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Finding references using PDOM and then finding the AST elements that contain the reference..

>  can you not use IASTName.resolveBinding (PDOMName is an IASTName)
> to get the IBinding?

Ok I think I was not very articulate the first time over..and maybe am not even now :)..but let me elaborate with the example that I gave first..

We have
class A {};
class B {
  A myA;

If I search for the references of A, I will get a PDOMName. If I call IASTName.resolveBinding() on this I get the binding for class A which is an instance of PDOMCPPClassType. I do not get the PDOMCPPField binding that uses A. If I search for myA and call IASTName.resolveBinding() I will get a PDOMCPPField. So what I wanted is to search for references of A and then somehow get to the PDOMCPPField associated with myA and then from there to get its owner i.e the PDOMCPPClassType instance for the class B.

> (ICPPField) PDOMCPPField and (ICPPBase) PDOMCPPBase are both IBinding subtypes
> thanks,
> Andrew
> > Oks..maybe not exactly the AST per se...I saw in the code that when
> > we add IASTNames to the PDOM we add stuff like PDOMCPPField,
> > PDOMCPPBase etc...if there is a way of getting to these from the
> > PDOMName that is returned as the reference it would be good enough
> > for me so that I save on recreating the AST and walking over it.
> > --
> > neeraj
> >
> > cdt-dev-bounces@xxxxxxxxxxx wrote on 09/06/2006 01:51:04 AM:
> >
> > > The PDOM does not store the AST. It only contains IASTNames and
> > > IBindings and ITypes. You would need to recreate the AST for the
> > > file and walk it to find the right name given the file location
> > > stored in the PDOMName.
> > >  
> > > Doug Schaefer
> > > QNX Software Systems
> > > Eclipse CDT Project Lead
> > >

> Don't miss out on your chance to...Do more with Symbian.
> Make sure you visit the Symbian Smartphone Show, 17-18 October
> 2006, Excel, London

> *******************************************************************
> *** Symbian Software Ltd is a company registered in England and
> Wales with registered number 4190020 and registered office at 2-6
> Boundary Row, Southwark, London, SE1 8HP, UK. This message is
> intended only for use by the named addressee and may contain
> privileged and/or confidential information. If you are not the
> named addressee you should not disseminate, copy or take any action
> in reliance on it. If you have received this message in error
> please notify postmaster@xxxxxxxxxxx and delete the message and any
> attachments accompanying it immediately. Neither Symbian nor any of
> its Affiliates accepts liability for any corruption, interception,
> amendment, tampering or viruses occurring to this message in
> transit or for any message sent by its employees which is not in
> compliance with Symbian corporate policy. *************************
> *********************************************
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx

Back to the top