Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Get uses from IASTName/ Ibinding

Thanks a lot.

On Feb 18, 2016 6:36 PM, "Nathan Ridge" <zeratul976@xxxxxxxxxxx> wrote:
First, you would use IASTName.resolveBinding() to get an IBinding (you probably know this already).

Then, if you're interested in uses in the current file, you can use IASTTranslationUnit.getReferences(IBinding).

If you're interested in uses in the project, you can use IIndex.findReferences(IBinding).

Hope that helps,
Nate

________________________________
> Date: Thu, 18 Feb 2016 17:04:04 +0100
> From: krishna.nm86@xxxxxxxxx
> To: cdt-dev@xxxxxxxxxxx
> Subject: [cdt-dev] Get uses from IASTName/ Ibinding
>
> Hi,
>     I want to write a CDT code that can get me all the uses of a
> selected declaration.
>
> For example, consider the code :
>
>
> Struct A{
> float x;
> }
>
> A aobj[1000]; //Selected Node is the "aobj" name
>
>
> void fn()
> {
>       for(int i=0; i<1000; i++)
>       {
>               float temp = aobj[i];  // Would like to programatically
> derive this location (or use.. and any further uses)
>       }
> }
>
> _______________________________________________ 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

_______________________________________________
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