[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [cdt-dev] Find IBindings for qualifiedName
|
The qualified name does not appear in the AST.
As background, I'm working on extensions to better support Qt development. Qt uses macros (with an empty expansion) to
indicate various things.
In this particular case, the C++ code looks like:
class Q1 : public QObject
{
Q_OBJECT
enum E { e1 };
};
class Q2 : public QObject
{
Q_OBJECT
Q_ENUMS( Q1::E )
};
The Qt tooling is processing the Q_ENUMS expansion. I have the macro expansion parameter, "Q1::E", and need to find the
CPPEnumeration for it.
-Andrew
On 13-11-27 03:51 PM, Nathan Ridge wrote:
>> As part of the Qt enhancements, I have a String that contains a qualified name (with embedded ::) and I need to find the
>> list of matching IBindings.
>>
>> It seems that I'm looking for a method like CPPSemantics.findBindings(IScope scope, String name, boolean qualified),
>> except that method doesn't like the name to contain "::". I'm not sure what the third parameter is for, but I've tried
>> both values.
>>
>> Until now I've been using my own implementation of findBindings. This implementation just splits the name based on ::
>> and then tries to use the existing implementation to find each component of the name.
>>
>> If there is already a way to get the list of IBindings for a qualifiedName, then I would like to start using it. If
>> there is not a way, then I can contribute my implementation.
>
> Does the qualified name appear in a file for which you have an AST?
>
> If so, you can find the IASTName for it (e.g. with IASTNodeSelector) and call resolveBinding()
> on that name.
>
> Regards,
> Nate
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>