]> git.saurik.com Git - bison.git/blobdiff - data/xslt/xml2text.xsl
xml: also display %empty for empty right-hand sides
[bison.git] / data / xslt / xml2text.xsl
index d776bb17e9a435224875b42f39a9fb31bda20ca4..4d34be1631fc0cdd71ec66155ac6458dc64ef539 100644 (file)
@@ -3,7 +3,7 @@
 <!--
     xml2text.xsl - transform Bison XML Report into plain text.
 
 <!--
     xml2text.xsl - transform Bison XML Report into plain text.
 
-    Copyright (C) 2007-2012 Free Software Foundation, Inc.
+    Copyright (C) 2007-2013 Free Software Foundation, Inc.
 
     This file is part of Bison, the GNU Compiler Compiler.
 
 
     This file is part of Bison, the GNU Compiler Compiler.
 
 <xsl:template match="automaton/state">
   <xsl:param name="pad"/>
   <xsl:text>&#10;&#10;</xsl:text>
 <xsl:template match="automaton/state">
   <xsl:param name="pad"/>
   <xsl:text>&#10;&#10;</xsl:text>
-  <xsl:text>state </xsl:text>
+  <xsl:text>State </xsl:text>
   <xsl:value-of select="@number"/>
   <xsl:text>&#10;&#10;</xsl:text>
   <xsl:apply-templates select="itemset/item">
   <xsl:value-of select="@number"/>
   <xsl:text>&#10;&#10;</xsl:text>
   <xsl:apply-templates select="itemset/item">
     <xsl:if test="position() = $point + 1">
       <xsl:text> .</xsl:text>
     </xsl:if>
     <xsl:if test="position() = $point + 1">
       <xsl:text> .</xsl:text>
     </xsl:if>
-    <xsl:if test="$itemset = 'true' and name(.) != 'empty'">
-      <xsl:apply-templates select="."/>
-    </xsl:if>
-    <xsl:if test="$itemset != 'true'">
-      <xsl:apply-templates select="."/>
-    </xsl:if>
+    <xsl:apply-templates select="."/>
     <xsl:if test="position() = last() and position() = $point">
       <xsl:text> .</xsl:text>
     </xsl:if>
     <xsl:if test="position() = last() and position() = $point">
       <xsl:text> .</xsl:text>
     </xsl:if>
 </xsl:template>
 
 <xsl:template match="empty">
 </xsl:template>
 
 <xsl:template match="empty">
-  <xsl:text> /* empty */</xsl:text>
+  <xsl:text> %empty</xsl:text>
 </xsl:template>
 
 <xsl:template match="lookaheads">
 </xsl:template>
 
 <xsl:template match="lookaheads">
   </xsl:choose>
 </xsl:template>
 
   </xsl:choose>
 </xsl:template>
 
-<xsl:template name="space">
-  <xsl:param name="repeat">0</xsl:param>
-  <xsl:param name="fill" select="' '"/>
-  <xsl:if test="number($repeat) &gt;= 1">
-    <xsl:call-template name="space">
-      <xsl:with-param name="repeat" select="$repeat - 1"/>
-      <xsl:with-param name="fill" select="$fill"/>
-    </xsl:call-template>
-    <xsl:value-of select="$fill"/>
-  </xsl:if>
-</xsl:template>
-
 <xsl:template name="line-wrap">
   <xsl:param name="line-length"/> <!-- required -->
   <xsl:param name="first-line-length" select="$line-length"/>
 <xsl:template name="line-wrap">
   <xsl:param name="line-length"/> <!-- required -->
   <xsl:param name="first-line-length" select="$line-length"/>