--- a/resources/styles/gccxml2def-utils.xsl Wed May 30 19:56:35 2012 +0000
+++ b/resources/styles/gccxml2def-utils.xsl Wed May 30 19:57:40 2012 +0000
@@ -1,43 +1,43 @@
<?xml version="1.0" encoding="iso-8859-2"?>
-<xsl:stylesheet
+<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="c-type-string">
<xsl:param name="c-type-id"/>
<xsl:param name="c-name-id" select="$c-type-id"/>
-
+
<xsl:choose>
<xsl:when test="/GCC_XML/PointerType[@id = $c-type-id]">
<xsl:text>(pointer-to </xsl:text>
-
+
<xsl:choose>
<!-- Pointer is a part of the user defined type -->
<!-- save the name that type -->
<xsl:when test="/GCC_XML/Typedef[@type = $c-type-id]">
<xsl:call-template name="c-type-string">
<xsl:with-param name="c-type-id" select="/GCC_XML/PointerType[@id = $c-type-id]/@type"/>
- <xsl:with-param name="c-name-id" select="/GCC_XML/Typedef[@type = $c-type-id]/@name"/>
- </xsl:call-template>
+ <xsl:with-param name="c-name-id" select="/GCC_XML/Typedef[@type = $c-type-id]/@name"/>
+ </xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="c-type-string">
<xsl:with-param name="c-type-id" select="/GCC_XML/PointerType[@id = $c-type-id]/@type"/>
- <xsl:with-param name="c-name-id" select="/GCC_XML/PointerType[@id = $c-type-id]/@type"/>
- </xsl:call-template>
+ <xsl:with-param name="c-name-id" select="/GCC_XML/PointerType[@id = $c-type-id]/@type"/>
+ </xsl:call-template>
</xsl:otherwise>
</xsl:choose>
- <xsl:text>)</xsl:text>
+ <xsl:text>)</xsl:text>
</xsl:when>
<xsl:when test="/GCC_XML/CvQualifiedType[@id = $c-type-id]">
<xsl:if test="/GCC_XML/CvQualifiedType[@id = $c-type-id]/@const = 1"><xsl:text>const </xsl:text></xsl:if>
<xsl:call-template name="c-type-string">
- <xsl:with-param name="c-type-id" select="/GCC_XML/CvQualifiedType[@id = $c-type-id]/@type"/>
+ <xsl:with-param name="c-type-id" select="/GCC_XML/CvQualifiedType[@id = $c-type-id]/@type"/>
</xsl:call-template>
</xsl:when>
-
+
<xsl:when test="/GCC_XML/FundamentalType[@id = $c-type-id]">
<xsl:value-of select="/GCC_XML/FundamentalType[@id = $c-type-id]/@name"/>
</xsl:when>
@@ -52,22 +52,22 @@
<!-- Pointers are resolved -->
<xsl:when test="/GCC_XML/PointerType[@id = /GCC_XML/Typedef[@id = $c-type-id]/@type]" >
<xsl:call-template name="c-type-string">
- <xsl:with-param name="c-type-id" select="/GCC_XML/Typedef[@id = $c-type-id]/@type"/>
+ <xsl:with-param name="c-type-id" select="/GCC_XML/Typedef[@id = $c-type-id]/@type"/>
</xsl:call-template>
</xsl:when>
<!-- Typedefs are resolved -->
<xsl:when test="/GCC_XML/Typedef[@id = /GCC_XML/Typedef[@id = $c-type-id]/@type]" >
<xsl:call-template name="c-type-string">
- <xsl:with-param name="c-type-id" select="/GCC_XML/Typedef[@id = $c-type-id]/@type"/>
+ <xsl:with-param name="c-type-id" select="/GCC_XML/Typedef[@id = $c-type-id]/@type"/>
</xsl:call-template>
- </xsl:when>
-
+ </xsl:when>
+
<!-- Function types are resolved -->
<xsl:when test="/GCC_XML/FunctionType[@id = /GCC_XML/Typedef[@id = $c-type-id]/@type]">
<xsl:call-template name="c-type-string">
<xsl:with-param name="c-type-id" select="/GCC_XML/Typedef[@id = $c-type-id]/@type"/>
- <xsl:with-param name="c-name-id" select="/GCC_XML/Typedef[@id = $c-type-id]/@name"/>
+ <xsl:with-param name="c-name-id" select="/GCC_XML/Typedef[@id = $c-type-id]/@name"/>
</xsl:call-template>
</xsl:when>
@@ -75,12 +75,12 @@
<xsl:otherwise>
<xsl:value-of select="/GCC_XML/Typedef[@id = $c-type-id]/@name"/>
</xsl:otherwise>
- </xsl:choose>
+ </xsl:choose>
</xsl:when>
<xsl:when test="/GCC_XML/FunctionType[@id = $c-type-id]">
- <xsl:text>(function-type </xsl:text>
- <xsl:value-of select="$c-name-id"/>
+ <xsl:text>(function-type </xsl:text>
+ <xsl:value-of select="$c-name-id"/>
<xsl:text> 			(</xsl:text>
<xsl:for-each select="/GCC_XML/FunctionType[@id = $c-type-id]/Argument">
@@ -90,7 +90,7 @@
</xsl:call-template>
<xsl:text>) </xsl:text>
<xsl:value-of select="@name"/>
- <xsl:text>)</xsl:text>
+ <xsl:text>)</xsl:text>
</xsl:for-each>
<xsl:text>) 			(return </xsl:text>
<xsl:call-template name="c-type-string">
@@ -106,35 +106,35 @@
<xsl:when test="/GCC_XML/Struct[@id = $c-type-id]">
<xsl:choose>
<xsl:when test="/GCC_XML/Struct[@id = $c-type-id and not(@name)] or /GCC_XML/Struct[@id = $c-type-id]/@name = ''">
- <xsl:value-of select="/GCC_XML/Struct[@id = $c-type-id]/@id"/>
+ <xsl:value-of select="/GCC_XML/Struct[@id = $c-type-id]/@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/GCC_XML/Struct[@id = $c-type-id]/@name"/>
</xsl:otherwise>
- </xsl:choose>
+ </xsl:choose>
</xsl:when>
<xsl:when test="/GCC_XML/ArrayType[@id = $c-type-id]">
- <xsl:text>(array (</xsl:text>
+ <xsl:text>(array (</xsl:text>
<xsl:call-template name="c-type-string">
- <xsl:with-param name="c-type-id" select="/GCC_XML/ArrayType[@id = $c-type-id]/@type"/>
+ <xsl:with-param name="c-type-id" select="/GCC_XML/ArrayType[@id = $c-type-id]/@type"/>
</xsl:call-template>
<xsl:text>) </xsl:text>
- <xsl:value-of select="/GCC_XML/ArrayType[@id = $c-type-id]/@max"/>
- <xsl:text>)</xsl:text>
+ <xsl:value-of select="/GCC_XML/ArrayType[@id = $c-type-id]/@max"/>
+ <xsl:text>)</xsl:text>
</xsl:when>
-
+
<xsl:when test="/GCC_XML/Union[@id = $c-type-id]">
<xsl:choose>
<xsl:when test="/GCC_XML/Union[@id = $c-type-id and not(@name)] or /GCC_XML/Union[@id = $c-type-id]/@name = ''">
- <xsl:value-of select="/GCC_XML/Union[@id = $c-type-id]/@id"/>
+ <xsl:value-of select="/GCC_XML/Union[@id = $c-type-id]/@id"/>
</xsl:when>
- <xsl:otherwise>
+ <xsl:otherwise>
<xsl:value-of select="/GCC_XML/Union[@id = $c-type-id]/@name"/>
</xsl:otherwise>
- </xsl:choose>
+ </xsl:choose>
</xsl:when>
-
+
<xsl:otherwise>
<xsl:message>
<xsl:text> #Error: --c-type-string-- Unknown C type with id </xsl:text>
@@ -142,9 +142,9 @@
</xsl:message>
</xsl:otherwise>
</xsl:choose>
- </xsl:template>
+ </xsl:template>
-
+
<!--- ========== Tokenizer ================== -->
<xsl:template name="tokenize">
<xsl:param name="string" select="''" />
@@ -177,28 +177,28 @@
<xsl:with-param name="field-id" select="substring-before($string, $delimiter)"/>
<xsl:with-param name="string" select="$string"/>
<xsl:with-param name="indent" select="$indent" />
- </xsl:call-template>
+ </xsl:call-template>
<xsl:call-template name="_tokenize-delimiter">
- <xsl:with-param name="string" select="substring-after($string, $delimiter)" />
+ <xsl:with-param name="string" select="substring-after($string, $delimiter)" />
<xsl:with-param name="delimiter" select="$delimiter" />
<xsl:with-param name="indent" select="$indent" />
</xsl:call-template>
- </xsl:when>
-
+ </xsl:when>
+
<xsl:otherwise>
- <xsl:message>
- <xsl:text> #Error: --tokenizer-- Nothing happend for string </xsl:text>
+ <xsl:message>
+ <xsl:text> #Error: --tokenizer-- Nothing happend for string </xsl:text>
<xsl:value-of select="$string"/>
- </xsl:message>
+ </xsl:message>
</xsl:otherwise>
</xsl:choose>
-
+
</xsl:template>
-
+
- <!--- ========== Find Field ================== -->
+ <!--- ========== Find Field ================== -->
<xsl:template name="find-field">
<xsl:param name="field-id"/>
<xsl:param name="field" select="/GCC_XML/*[@id = $field-id]"/>
@@ -219,12 +219,16 @@
<xsl:when test="local-name($field) = 'Enumeration'"/>
<xsl:when test="local-name($field) = 'Union'"/>
+ <xsl:when test="local-name($field) = 'Constructor'"/>
+ <xsl:when test="local-name($field) = 'Destructor'"/>
+ <xsl:when test="local-name($field) = 'OperatorMethod'"/>
+
<xsl:when test="$field">
<xsl:text> </xsl:text>
<xsl:call-template name="indent">
<xsl:with-param name="count" select="$indent"/>
- </xsl:call-template>
- <xsl:text>(field (</xsl:text>
+ </xsl:call-template>
+ <xsl:text>(field (</xsl:text>
<xsl:choose>
<xsl:when test="not($field-type/@name)">
<xsl:text> </xsl:text>
@@ -251,11 +255,11 @@
<xsl:otherwise>
<xsl:call-template name="c-type-string">
<xsl:with-param name="c-type-id" select="/GCC_XML/Field[@id = $field-id]/@type"/>
- </xsl:call-template>
+ </xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:text>) </xsl:text>
-
+
<xsl:if test="/GCC_XML/Field[@id = $field-id]/@name = ''">
<!-- Field has not defined name -->
<xsl:text>unknown</xsl:text>
@@ -265,8 +269,8 @@
<xsl:text> :offset </xsl:text>
<xsl:value-of select="/GCC_XML/Field[@id = $field-id]/@offset"/>
-
- <xsl:text>)</xsl:text>
+
+ <xsl:text>)</xsl:text>
</xsl:when>
<xsl:otherwise>
@@ -277,20 +281,20 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-
-
-
+
+
+
<!--- ========== indent ================== -->
- <xsl:template name="indent">
+ <xsl:template name="indent">
<xsl:param name="count" select="1"/>
-
+
<xsl:if test="$count > 0">
- <xsl:text>	</xsl:text>
+ <xsl:text>	</xsl:text>
<xsl:call-template name="indent">
<xsl:with-param name="count" select="$count - 1"/>
</xsl:call-template>
- </xsl:if>
- </xsl:template>
-
-
+ </xsl:if>
+ </xsl:template>
+
+
</xsl:stylesheet>