summaryrefslogtreecommitdiff
path: root/doc/tutorial/smarthouse/SmartEng.gf
blob: 0f59cd1e02e1db693115fc9c9f632fa3dc704581 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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" ;
}