1
0
forked from GitHub/gf-core

new tutorial almost finished

This commit is contained in:
aarne
2007-07-06 15:37:32 +00:00
parent bece5b2974
commit bb423658aa
6 changed files with 916 additions and 396 deletions

View File

@@ -1,3 +1,5 @@
==Coverage==
The GF Resource Grammar Library contains grammar rules for

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
--# -path=.:present:prelude
concrete FoodEng of Food = FoodI - [Pizza] with
(Syntax = SyntaxEng),
(LexFood = LexFoodEng) **
open SyntaxEng, ParadigmsEng in {
lin Pizza = mkCN (mkA "Italian") (mkN "pie") ;
}

View File

@@ -10,9 +10,9 @@ concrete FoodFre of Food = open SyntaxFre,ParadigmsFre in {
lin
Is item quality = mkUtt (mkCl item quality) ;
This kind = SyntaxFre.mkNP (mkDet this_Quant) kind ;
That kind = SyntaxFre.mkNP (mkDet that_Quant) kind ;
All kind = SyntaxFre.mkNP all_Predet (SyntaxFre.mkNP defPlDet kind) ;
This kind = mkNP (mkDet this_Quant) kind ;
That kind = mkNP (mkDet that_Quant) kind ;
All kind = mkNP all_Predet (mkNP defPlDet kind) ;
QKind quality kind = mkCN quality kind ;
Wine = mkCN (mkN "vin") ;
Beer = mkCN (mkN "bière") ;

View File

@@ -0,0 +1,17 @@
abstract Smart = {
flags startcat = Command ;
cat
Command ;
Kind ;
Action Kind ;
Device Kind ;
fun
CAction : (k : Kind) -> Action k -> Device k -> Command ;
DKindOne : (k : Kind) -> Device k ;
light, fan : Kind ;
switchOn, switchOff : (k : Kind) -> Action k ;
dim : Action light ;
}

View File

@@ -0,0 +1,19 @@
--# -path=.:prelude
concrete SmartEng of Smart = open Prelude in {
-- part of grammar Toy1 from the Regulus book
lincat
Command, Kind, Action, Device = SS ;
lin
CAction _ act dev = ss (act.s ++ dev.s) ;
DKindOne k = ss ("the" ++ k.s) ;
light = ss "light" ;
fan = ss "fan" ;
switchOn _ = ss ["switch on"] ;
switchOff _ = ss ["switch off"] ;
dim = ss "dim" ;
}