1
0
forked from GitHub/gf-core

Generation with metavariables.

This commit is contained in:
aarne
2004-05-03 12:39:32 +00:00
parent de3ad4cbd7
commit f644f13527
3 changed files with 6 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
#! /bin/sh
# change the value of GFHOME to the directory where you have the gf binary
GFHOME=/home/aarne/GF/bin
GFHOME=/home/aarne/GF2/bin
JGUILIB=$GFHOME/java/
GF=$GFHOME/gf2

View File

@@ -43,7 +43,8 @@ gr2sgr gr = [(trId f, ty') | (f,ty) <- funRulesOf gr, ty' <- trTy ty] where
-- str2tr :: STree -> Exp
str2tr t = case t of
SApp (f,ts) -> mkApp (trId f) (map str2tr ts)
SMeta _ -> mkMeta 0
---- SString s -> K s
where
trId = cn . zIdent
@@ -75,7 +76,8 @@ generate gr cat i mn mt = case mt of
gen (n+1) (nub [(c,SApp (f, xs)) | (f,(cs,c)) <- gr, xs <- args cs cts] ++ cts)
args :: [SCat] -> [(SCat,STree)] -> [[STree]]
args cs cts = combinations [constr [t | (k,t) <- cts, k == c] | c <- cs]
args cs cts = combinations
[constr (SMeta c : [t | (k,t) <- cts, k == c]) | c <- cs]
constr = maybe id take mn

View File

@@ -1 +1 @@
module Today where today = "Sun May 2 15:21:39 CEST 2004"
module Today where today = "Mon May 3 10:59:20 CEST 2004"