Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added a Makefile to LDF->BGF dir, which otherwise is empty
since the sheet is shared/xsl and the script is in shared/tools. It has a test target that searches for all LDFs in SLPS, extracts BGFs from them and validates the results. * Added test target to XSD repository that validates all schemata. * Fixed tiny bug in LDF2BGF sheet that copied language attribute of <bgf:grammar>. I have a feeling that it was more of a a feature andeventually we'll need to change BGF schema to reflect that. * Upgraded ldf2bgf script so that it can accept one parameter. In such a case it produces a file in the directory from which it is run with a name of the source and a proper extension. git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@84 ab42f6e0-554d-0410-b580-99e487e6eeb2
- Loading branch information
1 parent
533c720
commit 7abcef4
Showing
5 changed files
with
38 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
#! /bin/sh | ||
#!/bin/sh | ||
|
||
# Get our hands on the languedoc basedir | ||
LOCAL=${PWD} | ||
cd `dirname $0` | ||
cd ../.. | ||
SLPS=${PWD} | ||
cd ${LOCAL} | ||
|
||
if [ $# -ne 2 ]; then | ||
echo "This tool transforms Language Document Format to BNF-like Grammar Format" | ||
echo "Usage: ldf2bgf <input-language-document> <output-grammar>" | ||
exit 1 | ||
elif [ ! -r $1 ]; then | ||
if [ ! -r $1 ]; then | ||
echo "Oops: $1 not found or not readable." | ||
exit 1 | ||
else | ||
elif [ $# -eq 2 ] | ||
then | ||
rm -f $2 | ||
xsltproc ${SLPS}/shared/xsl/ldf2bgf.xslt $1 > $2 | ||
elif [ $# -eq 1 ] | ||
then | ||
xsltproc ${SLPS}/shared/xsl/ldf2bgf.xslt $1 > ${LOCAL}/`basename $1 .ldf`.bgf | ||
else | ||
echo "This tool transforms Language Document Format to BNF-like Grammar Format" | ||
echo "Usage: ldf2bgf <input-language-document> [<output-grammar>]" | ||
exit 2 | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
validator = ../../download/msv/msv.jar | ||
|
||
build: | ||
|
||
test: | ||
ls -1 *.xsd | xargs -n1 java -jar ${validator} | ||
|
||
clean: | ||
rm -rf bin | ||
rm -rf obj | ||
rm -rf *.user | ||
rm -rf *.suo | ||
rm -rf bin obj | ||
rm -f *.user | ||
rm -f *.suo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ build: | |
test: | ||
|
||
clean: | ||
|
||
rm -rf bin obj | ||
rm -f *.user | ||
rm -f *.suo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ldf2bgf = ../../../shared/tools/ldf2bgf | ||
validator = ../../../download/msv/msv.jar | ||
bgfxsd = ../../../shared/xsd/bgf.xsd | ||
|
||
all: | ||
make clean | ||
make test | ||
|
||
test: | ||
find ../../.. -name "*.ldf" | xargs -n1 ${ldf2bgf} | ||
ls -1 *.bgf | xargs java -jar ${validator} ${bgfxsd} | ||
|
||
clean: | ||
rm -f *.bgf |