mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-17 16:59:34 -06:00
new tutorial almost finished
This commit is contained in:
19
doc/tutorial/smarthouse/SmartEng.gf
Normal file
19
doc/tutorial/smarthouse/SmartEng.gf
Normal 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" ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user