[GCC-XML] Determining template parameter types

Chris Waldron cwaldron at intrinsyc.com
Mon Aug 4 13:33:39 EDT 2008


Thanks for the tip and you have what looks like cool tool.  However I've
written my own tool to scan the resultant XML because I have a specific
requirement.  I could detemine the type from parsing the template
parameters and matching the type names.  However since GCC_XML contains
the information, it should export it on the Class element.  Also having
the additional attribute will help to rapidly identify template class
definitons.

Thanks,
Chris

-----Original Message-----
From: Roman Yakovenko [mailto:roman.yakovenko at gmail.com] 
Sent: Saturday, August 02, 2008 10:07 AM
To: Chris Waldron
Cc: gccxml
Subject: Re: [GCC-XML] Determining template parameter types

On Sat, Aug 2, 2008 at 7:09 PM, Chris Waldron <cwaldron at intrinsyc.com>
wrote:
> As a feature request, it would nice if template parameter types can be
added
> as an attribute of the Class Element. For example:
> template <typename P1, typename P2> TemplateClass {
>
>
>
> };
>
>
>
> class TemplateClass<void, int>
>
> {
>
>
>
> };
>
>
>
>
>
> <Class id="_10" name="TemplateClass<void,int*>" members="_23 _25
_26
> _27 _28 _29 _30 " bases="_21 _24 " tparams="_20 _21">
>
>     <Base type="_21" access="public" virtual="0" offset="12"/>
>
>     <Base type="_24" access="public" virtual="0" offset="0"/> </Class>
>
>
>
> The tparams attribute indicates the template parameter types defined
on the
> class.  I cannot seem to find an easy way of determining the template
> parameter types from the XML output.

pygccxml does it right, in most cases:
http://www.language-binding.net/pygccxml/apidocs/pygccxml.declarations.t
emplates-module.html

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the gccxml mailing list