Skip to content

Commit

Permalink
parsers will be parsers
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@201 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Aug 21, 2008
1 parent 0e1003d commit 84517f4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
7 changes: 4 additions & 3 deletions shared/tools/runantlrparser
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ cd ../..
SLPS=${PWD}
cd ${LOCAL1}

if [ $# -ne 2 ]; then
if [ $# -ne 1 ]; then
echo "This script wraps up the ANTLR (java1) parser"
echo "Usage: $0 <input> <output>"
echo "Usage: $0 <input>"
exit 1
elif [ ! -r $1 ]; then
echo "Oops: $1 not found or not readable."
exit 1
fi

java -cp ${CLASSPATH}:${SLPS}/topics/fl/java1/javafl.jar -ea TestIO $1 $2
java -cp ${CLASSPATH}:${SLPS}/topics/fl/java1/javafl.jar -ea TestIO $1 $1.parsed
rm -f $1.parsed
6 changes: 3 additions & 3 deletions shared/tools/runasfsdfparser
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ cd topics/fl/asfsdf
SDF=${PWD}
cd ${LOCAL1}

if [ $# -ne 2 ]; then
if [ $# -ne 1 ]; then
echo "This script wraps up the ASF+SDF parser"
echo "Usage: $0 <input> <output>"
echo "Usage: $0 <input>"
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 -A | unparsePT | python ${SDF}/post.py > $2
cat $1 | python ${SDF}/pre.py | sglr -p ${SDF}/FL.tbl -A | unparsePT | python ${SDF}/post.py > /dev/null

7 changes: 4 additions & 3 deletions shared/tools/runprologparser
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ cd ../..
SLPS=${PWD}
cd ${LOCAL1}

if [ $# -ne 2 ]; then
if [ $# -ne 1 ]; then
echo "This script wraps up the Prolog (dcg) parser"
echo "Usage: $0 <input> <output>"
echo "Usage: $0 <input>"
exit 1
elif [ ! -r $1 ]; then
echo "Oops: $1 not found or not readable."
exit 1
fi

swipl -q -f ${SLPS}/topics/fl/prolog1/TestIO.pro -t "main('$1','$2')"
swipl -q -f ${SLPS}/topics/fl/prolog1/TestIO.pro -t "main('$1','$1.parsed')"
rm -f $1.parsed
21 changes: 21 additions & 0 deletions shared/tools/runxsdparser
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/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 1 ]; then
echo "This script wraps up the XML parser"
echo "Usage: $0 <input>"
exit 1
elif [ ! -r $1 ]; then
echo "Oops: $1 not found or not readable."
exit 1
fi

xmllint --noout --schema ${SLPS}/topics/fl/xsd/fl.xsd $1 1> /dev/null 2> /dev/null

0 comments on commit 84517f4

Please sign in to comment.