1
0
forked from GitHub/gf-core

Karin C's example

This commit is contained in:
aarne
2004-09-16 14:47:18 +00:00
parent d5c0814180
commit e2f00638e2
55 changed files with 2212 additions and 4 deletions

View File

@@ -0,0 +1,37 @@
-- general.Abs.gf
abstract genSystem = general ** {
cat
Empty ; -- whatever this is good for?
Question ;
YNQuestion ;
WHQuestion ;
AltQuestion ;
PropQ ;
fun
greet : DMove ; -- "Welcome"
quit : DMove ; -- "Goodbye"
ask : Question -> DMove ;
--- Language
change_language : Action ;
language_alt : Question ;
--- Actions
actionQ : WHQuestion ;
--- Questions
whQuestion : WHQuestion -> Question ;
altQuestion : YNQuestion -> YNQuestion -> AltQuestion ;
--- Issue
issue : Question -> PropQ ;
--- Lists
nil : Empty ;
}

View File

@@ -0,0 +1,32 @@
-- File name system.Prolog.gf
concrete genSystemProlog of genSystem = generalProlog **
open prologResource in {
pattern
greet = "greet" ;
quit = "quit" ;
lin
ask q = {s = app "ask" q.s} ;
lin
---Language
change_language = {s = "change_language"} ;
language_alt = {s = "[" ++ "language" ++ "(" ++ "X" ++ ")" ++ "]" } ; -- hack!
---Actions
pattern
actionQ = "action" ;
lin
whQuestion f = {s = "X" ++ "^" ++ app f.s "X"} ;
altQuestion a1 a2 = {s = a1.s ++ a2.s};
--- Issue
issue i = {s = app "issue" i.s} ;
pattern
nil = "[]" ;
}

View File

@@ -0,0 +1,32 @@
-- File name System/general.Swe.gf
concrete genSystemSwe of genSystem = generalSwe ** open icm100ResSwe in {
---- flags lexer=codelit ; unlexer=codelit ; startcat=DMoveList ;
pattern
greet = ["Välkommen till videobandspelaren"] ;
quit = "hejdå" ;
lin
ask a = {s = a.s} ;
lin
---Language
change_language = {s = "byt" ++ "språk"} ;
language_alt = {s = ["vill du använda svenska eller engelska"]} ;
---Actions
lin
actionQ = {s = "Vad" ++ "kan" ++ "jag" ++ "stå" ++ "till" ++ "tjänst" ++ "med"} ;
lin
whQuestion w = {s = w.s };
altQuestion a1 a2 = {s = "vill" ++ "du" ++ "spela" ++ "in" ++ a1.s ++ "eller" ++ a2.s};
--- Issue
issue i = {s = i.s} ;
pattern
nil = "[]" ;
}

View File

@@ -0,0 +1,32 @@
-- File name system.Prolog.gf
include
general.Abs.gf ;
../icm100.Prolog.gf ;
pattern
greet = "greet" ;
quit = "quit" ;
lin
ask q = {s = app "ask" q.s} ;
lin
---Language
change_language = {s = "change_language"} ;
language_alt = {s = "[" ++ "language" ++ "(" ++ "X" ++ ")" ++ "]" } ; -- hack!
---Actions
pattern
actionQ = "action" ;
lin
whQuestion f = {s = "X" ++ "^" ++ app f.s "X"} ;
altQuestion a1 a2 = {s = a1.s ++ a2.s};
--- Issue
issue i = {s = app "issue" i.s} ;
pattern
nil = "[]" ;

View File

@@ -0,0 +1,60 @@
-- File name System/specific.Swe.gf
include
specific.Abs.gf ;
lin
-- Confirm recording job
confirmRecJob act = {s = ["bekräftar"] ++ act.s } ;
-- programmet är inspelat -- spela in
-- inspelningen är tillagd -- lägga till
-- programmet är borttaget -- ta bort
q_lambdaActionDel dact = {s = ["vilket programnummer vill du ta bort"]};
vcr_add_rec_job_no_args = {s = ["spela in"]} ; -- hack!!!
--- Time in question
startTimeToStoreQ st = {s = "från" ++ st.s } ;
-- prep Time
endTimeToStoreQ et = {s = "till" ++ et.s } ;
-- prep Time
--- Channel and Weekday in question
channelToStoreQ ch = {s = "på" ++ ch.s } ;
-- prep Channel
weekdayToStoreQ wd = {s = "på" ++ wd.s } ;
--prep Weekday
--- WHQuestions --- Lambdas
q_lambdaWeekday wdts = {s = ["vilken dag vill du spela in på"]};
q_lambdaChannel chts = {s = ["vilken kanal vill du spela in från"]};
q_lambdaStartTime stts = {s = ["vilken tid vill du påbörja inspelningen"]};
q_lambdaEndTime etts = {s = ["vilken tid vill du avsluta inspelningen"]};
--- Constructions for ynquestions
lin
ynQuST y = {s = y.s} ;
ynQuET y = {s = y.s} ;
ynQuCH y = {s = y.s} ;
ynQuWD y = {s = y.s} ;
lin
--- Props
startTimeToStoreProp st = {s = st.s } ;
endTimeToStoreProp et = {s = et.s } ;
channelToStoreProp chst = {s = chst.s } ;
weekdayToStoreProp wdts = {s = wdts.s } ;
channelListing chs = {s = chs.s } ;
channels1 ch = {s = ch.s } ;
channels2 ch chs = {s = ch.s ++ "," ++ chs.s } ;
channelListAction ch = {s = ch.s } ;
channelListActionDMove ch = {s = ch.s } ;

View File

@@ -0,0 +1,59 @@
-- File name System/specific.Abs.gf
abstract specSystem = specific, genSystem ** {
cat
StartTimeQ ;
EndTimeQ ;
ChToStoreQ ;
WdToStoreQ ;
fun
confirmRecJob : Action -> DMove;
---- vcr_add_rec_job_no_args : Action ; -- spela in! moved to specific
q_lambdaActionDel : DelAction -> WHQuestion ;
-- Time in question
startTimeToStoreQ : Time -> StartTimeQ ;
endTimeToStoreQ : Time -> EndTimeQ ;
--- Channel and Weekday in question
channelToStoreQ : Channel -> ChToStoreQ ;
weekdayToStoreQ : Weekday -> WdToStoreQ ;
--- WHQuestions --- Lambdas
q_lambdaStartTime : StartTime -> WHQuestion ;
q_lambdaEndTime : EndTime -> WHQuestion ;
q_lambdaWeekday : WdToStore -> WHQuestion ;
q_lambdaChannel : ChToStore -> WHQuestion ;
--- Constructions for ynquestions
ynQuST : StartTimeQ -> YNQuestion ;
ynQuET : EndTimeQ -> YNQuestion ;
ynQuCH : ChToStoreQ -> YNQuestion ;
ynQuWD: WdToStoreQ -> YNQuestion ;
--- Props
startTimeToStoreProp : StartTime -> Prop ;
endTimeToStoreProp : EndTime -> Prop ;
channelToStoreProp : ChToStore -> Prop ;
weekdayToStoreProp : WdToStore -> Prop ;
cat
ChannelList ;
Channels ;
ChannelAction ;
fun
channelListing : Channels -> ChannelList ;
channels1 : Channel -> Channels ;
channels2 : Channel -> Channels -> Channel ;
channelListAction : ChannelList -> ChannelAction ;
--channelListAction : ChannelList -> DMove ;
channelListActionDMove : ChannelAction -> DMove ;
}

View File

@@ -0,0 +1,45 @@
-- File name System/specific.Prolog.gf
concrete specSystemProlog of specSystem = genSystemProlog, specificProlog **
open prologResource in {
lin
-- Confirm recording job
confirmRecJob act = {s = app "confirm" act.s } ;
q_lambdaActionDel dact = {s = ["rec_job_to_delete"]} ;
--- Time in question
startTimeToStoreQ st = {s = app "start_time_to_store" st.s } ;
endTimeToStoreQ et = {s = app "stop_time_to_store" et.s } ;
--- Channel and Weekday in question
channelToStoreQ ch = {s = app "channel_to_store" ch.s } ;
weekdayToStoreQ wd = {s = app "weekday_to_store" wd.s } ;
--- WHQuestions --- Lambdas
q_lambdaWeekday wdts = {s = ["weekday_to_store"]} ;
q_lambdaChannel chts = {s = ["channel_to_store"]} ;
q_lambdaStartTime stts = {s = ["start_time_to_store"]} ;
q_lambdaEndTime etts = {s = ["stop_time_to_store"]} ;
--- Constructions for ynquestions
lin
ynQuST y = {s = y.s} ;
ynQuET y = {s = y.s} ;
ynQuCH y = {s = y.s} ;
ynQuWD y = {s = y.s} ;
--- Props
startTimeToStoreProp st = {s = st.s } ;
endTimeToStoreProp et = {s = et.s } ;
channelToStoreProp chst = {s = chst.s } ;
weekdayToStoreProp wdts = {s = wdts.s } ;
channelListing chs = {s = chs.s } ;
channels1 ch = {s = ch.s } ;
channels2 ch chs = {s = ch.s ++ "," ++ chs.s } ;
channelListAction ch = {s = ch.s } ;
channelListActionDMove ch = {s = ch.s } ;
}

View File

@@ -0,0 +1,49 @@
--# -path=.:..:../Shared:../Weekday:../Time:../Channel
-- File name System/specific.Swe.gf
concrete specSystemSwe of specSystem = specificSwe, genSystemSwe ** {
lin
-- Confirm recording job
confirmRecJob act = {s = ["bekräftar"] ++ act.s } ;
q_lambdaActionDel dact = {s = ["vilket programnummer vill du ta bort"]};
---- vcr_add_rec_job_no_args = {s = ["spela in"]} ; -- hack!!!
--- Time in question
startTimeToStoreQ st = {s = "från" ++ st.s } ;
endTimeToStoreQ et = {s = "till" ++ et.s } ;
--- Channel and Weekday in question
channelToStoreQ ch = {s = "på" ++ ch.s } ;
weekdayToStoreQ wd = {s = "på" ++ wd.s } ;
--- WHQuestions --- Lambdas
q_lambdaWeekday wdts = {s = ["vilken dag vill du spela in på"]};
q_lambdaChannel chts = {s = ["vilken kanal vill du spela in från"]};
q_lambdaStartTime stts = {s = ["vilken tid vill du påbörja inspelningen"]};
q_lambdaEndTime etts = {s = ["vilken tid vill du avsluta inspelningen"]};
--- Constructions for ynquestions
lin
ynQuST y = {s = y.s} ;
ynQuET y = {s = y.s} ;
ynQuCH y = {s = y.s} ;
ynQuWD y = {s = y.s} ;
lin
--- Props
startTimeToStoreProp st = {s = st.s } ;
endTimeToStoreProp et = {s = et.s } ;
channelToStoreProp chst = {s = chst.s } ;
weekdayToStoreProp wdts = {s = wdts.s } ;
channelListing chs = {s = chs.s } ;
channels1 ch = {s = ch.s } ;
channels2 ch chs = {s = ch.s ++ "," ++ chs.s } ;
channelListAction ch = {s = ch.s } ;
channelListActionDMove ch = {s = ch.s } ;
}

View File

@@ -0,0 +1,46 @@
-- File name System/specific.Prolog.gf
include
specific.Abs.gf ;
lin
-- Confirm recording job
confirmRecJob act = {s = app "confirm" act.s } ;
q_lambdaActionDel dact = {s = ["rec_job_to_delete"]} ;
vcr_add_rec_job_no_args = {s = ["add_rec_job"]} ; -- hack!!!
--- Time in question
startTimeToStoreQ st = {s = app "start_time_to_store" st.s } ;
endTimeToStoreQ et = {s = app "stop_time_to_store" et.s } ;
--- Channel and Weekday in question
channelToStoreQ ch = {s = app "channel_to_store" ch.s } ;
weekdayToStoreQ wd = {s = app "weekday_to_store" wd.s } ;
--- WHQuestions --- Lambdas
q_lambdaWeekday wdts = {s = ["weekday_to_store"]} ;
q_lambdaChannel chts = {s = ["channel_to_store"]} ;
q_lambdaStartTime stts = {s = ["start_time_to_store"]} ;
q_lambdaEndTime etts = {s = ["stop_time_to_store"]} ;
--- Constructions for ynquestions
lin
ynQuST y = {s = y.s} ;
ynQuET y = {s = y.s} ;
ynQuCH y = {s = y.s} ;
ynQuWD y = {s = y.s} ;
--- Props
startTimeToStoreProp st = {s = st.s } ;
endTimeToStoreProp et = {s = et.s } ;
channelToStoreProp chst = {s = chst.s } ;
weekdayToStoreProp wdts = {s = wdts.s } ;
channelListing chs = {s = chs.s } ;
channels1 ch = {s = ch.s } ;
channels2 ch chs = {s = ch.s ++ "," ++ chs.s } ;
channelListAction ch = {s = ch.s } ;
channelListActionDMove ch = {s = ch.s } ;