Skip to content

Commit

Permalink
encoded dependencies on XPath and XQuery processors
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@775 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Feb 22, 2010
1 parent 353a2c2 commit 1989dd9
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
3 changes: 3 additions & 0 deletions shared/tools/asfix2btf
Expand Up @@ -13,6 +13,9 @@ if [ $# -ne 3 ]; then
elif [ ! -r $2 ]; then
echo "Oops: $2 not found or not readable."
exit 1
elif [ -z `which asfe` ] || [ -z `which sglr` ] || [ -z `which unparsePT` ]; then
echo 'Need these tools in path: sglr, asfe, unparsePT.'
exit 2
else
# Build extractor if needed
cd ${SLPS}/topics/extraction/asfix2btf
Expand Down
11 changes: 11 additions & 0 deletions shared/tools/bgflc
Expand Up @@ -14,6 +14,16 @@ if [ $# -ne 1 ]; then
elif [ ! -r $1 ]; then
echo "Oops: $1 not found or not readable."
exit 1
elif [ `uname` == "Linux" ] ; then
echo -n "Total productions: "
xpath -e `cat ${SLPS}/topics/presentation/metrics/productions.xpath` $1 2> /dev/null
echo -n "Total nonterminals: "
xpath -e `cat ${SLPS}/topics/presentation/metrics/nonterminals.xpath` $1 2> /dev/null
echo -n "Top nonterminals: "
xpath -e `cat ${SLPS}/topics/presentation/metrics/top.xpath` $1 2> /dev/null
echo -n "Bottom nonterminals: "
xpath -e `cat ${SLPS}/topics/presentation/metrics/bottom.xpath` $1 2> /dev/null
echo
else
/bin/echo -n "Total productions: "
xpath $1 `cat ${SLPS}/topics/presentation/metrics/productions.xpath` 2> /dev/null
Expand All @@ -23,4 +33,5 @@ else
xpath $1 `cat ${SLPS}/topics/presentation/metrics/top.xpath` 2> /dev/null
/bin/echo -n "Bottom nonterminals: "
xpath $1 `cat ${SLPS}/topics/presentation/metrics/bottom.xpath` 2> /dev/null
echo
fi
3 changes: 3 additions & 0 deletions shared/tools/sdf2bgf
Expand Up @@ -11,6 +11,9 @@ if [ $# -le 1 ]; then
echo "This extractor gives a BGF for a list of SDF modules"
echo "Usage: sdf2bgf <SDF-module> [<SDF-module> ...] <BGF-output>"
exit 1
elif [ -z `which asfe` ] || [ -z `which sglr` ] || [ -z `which unparsePT` ]; then
echo 'Need these tools in path: sglr, asfe, unparsePT.'
exit 2
else
# Build extractor if needed
cd ${XTR}
Expand Down
8 changes: 6 additions & 2 deletions shared/tools/xbgfi
Expand Up @@ -16,9 +16,13 @@ elif [ ! -r $1 ]; then
exit 1
else
/bin/echo -n "Number of lines: "
wc -l $1
wc -l $1 | awk '{print $1}'
/bin/echo -n "Number of transformations: "
xpath $1 `cat ${SLPS}/topics/presentation/metrics/transformations.xpath` 2> /dev/null
if [ `uname` == "Linux" ] ; then
xpath -e `cat ${SLPS}/topics/presentation/metrics/transformations.xpath` $1 2> /dev/null
else
xpath $1 `cat ${SLPS}/topics/presentation/metrics/transformations.xpath` 2> /dev/null
fi
/bin/echo -n "Number of unsafe optimizations: "
grep -c BREFACTOR $1
/bin/echo -n "Number of issues (1): "
Expand Down
12 changes: 10 additions & 2 deletions shared/tools/xbgflc
Expand Up @@ -20,7 +20,15 @@ else
/bin/echo -n "Total issues solved: "
cat $1 | grep -c "<\!--"
/bin/echo -n "Total transformations: "
xpath $1 `cat ${SLPS}/topics/presentation/metrics/transformations.xpath` 2> /dev/null
if [ `uname` == "Linux" ] ; then
xpath -e `cat ${SLPS}/topics/presentation/metrics/transformations.xpath` $1 2> /dev/null
else
xpath $1 `cat ${SLPS}/topics/presentation/metrics/transformations.xpath` 2> /dev/null
fi
/bin/echo "XBGF commands statistics:"
galax-run ${SLPS}/topics/presentation/metrics/perxbgfcommand.xq -serialize wf -doc xsd=${SLPS}/shared/xsd/xbgf.xsd -doc xbgf=$1 -language dxq | grep -v "glx:result"
if [ -z `which galax-run`] ; then
echo ' Unavailable, please install Galax!'
else
galax-run ${SLPS}/topics/presentation/metrics/perxbgfcommand.xq -serialize wf -doc xsd=${SLPS}/shared/xsd/xbgf.xsd -doc xbgf=$1 -language dxq | grep -v "glx:result"
fi
fi

0 comments on commit 1989dd9

Please sign in to comment.