1 <?xml version=
"1.0" encoding=
"utf-8"?>
2 <xsl:stylesheet version=
"1.0"
3 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform">
4 <xsl:output method=
"xml" indent=
"yes"/>
5 <xsl:strip-space elements=
"*"/>
7 <xsl:template match=
"/">
13 <xsl:template match=
"Class">
14 <type name=
"{@fullname}">
16 <xsl:call-template name=
"base-classes">
17 <xsl:with-param name=
"bases" select=
"@bases"/>
19 <xsl:apply-templates match=
"Function|FunctionDefinition" mode=
"member"/>
24 <xsl:template match=
"Function|FunctionDefinition" mode=
"member">
25 <xsl:variable name=
"type">
27 <xsl:when test=
"@name = ../@name">
28 <xsl:value-of select=
"'constructor'"/>
30 <xsl:when test=
"@name = concat('~', ../@name)">
31 <xsl:value-of select=
"'destructor'"/>
33 <xsl:when test=
"@static">
34 <xsl:value-of select=
"'function'"/>
37 <xsl:value-of select=
"'method'"/>
41 <xsl:element name=
"{$type}">
42 <xsl:attribute name=
"name">
43 <xsl:value-of select=
"@name"/>
45 <xsl:attribute name=
"access"><xsl:value-of select=
"@access"/></xsl:attribute>
47 <xsl:call-template name=
"convert-type">
48 <xsl:with-param name=
"reference" select=
"@type_reference"/>
49 <xsl:with-param name=
"indirections" select=
"@indirections"/>
50 <xsl:with-param name=
"type" select=
"@type_base"/>
51 <xsl:with-param name=
"qualifier">
52 <xsl:call-template name=
"make-qualifier">
53 <xsl:with-param name=
"const" select=
"@type_constant"/>
54 <xsl:with-param name=
"volatile" select=
"@type_volatile"/>
59 <xsl:if test=
"not(@static)">
61 <xsl:call-template name=
"convert-type">
62 <xsl:with-param name=
"indirections" select=
"1"/>
63 <xsl:with-param name=
"type" select=
"@member_of_class"/>
64 <xsl:with-param name=
"qualifier">
65 <xsl:call-template name=
"make-qualifier">
66 <xsl:with-param name=
"const" select=
"@constant"/>
67 <xsl:with-param name=
"volatile" select=
"@volatile"/>
73 <xsl:apply-templates match=
"Argument" mode=
"param"/>
75 <xsl:when test=
"@abstract"><abstract/></xsl:when>
76 <xsl:when test=
"@virtual"><virtual/></xsl:when>
81 <xsl:template match=
"Argument" mode=
"param">
83 <xsl:if test=
"@name != ''">
84 <xsl:attribute name=
"name"><xsl:value-of select=
"@name"/></xsl:attribute>
86 <xsl:if test=
"@default='1'">
87 <default value=
"{@defaultvalue}"/>
89 <xsl:call-template name=
"convert-type">
90 <xsl:with-param name=
"reference" select=
"@type_reference"/>
91 <xsl:with-param name=
"indirections" select=
"@indirections"/>
92 <xsl:with-param name=
"type" select=
"@type_base"/>
93 <xsl:with-param name=
"qualifier">
94 <xsl:call-template name=
"make-qualifier">
95 <xsl:with-param name=
"const" select=
"@type_constant"/>
96 <xsl:with-param name=
"volatile" select=
"@type_volatile"/>
103 <xsl:template name=
"make-qualifier">
104 <xsl:param name=
"const"/>
105 <xsl:param name=
"volatile"/>
107 <xsl:when test=
"$const and $volatile"><xsl:value-of select=
"'const volatile'"/></xsl:when>
108 <xsl:when test=
"$const"><xsl:value-of select=
"'const'"/></xsl:when>
109 <xsl:when test=
"$volatile"><xsl:value-of select=
"'volatile'"/></xsl:when>
113 <xsl:template name=
"convert-type">
114 <xsl:param name=
"reference"/>
115 <xsl:param name=
"indirections"/>
116 <xsl:param name=
"type"/>
117 <xsl:param name=
"qualifier"/>
120 <xsl:when test=
"$reference">
122 <xsl:call-template name=
"convert-type">
123 <xsl:with-param name=
"indirections" select=
"$indirections"/>
124 <xsl:with-param name=
"type" select=
"$type"/>
125 <xsl:with-param name=
"qualifier" select=
"$qualifier"/>
129 <xsl:when test=
"$indirections and $indirections > 0">
131 <xsl:call-template name=
"convert-type">
132 <xsl:with-param name=
"indirections" select=
"$indirections - 1"/>
133 <xsl:with-param name=
"type" select=
"$type"/>
134 <xsl:with-param name=
"qualifier" select=
"$qualifier"/>
139 <type name=
"{$type}">
140 <xsl:if test=
"$qualifier != ''">
141 <xsl:attribute name=
"qualifier"><xsl:value-of select=
"$qualifier"/></xsl:attribute>
148 <xsl:template name=
"base-classes">
149 <xsl:param name=
"bases"/>
150 <xsl:if test=
"contains($bases, ';')">
151 <base class=
"{substring-before($bases, ';')}" access=
"public"/>
152 <xsl:call-template name=
"base-classes">
153 <xsl:with-param name=
"bases" select=
"substring-after($bases, ';')"/>