mirror of
https://github.com/dlang-community/D-Scanner.git
synced 2025-04-27 22:00:17 +03:00
Fix bug with AST output
This commit is contained in:
parent
c9eb658412
commit
4bac2671b4
5 changed files with 78 additions and 1 deletions
55
scripts/uml.xsl
Normal file
55
scripts/uml.xsl
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:output indent="no" omit-xml-declaration="yes"/>
|
||||
<xsl:template match="module">
|
||||
digraph {
|
||||
<xsl:for-each select="//interfaceDeclaration">
|
||||
<xsl:value-of select="./name"/>
|
||||
<xsl:value-of select="'[shape="record" label="{'"/>
|
||||
<xsl:value-of select="'<<interface>>\n'"/>
|
||||
<xsl:value-of select="./name"/>
|
||||
<xsl:call-template name="bodyHandler"/>
|
||||
</xsl:for-each>
|
||||
<xsl:for-each select="//structDeclaration">
|
||||
<xsl:value-of select="./name"/>
|
||||
<xsl:value-of select="'[shape="record" label="{'"/>
|
||||
<xsl:value-of select="'<<struct>>\n'"/>
|
||||
<xsl:value-of select="./name"/>
|
||||
<xsl:call-template name="bodyHandler"/>
|
||||
</xsl:for-each>
|
||||
<xsl:for-each select="//classDeclaration">
|
||||
<xsl:value-of select="./name"/>
|
||||
<xsl:value-of select="'[shape="record" label="{'"/>
|
||||
<xsl:value-of select="./name"/>
|
||||
<xsl:call-template name="bodyHandler"/>
|
||||
</xsl:for-each>
|
||||
}
|
||||
</xsl:template>
|
||||
<xsl:template name="bodyHandler">
|
||||
<xsl:value-of select="'|'"/>
|
||||
<xsl:for-each select="./structBody/declaration/functionDeclaration">
|
||||
<xsl:value-of select="name"/>
|
||||
<xsl:value-of select="'('"/>
|
||||
<xsl:for-each select="./parameters/parameter">
|
||||
<xsl:value-of select="./name"/>
|
||||
<xsl:value-of select="' : '"/>
|
||||
<xsl:value-of select="./type/@pretty"/>
|
||||
</xsl:for-each>
|
||||
<xsl:value-of select="')'"/>
|
||||
<xsl:value-of select="' : '"/>
|
||||
<xsl:value-of select="./type/@pretty"/>
|
||||
<xsl:value-of select="'\l'"/>
|
||||
</xsl:for-each>
|
||||
<xsl:value-of select="'|'"/>
|
||||
<xsl:for-each select="./structBody/declaration/variableDeclaration">
|
||||
<xsl:variable name="type" select="./type/@pretty"/>
|
||||
<xsl:for-each select="./declarator">
|
||||
<xsl:value-of select="name"/>
|
||||
<xsl:value-of select="' : '"/>
|
||||
<xsl:value-of select="$type"/>
|
||||
<xsl:value-of select="'\l'"/>
|
||||
</xsl:for-each>
|
||||
</xsl:for-each>
|
||||
<xsl:value-of select="'}"];'"/>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
Loading…
Add table
Add a link
Reference in a new issue