diff options
| author | bringert <bringert@cs.chalmers.se> | 2007-06-27 12:38:24 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2007-06-27 12:38:24 +0000 |
| commit | 54d53251718dce4fcfda941eb9c21abe8eb939ed (patch) | |
| tree | dc5c8eebca401909dcf8dce25bd86bd0d02fe4a6 /examples/regulus/toy0/no-resource/Toy0_eng.gf | |
| parent | 67857cb1465cede016bc9a0c0b71b08813089df0 (diff) | |
Moved the different versions of the toy0 concrete modules to different subdirectories.
Diffstat (limited to 'examples/regulus/toy0/no-resource/Toy0_eng.gf')
| -rw-r--r-- | examples/regulus/toy0/no-resource/Toy0_eng.gf | 39 |
1 files changed, 39 insertions, 0 deletions
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" + } + } ; |
