Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » How can I get const attribute of cpp functions ?
How can I get const attribute of cpp functions ? [message #170603] Thu, 01 June 2006 03:50 Go to next message
Eclipse UserFriend
Hi,

I am developing a tool built on CDT parser.

org.eclipse.cdt.core.parser.ast.IASTMethod contains isConst() method.
However new parser's interface org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction
or ICPPMethod does not contain such method.
Is there any way to get the const attribute of cpp functions ?

Thank you in advance.

--
Hitoshi Sato
Re: How can I get const attribute of cpp functions ? [message #170902 is a reply to message #170603] Tue, 06 June 2006 13:08 Go to previous messageGo to next message
Eclipse UserFriend
Hitoshi,
Call IFunction#getType(). For C++ you should get back an
ICPPFunctionType object which has a isConst() and isVolatile() methods.

-Andrew

Hitoshi Sato wrote:
> Hi,
>
> I am developing a tool built on CDT parser.
>
> org.eclipse.cdt.core.parser.ast.IASTMethod contains isConst() method.
> However new parser's interface
> org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction or ICPPMethod does not
> contain such method.
> Is there any way to get the const attribute of cpp functions ?
>
> Thank you in advance.
>
> --
> Hitoshi Sato
Re: How can I get const attribute of cpp functions ? [message #171056 is a reply to message #170902] Wed, 07 June 2006 22:18 Go to previous messageGo to next message
Eclipse UserFriend
Thanks a lot Andrew,
This is a break-through for me.
I have gotten a const attribute.

However, I still could not get a pure virtual attribute of a class method.

Old interface org,eclipse.cdt.core.parser.ast.IASTMethod contains
isPureVirtual() method.
New interfaces including ICPPFunctionType do not contain such a method.

Is there any way to get a pure-virutal attribute of a class method ?

--
Hitoshi Sato

"Andrew Niefer" <aniefer@ca.ibm.com> wrote in message
news:e64cr0$d7u$2@utils.eclipse.org...
> Hitoshi,
> Call IFunction#getType(). For C++ you should get back an
> ICPPFunctionType object which has a isConst() and isVolatile() methods.
>
> -Andrew
>
> Hitoshi Sato wrote:
>> Hi,
>>
>> I am developing a tool built on CDT parser.
>>
>> org.eclipse.cdt.core.parser.ast.IASTMethod contains isConst() method.
>> However new parser's interface
>> org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction or ICPPMethod does not
>> contain such method.
>> Is there any way to get the const attribute of cpp functions ?
>>
>> Thank you in advance.
>>
>> --
>> Hitoshi Sato
Re: How can I get const attribute of cpp functions ? [message #171071 is a reply to message #171056] Thu, 08 June 2006 11:47 Go to previous message
Eclipse UserFriend
Hitoshi,
Unfortunately it seems you have found a missing piece from the binding
interface. There is no way to check for pure-virtual directly from the
binding. (You might want to raise a bug for this).

The pure-virtual is available on the ICPPASTFunctionDeclarator for the
method declaration in the class. If you got the binding from the
IASTName on the method declaration then the declarator is easy to get,
however if you got the binding from the definition or from a reference
then you will need to find the declaration (either using internal
methods or using the IASTTranslationUnit#getDeclarations).

-Andrew

Hitoshi Sato wrote:
> Thanks a lot Andrew,
> This is a break-through for me.
> I have gotten a const attribute.
>
> However, I still could not get a pure virtual attribute of a class method.
>
> Old interface org,eclipse.cdt.core.parser.ast.IASTMethod contains
> isPureVirtual() method.
> New interfaces including ICPPFunctionType do not contain such a method.
>
> Is there any way to get a pure-virutal attribute of a class method ?
>
> --
> Hitoshi Sato
>
> "Andrew Niefer" <aniefer@ca.ibm.com> wrote in message
> news:e64cr0$d7u$2@utils.eclipse.org...
>
>> Hitoshi,
>> Call IFunction#getType(). For C++ you should get back an
>> ICPPFunctionType object which has a isConst() and isVolatile() methods.
>>
>> -Andrew
>>
>> Hitoshi Sato wrote:
>>
>>> Hi,
>>>
>>> I am developing a tool built on CDT parser.
>>>
>>> org.eclipse.cdt.core.parser.ast.IASTMethod contains isConst() method.
>>> However new parser's interface
>>> org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction or ICPPMethod does not
>>> contain such method.
>>> Is there any way to get the const attribute of cpp functions ?
>>>
>>> Thank you in advance.
>>>
>>> --
>>> Hitoshi Sato
>
>
Previous Topic:debugging problem
Next Topic:Using Intel 9.1 C++ on wondow
Goto Forum:
  


Current Time: Sun Jul 13 23:01:21 EDT 2025

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

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

Back to the top