Permalink
Browse files

fixed broken scripts; finished half-done ones

git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@797 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information...
grammarware committed May 9, 2010
1 parent 775dffe commit d0072651f0afb23f387c24bbddea07f31929eba3
Showing with 63 additions and 7 deletions.
  1. +9 −2 shared/xsl/bgf2dms.xslt
  2. +8 −1 shared/xsl/bgf2sdf.xslt
  3. +46 −4 shared/xsl/bgf2xhtml.xslt
View
@@ -27,7 +27,7 @@
<xsl:choose>
<xsl:when test="./bgf:expression/choice">
<xsl:for-each select="./bgf:expression/choice/bgf:expression">
<xsl:value-of select="./nonterminal"/>
<xsl:value-of select="../../../nonterminal"/>
<xsl:text> = </xsl:text>
<xsl:call-template name="no-parenthesis">
<xsl:with-param name="expr" select="."/>
@@ -108,7 +108,14 @@
</xsl:template>
<xsl:template match="nonterminal">
<xsl:value-of select="."/>
<xsl:choose>
<xsl:when test="text() = 'identifier'">
<xsl:text>IDENTIFIER</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="selectable">
View
@@ -52,9 +52,14 @@ exports
<xsl:template match="bgf:production">
<xsl:choose>
<xsl:when test="./bgf:expression/choice">
<xsl:for-each select="./bgf:expression/choice/bgf:expression">
<xsl:text>
</xsl:text>
<xsl:call-template name="no-parenthesis">
<xsl:with-param name="expr" select="./bgf:expression/choice/bgf:expression[1]"/>
</xsl:call-template>
<xsl:for-each select="./bgf:expression/choice/bgf:expression[position()>1]">
<xsl:text>
| </xsl:text>
<xsl:call-template name="no-parenthesis">
<xsl:with-param name="expr" select="."/>
</xsl:call-template>
@@ -77,6 +82,8 @@ exports
<xsl:value-of select="./label"/>
<xsl:text>)}</xsl:text>
</xsl:if>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="bgf:expression">
View
@@ -11,7 +11,43 @@
/>
<xsl:template match="/bgf:grammar">
<xsl:apply-templates select="./bgf:*"/>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Browsable Grammar</title>
<style type="text/css">
h1, table { text-align: center; }
.label, .sel { color: green; }
.marked { background-color: #FFE5B4;}
.nt { color: blue; font-weight: bold; }
.t { color: red; font-style:italic; }
.meta { color: green; font-style:italic; font-family: Roman, "Times New Roman", serif; }
h6 { text-align: right; }
.date { font-size: small; }
.note
{
text-align: right;
font-weight: bold;
margin: 0px;
}
.frame, pre
{
border: 1px solid black;
border-spacing: 2px;
border-collapse: collapse;
background-color: #ECECEC;
}
</style>
</head>
<body>
<xsl:for-each select="./bgf:*">
<pre>
<xsl:apply-templates select="."/>
</pre>
</xsl:for-each>
</body>
</html>
</xsl:template>
<xsl:template match="bgf:production">
@@ -62,17 +98,23 @@
<xsl:template match="plus">
<xsl:apply-templates select="./*"/>
<xsl:text>+</xsl:text>
<span xmlns="http://www.w3.org/1999/xhtml" class="meta">
<xsl:text>+</xsl:text>
</span>
</xsl:template>
<xsl:template match="star">
<xsl:apply-templates select="./*"/>
<xsl:text>*</xsl:text>
<span xmlns="http://www.w3.org/1999/xhtml" class="meta">
<xsl:text>*</xsl:text>
</span>
</xsl:template>
<xsl:template match="optional">
<xsl:apply-templates select="./*"/>
<xsl:text>?</xsl:text>
<span xmlns="http://www.w3.org/1999/xhtml" class="meta">
<xsl:text>?</xsl:text>
</span>
</xsl:template>
<xsl:template match="terminal">

0 comments on commit d007265

Please sign in to comment.