Skip to content

Commit

Permalink
minor pending updates of some tools
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@1020 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Apr 15, 2011
1 parent 4878a80 commit 1b8e679
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions shared/tools/rsc2bgf
@@ -0,0 +1,21 @@
#!/bin/sh

# Get our hands on basedir
LOCAL1=${PWD}
cd `dirname $0`
cd ../..
SLPS=${PWD}
cd ${LOCAL1}

if [ $# -ne 2 ]; then
echo "This tool produces a BGF grammar from a Rascal grammar"
echo "Usage:"
echo " rsc2bgf <input-rsc> <output-bgf>"
exit 1
elif [ ! -r $1 ]; then
echo "Oops: $1 not found or not readable."
exit 1
else
python ${SLPS}/topics/extraction/rascal/extract.py $1 $2
fi

2 changes: 1 addition & 1 deletion topics/extraction/rascal/extract.py
@@ -1,7 +1,7 @@
#!/usr/local/bin/python
import os
import sys
sys.path.append('../../../shared/python')
sys.path.append(os.getcwd().split('projects')[0]+'projects/slps/shared/python')
import slpsns
import BGF
import elementtree.ElementTree as ET
Expand Down
1 change: 1 addition & 0 deletions topics/investigation/analysis/present_bgf.py
Expand Up @@ -28,3 +28,4 @@
print '%20s:' % 'dead top', mb.DEAD(), pa(mb.getDeadTops())
else:
print '%20s:' % 'dead top', mb.DEAD()
print 'Terminals used: ',mb.TERM()

0 comments on commit 1b8e679

Please sign in to comment.