Skip to content

Commit

Permalink
more pretty-printing
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@631 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed May 15, 2009
1 parent b831de7 commit 9565271
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 35 deletions.
28 changes: 28 additions & 0 deletions shared/tools/xbgf2tex
@@ -0,0 +1,28 @@
#!/bin/sh

LOCAL=${PWD}
cd `dirname $0`
cd ../..
SLPS=${PWD}
cd ${LOCAL}

if [ $# -eq 1 ]; then
OUTPUT=/dev/stdout
elif [ $# -ne 2 ]; then
echo "This tool transforms Transformational BGF documents to includable TeX files."
echo "Usage: xbgf2tex <input-xbgf-document> [<output-tex>]"
echo "When output file is not specified, stdout is used."
exit 1
else
OUTPUT=$2
fi
if [ ! -r $1 ]; then
echo "Oops: $1 not found or not readable."
exit 1
fi

echo '\\begin{graybox}' > ${OUTPUT}
echo '\\begin{lstlisting}[language=pp]' >> ${OUTPUT}
xsltproc ${SLPS}/shared/xsl/xbgf2xbnf.xslt $1 >> ${OUTPUT}
echo '\\end{lstlisting}' >> ${OUTPUT}
echo '\\end{graybox}' >> ${OUTPUT}
70 changes: 35 additions & 35 deletions topics/fl/lci/fl.lcf
Expand Up @@ -196,6 +196,41 @@
</source
-->

<target>
<name>topdown</name>
<branch>
<input>dcg</input>
</branch>
<branch>
<input>antlr</input>
<nominal-matching>
<perform>renameAntlr</perform>
</nominal-matching>
<structural-matching>
<perform>preferDcg</perform>
</structural-matching>
</branch>
</target>

<target>
<name>concrete</name>
<branch>
<input>topdown</input>
<structural-matching>
<perform>removeLayers</perform>
</structural-matching>
</branch>
<branch>
<input>sdf</input>
<nominal-matching>
<automated>
<method>case</method>
<result>renameSdf</result>
</automated>
</nominal-matching>
</branch>
</target>

<target>
<name>java</name>
<branch>
Expand Down Expand Up @@ -247,41 +282,6 @@
</branch>
</target>

<target>
<name>topdown</name>
<branch>
<input>dcg</input>
</branch>
<branch>
<input>antlr</input>
<nominal-matching>
<perform>renameAntlr</perform>
</nominal-matching>
<structural-matching>
<perform>preferDcg</perform>
</structural-matching>
</branch>
</target>

<target>
<name>concrete</name>
<branch>
<input>topdown</input>
<structural-matching>
<perform>removeLayers</perform>
</structural-matching>
</branch>
<branch>
<input>sdf</input>
<nominal-matching>
<automated>
<method>case</method>
<result>renameSdf</result>
</automated>
</nominal-matching>
</branch>
</target>

<target>
<name>limit</name>
<branch>
Expand Down

0 comments on commit 9565271

Please sign in to comment.