diff options
| author | aarne <aarne@cs.chalmers.se> | 2008-06-25 16:54:35 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2008-06-25 16:54:35 +0000 |
| commit | e9e80fc389365e24d4300d7d5390c7d833a96c50 (patch) | |
| tree | f0b58473adaa670bd8fc52ada419d8cad470ee03 /examples-3.0/tutorial/smart/SmartEng.gf | |
| parent | b96b36f43de3e2f8b58d5f539daa6f6d47f25870 (diff) | |
changed names of resource-1.3; added a note on homepage on release
Diffstat (limited to 'examples-3.0/tutorial/smart/SmartEng.gf')
| -rw-r--r-- | examples-3.0/tutorial/smart/SmartEng.gf | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/examples-3.0/tutorial/smart/SmartEng.gf b/examples-3.0/tutorial/smart/SmartEng.gf deleted file mode 100644 index eff8a000a..000000000 --- a/examples-3.0/tutorial/smart/SmartEng.gf +++ /dev/null @@ -1,84 +0,0 @@ ---# -path=.:prelude - -concrete SmartEng of Smart = open Prelude in { - --- grammar Toy1 from the Regulus book - -flags startcat = Utterance ; - -param - Number = Sg | Pl ; - VForm = VImp | VPart ; - -lincat - Utterance = SS ; - Command = SS ; - Question = SS ; - Kind = {s : Number => Str} ; - Action = {s : VForm => Str ; part : Str} ; - Device = {s : Str ; n : Number} ; - Location = SS ; - -lin - UCommand c = c ; - UQuestion q = q ; - - CAction _ act dev = ss (act.s ! VImp ++ bothWays act.part dev.s) ; - QAction _ act st dev = ss (be dev.n ++ dev.s ++ act.s ! VPart ++ act.part ++ st.s) ; - - DKindOne k = { - s = "the" ++ k.s ! Sg ; - n = Sg - } ; - DKindMany k = { - s = "the" ++ k.s ! Pl ; - n = Pl - } ; - DLoc _ dev loc = { - s = dev.s ++ "in" ++ "the" ++ loc.s ; - n = dev.n - } ; - - light = mkNoun "light" ; - fan = mkNoun "fan" ; - - switchOn _ _ = mkVerb "switch" "swithced" "on" ; - switchOff _ _ = mkVerb "switch" "swithced" "off" ; - - dim _ _ = mkVerb "dim" "dimmed" [] ; - - kitchen = ss "kitchen" ; - livingRoom = ss ["living room"] ; - -oper - mkNoun : Str -> {s : Number => Str} = \dog -> { - s = table { - Sg => dog ; - Pl => dog + "s" - } - } ; - - mkVerb : (_,_,_ : Str) -> {s : VForm => Str ; part : Str} = \go,gone,away -> { - s = table { - VImp => go ; - VPart => gone - } ; - part = away - } ; - - be : Number -> Str = \n -> case n of { - Sg => "is" ; - Pl => "are" - } ; - - hidden : SS = ss [] ; -lin - switchable_light = hidden ; - switchable_fan = hidden ; - dimmable_light = hidden ; - - statelike_switchOn _ _ = hidden ; - statelike_switchOff _ _ = hidden ; - -} - |
