Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Two more questions about using CDT AST

1) The current API does not provide this kind of information, you may
want to
   create an enhancement request.
2) If you have a binding for a template class it will implement
ICPPClassTemplate. 
   This interface provides the template parameters.
   Use IBinding.getOwner() to find out where the class belongs to
(namespace, ...)

2a-2c) Please study the public API (ICPPMethod, ICPPFunction, ...)
Markus.

> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Andrey Tretyakov
> Sent: Tuesday, April 07, 2009 12:29 PM
> To: cdt-dev@xxxxxxxxxxx
> Subject: [cdt-dev] Two more questions about using CDT AST
> Importance: Low
> 
> Good day!
> I have two simple questions about using internal syntax 
> analyser of CDT, similar to "Nayna Jain" 
> <naynjain@xxxxxxxxxx>, but different.
> 
> 1) How to find out in which header the interface/type/macros 
> is defined/declared, having IASTName and IBinding for it?
> I khow, that IASTName.getContainingFilename() or
> IASTName.getFileLocation().getFileName() returns the absolute 
> path of the header file.
> But how to determine, that the include directive, for 
> example, is <bits/types.h>, but not only <types.h>???
> 
> 2) Which API should I use to determine, that, for example, 
> for class "basic_iostream" the full definition is 
> "std::basic_iostream<char, std::char_traits<char> >", i.e.
> that it is template class, it has some parameters and it has 
> namespace, etc?
> 
> 2.a) And for method "seekpos", correspondingly, how to 
> discover this crocodile:"__gnu_cxx::stdio_sync_filebuf<wchar_t,
> std::char_traits<wchar_t> >::seekpos(std::fpos<__mbstate_t>,
> std::_Ios_Openmode)" ?
> How to determine, which class this metod belongs to?
> 
> 2.b) For metod "tolower" to discover, that it has const 
> modificators?  
> (std::ctype<char>::tolower(char*, char const*) const)
> 
> 2.c) One more terrible example: I need to get          "long  
> std::__copy_streambufs<wchar_t, std::char_traits<wchar_t>  
> >(std::basic_streambuf<wchar_t, std::char_traits<wchar_t> >*,
> std::basic_streambuf<wchar_t, std::char_traits<wchar_t> >*)"  
>            
>  from "__copy_streambufs"            ... (((
> How to get the list of the parameters and return value for 
> this method?
> 
> Beforehand, great thanks for any help!
> 
> Best regards,
>                Andrey.
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 


Back to the top