summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2006-12-19 15:34:52 +0000
committeraarne <aarne@cs.chalmers.se>2006-12-19 15:34:52 +0000
commitd0b392e318f442807d10e6adf80a85df33b529d7 (patch)
tree7d6cf89fbb9c5151299d79fe2041e072c7203155
parent08154738fc445a75c3cc43bb28ec1f007a20e46b (diff)
gfcc with lindef (_dCat)
-rw-r--r--examples/bronzeage/BronzeageI.gf2
-rw-r--r--src/GF/Canon/CanonToGFCC.hs9
2 files changed, 7 insertions, 4 deletions
diff --git a/examples/bronzeage/BronzeageI.gf b/examples/bronzeage/BronzeageI.gf
index f0a484c41..57590c569 100644
--- a/examples/bronzeage/BronzeageI.gf
+++ b/examples/bronzeage/BronzeageI.gf
@@ -1,7 +1,7 @@
incomplete concrete BronzeageI of Bronzeage = open Lang in {
flags
- startcat = Phr ; optimize = share_subs ;
+ startcat = Phr ; optimize = all_subs ; --optimize = share_subs ;
unlexer = text ; lexer = text ;
lincat
diff --git a/src/GF/Canon/CanonToGFCC.hs b/src/GF/Canon/CanonToGFCC.hs
index 8bc1efb61..1aeb16c36 100644
--- a/src/GF/Canon/CanonToGFCC.hs
+++ b/src/GF/Canon/CanonToGFCC.hs
@@ -62,16 +62,19 @@ canon2gfcc cgr@(M.MGrammar ((a,M.ModMod abm):cms)) =
adefs = [C.Fun f' (mkType ty) (C.Tr (C.AC f') []) |
(f,GFC.AbsFun ty _) <- tree2list (M.jments abm), let f' = i2i f]
cncs = [C.Cnc (i2i lang) (concr m) | (lang,M.ModMod m) <- cms]
- concr mo = cats mo ++
+ concr mo = cats mo ++ lindefs mo ++
optConcrete
[C.Lin (i2i f) (mkTerm tr) |
(f,GFC.CncFun _ _ tr _) <- tree2list (M.jments mo)]
cats mo = [C.Lin (i2ic c) (mkCType ty) |
(c,GFC.CncCat ty _ _) <- tree2list (M.jments mo)]
+ lindefs mo = [C.Lin (i2id c) (mkTerm tr) |
+ (c,GFC.CncCat _ tr _) <- tree2list (M.jments mo)]
i2i :: Ident -> C.CId
i2i (IC c) = C.CId c
-i2ic (IC c) = C.CId ("__" ++ c) -- for category symbols
+i2ic (IC c) = C.CId ("__" ++ c) -- for lincat of category symbols
+i2id (IC c) = C.CId ("_d" ++ c) -- for lindef of category symbols
mkType :: A.Type -> C.Type
mkType t = case GM.catSkeleton t of
@@ -179,7 +182,7 @@ canon2canon = recollect . map cl2cl . repartition where
_ -> (c,m)
j2j (f,j) = case j of
GFC.CncFun x y tr z -> (f,GFC.CncFun x y (t2t tr) z)
- GFC.CncCat ty x y -> (f,GFC.CncCat (ty2ty ty) x y)
+ GFC.CncCat ty x y -> (f,GFC.CncCat (ty2ty ty) (t2t x) y)
_ -> (f,j)
t2t = term2term cg pv
ty2ty = type2type cg pv