Skip to content

Commit

Permalink
more advanced (with imports) Rascal generation needed for the islands…
Browse files Browse the repository at this point in the history
… story

git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@1191 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Apr 4, 2012
1 parent c011b6e commit ecdc663
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
22 changes: 22 additions & 0 deletions topics/export/hypertext/bgf2xhtml.xslt
Expand Up @@ -96,6 +96,28 @@
<xsl:text>*</xsl:text>
</span>
</xsl:template>
<xsl:template match="sepliststar">
<span xmlns="http://www.w3.org/1999/xhtml" class="meta">
<xsl:text>{</xsl:text>
</span>
<xsl:apply-templates select="*[1]"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="*[2]"/>
<span xmlns="http://www.w3.org/1999/xhtml" class="meta">
<xsl:text>}*</xsl:text>
</span>
</xsl:template>
<xsl:template match="seplistplus">
<span xmlns="http://www.w3.org/1999/xhtml" class="meta">
<xsl:text>{</xsl:text>
</span>
<xsl:apply-templates select="*[1]"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="*[2]"/>
<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="./*"/>
<span xmlns="http://www.w3.org/1999/xhtml" class="meta">
Expand Down
8 changes: 8 additions & 0 deletions topics/export/rascal/bgf2rsc.xslt
Expand Up @@ -2,6 +2,7 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bgf="http://planet-sl.org/bgf" xmlns:xhtml="http://www.w3.org/1999/xhtml" version="1.0">
<xsl:output method="text" encoding="UTF-8" omit-xml-declaration="yes"/>
<xsl:param name="grammarname"/>
<xsl:param name="imports" default="''"/>
<xsl:template match="/bgf:grammar">
<xsl:text>@contributor{bgf2src automated exporter - SLPS}
module </xsl:text>
Expand All @@ -11,6 +12,13 @@ module </xsl:text>
<xsl:text>

</xsl:text>
<xsl:if test="$imports">
<xsl:text>import </xsl:text>
<xsl:value-of select="$imports"/>
<xsl:text>

</xsl:text>
</xsl:if>
<xsl:apply-templates select="./bgf:*"/>
</xsl:template>
<xsl:template match="bgf:production">
Expand Down
3 changes: 2 additions & 1 deletion topics/island/csharp-ecma-334-1/Makefile
Expand Up @@ -27,9 +27,10 @@ cs.9.bgf: cs.7.bgf
../../mutation/inline-trivial/inline.py cs.8.bgf inline-chains.xbgf
xbgf inline-chains.xbgf cs.8.bgf cs.9.bgf

cs.a.bgf: cs.9.bgf
cs.rsc: cs.9.bgf
../../mutation/naming/enforce.py l- C! cs.9.bgf enforce-naming.xbgf
xbgf enforce-naming.xbgf cs.9.bgf cs.a.bgf
xsltproc --stringparam grammarname CS --stringparam imports IslandLibrary ../../export/rascal/bgf2rsc.xslt cs.a.bgf > cs.b.rsc

cs.adt1.bgf: cs.8.bgf
../../mutation/anf/anf.py cs.8.bgf cs.anf.xbgf
Expand Down

0 comments on commit ecdc663

Please sign in to comment.