summaryrefslogtreecommitdiff
path: root/examples/regulus/toy0/no-resource
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2007-06-27 12:38:24 +0000
committerbringert <bringert@cs.chalmers.se>2007-06-27 12:38:24 +0000
commit54d53251718dce4fcfda941eb9c21abe8eb939ed (patch)
treedc5c8eebca401909dcf8dce25bd86bd0d02fe4a6 /examples/regulus/toy0/no-resource
parent67857cb1465cede016bc9a0c0b71b08813089df0 (diff)
Moved the different versions of the toy0 concrete modules to different subdirectories.
Diffstat (limited to 'examples/regulus/toy0/no-resource')
-rw-r--r--examples/regulus/toy0/no-resource/Toy0Eng.gf28
-rw-r--r--examples/regulus/toy0/no-resource/Toy0Fre.gf30
-rw-r--r--examples/regulus/toy0/no-resource/Toy0Ger.gf31
-rw-r--r--examples/regulus/toy0/no-resource/Toy0_eng.gf39
4 files changed, 128 insertions, 0 deletions
diff --git a/examples/regulus/toy0/no-resource/Toy0Eng.gf b/examples/regulus/toy0/no-resource/Toy0Eng.gf
new file mode 100644
index 000000000..e6fa01b8d
--- /dev/null
+++ b/examples/regulus/toy0/no-resource/Toy0Eng.gf
@@ -0,0 +1,28 @@
+--# -path=..
+concrete Toy0Eng of Toy0 = {
+
+param
+ Number = Sg | Pl ;
+
+lincat
+ Spec = {s : Str ; n : Number} ;
+ Noun = {s : Number => Str} ;
+ NP = {s : Str} ;
+
+lin
+ SpecNoun spec noun = {s = spec.s ++ noun.s ! spec.n} ;
+
+ One = {s = "one" ; n = Sg} ;
+ Two = {s = "two" ; n = Pl} ;
+
+ Felis = regNoun "cat" ;
+ Canis = regNoun "dog" ;
+
+oper
+ regNoun : Str -> {s : Number => Str} = \s -> {
+ s = table {
+ Sg => s ;
+ Pl => s + "s"
+ }
+ } ;
+}
diff --git a/examples/regulus/toy0/no-resource/Toy0Fre.gf b/examples/regulus/toy0/no-resource/Toy0Fre.gf
new file mode 100644
index 000000000..1077058e0
--- /dev/null
+++ b/examples/regulus/toy0/no-resource/Toy0Fre.gf
@@ -0,0 +1,30 @@
+--# -path=..
+concrete Toy0Fre of Toy0 = {
+
+param
+ Number = Sg | Pl ;
+ Gender = Masc | Fem ;
+
+lincat
+ Spec = {s : Gender => Str ; n : Number} ;
+ Noun = {s : Number => Str ; g : Gender} ;
+ NP = {s : Str} ;
+
+lin
+ SpecNoun spec noun = {s = spec.s ! noun.g ++ noun.s ! spec.n} ;
+
+ One = {s = table {Fem => "une" ; _ => "un"} ; n = Sg} ;
+ Two = {s = \\_ => "deux" ; n = Pl} ;
+
+ Felis = mkNoun "chat" Masc ;
+ Canis = mkNoun "chien" Masc ;
+
+oper
+ mkNoun : Str -> Gender -> {s : Number => Str ; g : Gender} = \s,g -> {
+ s = table {
+ Sg => s ;
+ Pl => s + "s"
+ } ;
+ g = g
+ } ;
+}
diff --git a/examples/regulus/toy0/no-resource/Toy0Ger.gf b/examples/regulus/toy0/no-resource/Toy0Ger.gf
new file mode 100644
index 000000000..eee5df823
--- /dev/null
+++ b/examples/regulus/toy0/no-resource/Toy0Ger.gf
@@ -0,0 +1,31 @@
+--# -path=..
+concrete Toy0Ger of Toy0 = {
+
+param
+ Number = Sg | Pl ;
+ Gender = Masc | Fem | Neutr ;
+
+lincat
+ Spec = {s : Gender => Str ; n : Number} ;
+ Noun = {s : Number => Str ; g : Gender} ;
+ MAIN,NP = {s : Str} ;
+
+lin
+ Main np = np ;
+ SpecNoun spec noun = {s = spec.s ! noun.g ++ noun.s ! spec.n} ;
+
+ One = {s = table {Fem => "eine" ; _ => "ein"} ; n = Sg} ;
+ Two = {s = \\_ => "zwei" ; n = Pl} ;
+
+ Felis = mkNoun "Katze" "Katzen" Fem ;
+ Canis = mkNoun "Hund" "Hünde" Masc ;
+
+oper
+ mkNoun : Str -> Str -> Gender -> {s : Number => Str ; g : Gender} = \s,p,g -> {
+ s = table {
+ Sg => s ;
+ Pl => p
+ } ;
+ g = g
+ } ;
+}
diff --git a/examples/regulus/toy0/no-resource/Toy0_eng.gf b/examples/regulus/toy0/no-resource/Toy0_eng.gf
new file mode 100644
index 000000000..ed8fe8063
--- /dev/null
+++ b/examples/regulus/toy0/no-resource/Toy0_eng.gf
@@ -0,0 +1,39 @@
+-- grammar from Chapter 2 of the Regulus book
+
+flags startcat=MAIN ;
+
+cat
+ MAIN ; NP ; Noun ; Spec ;
+
+fun
+ Main : NP -> MAIN ;
+ SpecNoun : Spec -> Noun -> NP ;
+
+ One, Two : Spec ;
+ Felis, Canis : Noun ;
+
+param
+ Number = Sg | Pl ;
+
+lincat
+ Spec = {s : Str ; n : Number} ;
+ Noun = {s : Number => Str} ;
+ MAIN,NP = {s : Str} ;
+
+lin
+ Main np = np ;
+ SpecNoun spec noun = {s = spec.s ++ noun.s ! spec.n} ;
+
+ One = {s = "one" ; n = Sg} ;
+ Two = {s = "two" ; n = Pl} ;
+
+ Felis = regNoun "cat" ;
+ Canis = regNoun "dog" ;
+
+oper
+ regNoun : Str -> {s : Number => Str} = \s -> {
+ s = table {
+ Sg => s ;
+ Pl => s + "s"
+ }
+ } ;