forked from GitHub/gf-core
new tutorial example
This commit is contained in:
4
doc/tutorial/old/Fish.gf
Normal file
4
doc/tutorial/old/Fish.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
abstract Fish = {
|
||||
cat Fish ;
|
||||
fun Salmon, Perch : Fish ;
|
||||
}
|
||||
5
doc/tutorial/old/FishEng.gf
Normal file
5
doc/tutorial/old/FishEng.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
concrete FishEng of Fish = {
|
||||
lin
|
||||
Salmon = {s = "salmon"} ;
|
||||
Perch = {s = "perch"} ;
|
||||
}
|
||||
5
doc/tutorial/old/Gatherer.gf
Normal file
5
doc/tutorial/old/Gatherer.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
abstract Gatherer = Paleolithic, Fish, Mushrooms ** {
|
||||
fun
|
||||
FishCN : Fish -> CN ;
|
||||
MushroomCN : Mushroom -> CN ;
|
||||
}
|
||||
BIN
doc/tutorial/old/Gatherer.gif
Normal file
BIN
doc/tutorial/old/Gatherer.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
5
doc/tutorial/old/GathererEng.gf
Normal file
5
doc/tutorial/old/GathererEng.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
concrete GathererEng of Gatherer = PaleolithicEng, FishEng, MushroomsEng ** {
|
||||
lin
|
||||
UseFish x = x ;
|
||||
UseMushroom x = x ;
|
||||
}
|
||||
4
doc/tutorial/old/Mushrooms.gf
Normal file
4
doc/tutorial/old/Mushrooms.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
abstract Mushrooms = {
|
||||
cat Mushroom ;
|
||||
fun Cep, Agaric : Mushroom ;
|
||||
}
|
||||
5
doc/tutorial/old/MushroomsEng.gf
Normal file
5
doc/tutorial/old/MushroomsEng.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
concrete MushroomsEng of Mushrooms = {
|
||||
lin
|
||||
Cep = {s = "cep"} ;
|
||||
Agaric = {s = "agaric"} ;
|
||||
}
|
||||
5
doc/tutorial/old/Neolithic.gf
Normal file
5
doc/tutorial/old/Neolithic.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
abstract Neolithic = Paleolithic ** {
|
||||
fun
|
||||
Fire, Wheel : CN ;
|
||||
Think : V ;
|
||||
}
|
||||
6
doc/tutorial/old/NeolithicEng.gf
Normal file
6
doc/tutorial/old/NeolithicEng.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
concrete NeolithicEng of Neolithic = PaleolithicEng ** {
|
||||
lin
|
||||
Fire = {s = "fire"} ;
|
||||
Wheel = {s = "wheel"} ;
|
||||
Think = {s = "thinks"} ;
|
||||
}
|
||||
16
doc/tutorial/old/Paleolithic.gf
Normal file
16
doc/tutorial/old/Paleolithic.gf
Normal 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 ;
|
||||
}
|
||||
28
doc/tutorial/old/PaleolithicEng.gf
Normal file
28
doc/tutorial/old/PaleolithicEng.gf
Normal 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"} ;
|
||||
}
|
||||
28
doc/tutorial/old/PaleolithicIta.gf
Normal file
28
doc/tutorial/old/PaleolithicIta.gf
Normal 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"} ;
|
||||
}
|
||||
23
doc/tutorial/old/paleolithic.cf
Normal file
23
doc/tutorial/old/paleolithic.cf
Normal 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" ;
|
||||
8
doc/tutorial/old/paleolithic.ebnf
Normal file
8
doc/tutorial/old/paleolithic.ebnf
Normal 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" ;
|
||||
Reference in New Issue
Block a user