1
0
forked from GitHub/gf-core

new tutorial example

This commit is contained in:
aarne
2005-12-18 21:26:21 +00:00
parent e4314a739d
commit de6b09f650
34 changed files with 940 additions and 668 deletions

4
doc/tutorial/old/Fish.gf Normal file
View File

@@ -0,0 +1,4 @@
abstract Fish = {
cat Fish ;
fun Salmon, Perch : Fish ;
}

View File

@@ -0,0 +1,5 @@
concrete FishEng of Fish = {
lin
Salmon = {s = "salmon"} ;
Perch = {s = "perch"} ;
}

View File

@@ -0,0 +1,5 @@
abstract Gatherer = Paleolithic, Fish, Mushrooms ** {
fun
FishCN : Fish -> CN ;
MushroomCN : Mushroom -> CN ;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,5 @@
concrete GathererEng of Gatherer = PaleolithicEng, FishEng, MushroomsEng ** {
lin
UseFish x = x ;
UseMushroom x = x ;
}

View File

@@ -0,0 +1,4 @@
abstract Mushrooms = {
cat Mushroom ;
fun Cep, Agaric : Mushroom ;
}

View File

@@ -0,0 +1,5 @@
concrete MushroomsEng of Mushrooms = {
lin
Cep = {s = "cep"} ;
Agaric = {s = "agaric"} ;
}

View File

@@ -0,0 +1,5 @@
abstract Neolithic = Paleolithic ** {
fun
Fire, Wheel : CN ;
Think : V ;
}

View File

@@ -0,0 +1,6 @@
concrete NeolithicEng of Neolithic = PaleolithicEng ** {
lin
Fire = {s = "fire"} ;
Wheel = {s = "wheel"} ;
Think = {s = "thinks"} ;
}

View File

@@ -0,0 +1,16 @@
abstract Paleolithic = {
cat
S ; NP ; VP ; CN ; A ; V ; TV ;
fun
PredVP : NP -> VP -> S ;
UseV : V -> VP ;
ComplTV : TV -> NP -> VP ;
UseA : A -> VP ;
ModA : A -> CN -> CN ;
This, That, Def, Indef : CN -> NP ;
Boy, Louse, Snake, Worm : CN ;
Green, Rotten, Thick, Warm : A ;
Laugh, Sleep, Swim : V ;
Eat, Kill, Wash : TV ;
}

View File

@@ -0,0 +1,28 @@
concrete PaleolithicEng of Paleolithic = {
lincat
S, NP, VP, CN, A, V, TV = {s : Str} ;
lin
PredVP np vp = {s = np.s ++ vp.s} ;
UseV v = v ;
ComplTV tv np = {s = tv.s ++ np.s} ;
UseA a = {s = "is" ++ a.s} ;
This cn = {s = "this" ++ cn.s} ;
That cn = {s = "that" ++ cn.s} ;
Def cn = {s = "the" ++ cn.s} ;
Indef cn = {s = "a" ++ cn.s} ;
ModA a cn = {s = a.s ++ cn.s} ;
Boy = {s = "boy"} ;
Louse = {s = "louse"} ;
Snake = {s = "snake"} ;
Worm = {s = "worm"} ;
Green = {s = "green"} ;
Rotten = {s = "rotten"} ;
Thick = {s = "thick"} ;
Warm = {s = "warm"} ;
Laugh = {s = "laughs"} ;
Sleep = {s = "sleeps"} ;
Swim = {s = "swims"} ;
Eat = {s = "eats"} ;
Kill = {s = "kills"} ;
Wash = {s = "washes"} ;
}

View File

@@ -0,0 +1,28 @@
concrete PaleolithicIta of Paleolithic = {
lincat
S, NP, VP, CN, A, V, TV = {s : Str} ;
lin
PredVP np vp = {s = np.s ++ vp.s} ;
UseV v = v ;
ComplTV tv np = {s = tv.s ++ np.s} ;
UseA a = {s = "è" ++ a.s} ;
This cn = {s = "questo" ++ cn.s} ;
That cn = {s = "quello" ++ cn.s} ;
Def cn = {s = "il" ++ cn.s} ;
Indef cn = {s = "un" ++ cn.s} ;
ModA a cn = {s = cn.s ++ a.s} ;
Boy = {s = "ragazzo"} ;
Louse = {s = "pidocchio"} ;
Snake = {s = "serpente"} ;
Worm = {s = "verme"} ;
Green = {s = "verde"} ;
Rotten = {s = "marcio"} ;
Thick = {s = "grosso"} ;
Warm = {s = "caldo"} ;
Laugh = {s = "ride"} ;
Sleep = {s = "dorme"} ;
Swim = {s = "nuota"} ;
Eat = {s = "mangia"} ;
Kill = {s = "uccide"} ;
Wash = {s = "lava"} ;
}

View File

@@ -0,0 +1,23 @@
PredVP. S ::= NP VP ;
UseV. VP ::= V ;
ComplTV. VP ::= TV NP ;
UseA. VP ::= "is" A ;
This. NP ::= "this" CN ;
That. NP ::= "that" CN ;
Def. NP ::= "the" CN ;
Indef. NP ::= "a" CN ;
ModA. CN ::= A CN ;
Boy. CN ::= "boy" ;
Louse. CN ::= "louse" ;
Snake. CN ::= "snake" ;
Worm. CN ::= "worm" ;
Green. A ::= "green" ;
Rotten. A ::= "rotten" ;
Thick. A ::= "thick" ;
Warm. A ::= "warm" ;
Laugh. V ::= "laughs" ;
Sleep. V ::= "sleeps" ;
Swim. V ::= "swims" ;
Eat. TV ::= "eats" ;
Kill. TV ::= "kills"
Wash. TV ::= "washes" ;

View File

@@ -0,0 +1,8 @@
S ::= NP VP ;
VP ::= V | TV NP | "is" A ;
NP ::= ("this" | "that" | "the" | "a") CN ;
CN ::= A CN ;
CN ::= "boy" | "louse" | "snake" | "worm" ;
A ::= "green" | "rotten" | "thick" | "warm" ;
V ::= "laughs" | "sleeps" | "swims" ;
TV ::= "eats" | "kills" | "washes" ;