Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » AST - How to identify c++ constructor/desctructor
AST - How to identify c++ constructor/desctructor [message #171188] Fri, 09 June 2006 17:37 Go to next message
Eclipse UserFriend
My question is regarding how to identify constructors and destructors, I
have looked at the cdt API but I'm not sure how to do it.

If you resolve the binding on a function declarator's ASTName then you can
get a CPPFunctionType, but I don't see any way to identify it further.

Is it possible?
Re: AST - How to identify c++ constructor/desctructor [message #171259 is a reply to message #171188] Mon, 12 June 2006 16:55 Go to previous messageGo to next message
Eclipse UserFriend
Constructors will implement ICPPConstructor. ICPPMethod has a method
isDestructor (which just checks if the name starts with ~)

Also, if you check IFunctionType#getReturnType(), I would expect to get
an IBasicType for which IBasicType#getType() returns
IBasicType.t_unspecified.

-Andrew

Sebastian wrote:
> My question is regarding how to identify constructors and destructors, I
> have looked at the cdt API but I'm not sure how to do it.
>
> If you resolve the binding on a function declarator's ASTName then you can
> get a CPPFunctionType, but I don't see any way to identify it further.
>
> Is it possible?
>
>
Re: AST - How to identify c++ constructor/desctructor [message #171365 is a reply to message #171259] Wed, 14 June 2006 10:15 Go to previous messageGo to next message
Eclipse UserFriend
uh.. I'm not sure how to check for whether it implements ICPPConstructor.
I have an ICPPASTFunctionDefinition. I don't see how it's related to
ICPPMethod. am I missing something?

do you mean that IBasicType.t_unspecified is for constructor or destructor?
or both?

thanks,
Sebastian


"Andrew Niefer" <aniefer@ca.ibm.com> wrote in message
news:e6kkb8$m6n$1@utils.eclipse.org...
> Constructors will implement ICPPConstructor. ICPPMethod has a method
> isDestructor (which just checks if the name starts with ~)
>
> Also, if you check IFunctionType#getReturnType(), I would expect to get
> an IBasicType for which IBasicType#getType() returns
> IBasicType.t_unspecified.
>
> -Andrew
>
> Sebastian wrote:
> > My question is regarding how to identify constructors and destructors, I
> > have looked at the cdt API but I'm not sure how to do it.
> >
> > If you resolve the binding on a function declarator's ASTName then you
can
> > get a CPPFunctionType, but I don't see any way to identify it further.
> >
> > Is it possible?
> >
> >
Re: AST - How to identify c++ constructor/desctructor [message #171387 is a reply to message #171365] Wed, 14 June 2006 11:23 Go to previous message
Eclipse UserFriend
(of course I figure it out right after I ask..)

you have to resolve the binding on the IASTName and the IBinding (which is a
subclass of ICPPMethod) is what you check.





"Sebastian Jagodzinski" <Sebastian_Jagodzinski@ca.ibm.com> wrote in message
news:e6p5nk$nc7$1@utils.eclipse.org...
>
> uh.. I'm not sure how to check for whether it implements
ICPPConstructor.
> I have an ICPPASTFunctionDefinition. I don't see how it's related to
> ICPPMethod. am I missing something?
>
> do you mean that IBasicType.t_unspecified is for constructor or
destructor?
> or both?
>
> thanks,
> Sebastian
>
>
> "Andrew Niefer" <aniefer@ca.ibm.com> wrote in message
> news:e6kkb8$m6n$1@utils.eclipse.org...
> > Constructors will implement ICPPConstructor. ICPPMethod has a method
> > isDestructor (which just checks if the name starts with ~)
> >
> > Also, if you check IFunctionType#getReturnType(), I would expect to get
> > an IBasicType for which IBasicType#getType() returns
> > IBasicType.t_unspecified.
> >
> > -Andrew
> >
> > Sebastian wrote:
> > > My question is regarding how to identify constructors and destructors,
I
> > > have looked at the cdt API but I'm not sure how to do it.
> > >
> > > If you resolve the binding on a function declarator's ASTName then you
> can
> > > get a CPPFunctionType, but I don't see any way to identify it further.
> > >
> > > Is it possible?
> > >
> > >
>
>
Previous Topic:Re: Showing source code outline in C Project
Next Topic:How to execute cc+ under Eclipse
Goto Forum:
  


Current Time: Thu May 01 16:04:11 EDT 2025

Powered by FUDForum. Page generated in 0.03156 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top