-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
some new tools: ASF+SDF wrappers and extractor
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@156 ab42f6e0-554d-0410-b580-99e487e6eeb2
- Loading branch information
1 parent
de361ae
commit ccefcaf
Showing
3 changed files
with
72 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# Get our hands on basedir | ||
LOCAL1=${PWD} | ||
cd `dirname $0` | ||
cd ../.. | ||
SLPS=${PWD} | ||
cd topics/fl/asfsdf | ||
SDF=${PWD} | ||
cd ${LOCAL1} | ||
|
||
if [ $# -ne 3 ]; then | ||
echo "This script wraps up the ASF+SDF evaluator" | ||
echo "Usage: $0 <context> <input> <yields>" | ||
exit 1 | ||
elif [ ! -r $1 ]; then | ||
echo "Oops: $1 not found or not readable." | ||
exit 1 | ||
fi | ||
|
||
cat $1 > tempfile1 | ||
echo -n "evaluator x = " >> tempfile1 | ||
cat $2 >> tempfile1 | ||
cat tempfile1 | python ${SDF}/pre.py | sglr -p ${SDF}/FL.tbl | asfe -e ${SDF}/FL.eqs | unparsePT | python ${SDF}/post.py | grep "evaluator x" | awk '{print $4}' > tempfile2 | ||
echo $3 > tempfile1 | ||
diff tempfile1 tempfile2 | ||
rm -f tempfile1 tempfile2 | ||
|
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,22 @@ | ||
#!/bin/sh | ||
|
||
# Get our hands on basedir | ||
LOCAL1=${PWD} | ||
cd `dirname $0` | ||
cd ../.. | ||
SLPS=${PWD} | ||
cd topics/fl/asfsdf | ||
SDF=${PWD} | ||
cd ${LOCAL1} | ||
|
||
if [ $# -ne 2 ]; then | ||
echo "This script wraps up the ASF+SDF parser" | ||
echo "Usage: $0 <input> <output>" | ||
exit 1 | ||
elif [ ! -r $1 ]; then | ||
echo "Oops: $1 not found or not readable." | ||
exit 1 | ||
fi | ||
|
||
cat $1 | python ${SDF}/pre.py | sglr -p ${SDF}/FL.tbl | asfe -e ${SDF}/FL.eqs | unparsePT | python ${SDF}/post.py > $2 | ||
|
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,22 @@ | ||
#! /bin/sh | ||
|
||
# Get our hands on basedir | ||
LOCAL1=${PWD} | ||
cd `dirname $0` | ||
cd ../../topics/extraction/sdf2bgf | ||
XTR=${PWD} | ||
cd ${LOCAL1} | ||
|
||
if [ $# -ne 2 ]; then | ||
echo "Usage: sdf2bgf <SDF-input> <BGF-output>" | ||
exit 1 | ||
elif [ ! -r $1 ]; then | ||
echo "Oops: $1 not found or not readable." | ||
exit 1 | ||
else | ||
# Build extractor if needed | ||
cd ${XTR} | ||
make build | ||
cd ${LOCAL1} | ||
(echo "main("; cat $1; echo ")" ) | sglr -p ${XTR}/Main.tbl | asfe -e ${XTR}/Main.eqs | unparsePT > $2 | ||
fi |