This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/library/gecode/extractor/extract-enums.xsl
2011-08-08 15:21:36 +02:00

32 lines
879 B
XML

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" version="1.0"/>
<xsl:template match="/">
<xsl:text>ENUM_CLASSES = []
</xsl:text>
<xsl:for-each select="/doxygen/compounddef/sectiondef[@kind='enum']/memberdef">
<xsl:text>class </xsl:text>
<xsl:value-of select="name"/>
<xsl:text>(object):
</xsl:text>
<xsl:text> TYPE = '</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>'
ENUM = [</xsl:text>
<xsl:for-each select="enumvalue">
<xsl:if test="position()!=1"><xsl:text>,</xsl:text></xsl:if>
<xsl:text>'</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>'</xsl:text>
</xsl:for-each>
<xsl:text>]
ENUM_CLASSES.append(</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>)
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>