Blame view

swigra/parser/genparser 1.03 KB
Jan Lupa authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#! /bin/bash
#
# Author: Marcin Woliński
# This file is in the public domain.

export swigradir=`dirname $0`

parser=swigra2_batch_nkjp
grammar=gfjp2

while getopts :12g: OPT; do
    case $OPT in
	1) 
	    parser=swigra_batch
	    grammar=gfjp
	    ;;
	2)
	    grammar=gfjp2
# z gotowymi interpretacjami z NKJP:
	    parser=swigra2_batch_nkjp
# z Morfeuszem:
#	    parser=swigra2_batch
	    ;;
	g)
	    grammar=$OPTARG
	    parser=$OPTARG_modules
	    ;;
	*)
	echo "usage: ${0##*/} [-12] [-g grammar]"
	exit 2
    esac
done
shift $(( OPTIND - 1 ))
OPTIND=1


if [ $# -gt 0 ]; then
  echo "usage: ${0##*/} [-12] [-g grammar]"
  exit 1
fi

./birnam_dcg2pl $grammar.dcg
#./genslowczas
./genslow s_rzecz >slowrzecz.pl
./genslow s_przym >slowprzym.pl
./genslow s_wykrz >slowwykrz.pl

echo Building $parser parser:
cat <<EOF >mkprsr-$$.pl
:-[$parser].
:-qsave_program('$grammar-bin').
:-halt.
EOF

#sicstus -l mkprsr-$$.pl
swipl --traditional -F none -s mkprsr-$$.pl

rm mkprsr-$$.pl

### Local Variables: 
### coding: utf-8
### mode: shell-script
### End: