1
0
forked from GitHub/gf-core

Add support for BIND

This commit is contained in:
John J. Camilleri
2021-02-13 00:14:35 +01:00
parent 8cfaa69b6e
commit 98f6136ebd
8 changed files with 34 additions and 3 deletions

7
testsuite/lpgf/Bind.gf Normal file
View File

@@ -0,0 +1,7 @@
abstract Bind = {
cat S ; F ;
fun
FtoS : F -> S ;
f1 : F ;
f2 : F ;
}

View File

@@ -0,0 +1,6 @@
Bind: FtoS f1
BindCnc: hello there
Bind: FtoS f2
BindCnc: good bye

View File

@@ -0,0 +1,2 @@
FtoS f1
FtoS f2

View File

@@ -0,0 +1,9 @@
concrete BindCnc of Bind = open Prelude in {
lincat
S = Str ;
F = { s : Str } ;
lin
f1 = { s = "hello the" ++ BIND ++ "re" } ;
f2 = { s = "good" ++ "bye" } ;
FtoS f = f.s ;
}

View File

@@ -12,7 +12,7 @@ TREEBANK="$ABSNAME.treebank"
: > $TREEBANK
while read tree; do
echo "linearize -treebank $tree | write_file -file=$TREEBANK -append" | gf --run $ABSNAME*.gf > /dev/null
echo "linearize -treebank -bind $tree | write_file -file=$TREEBANK -append" | gf --run $ABSNAME*.gf | awk NF
echo "" >> $TREEBANK
done < $TREES

View File

@@ -15,6 +15,7 @@ dir = "testsuite" </> "lpgf"
main :: IO ()
main = do
doGrammar "Bind"
doGrammar "Tables"
doGrammar "Params"
doGrammar "Walking"