summaryrefslogtreecommitdiff
path: root/src/GF/GFCC/Macros.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-01-31 16:37:32 +0000
committeraarne <aarne@cs.chalmers.se>2008-01-31 16:37:32 +0000
commit8f8aac4d24b8ea7d0867df8b3f890422a1f833d8 (patch)
tree05fcda4d1d2bd628b6ebae138f0a473c7857929f /src/GF/GFCC/Macros.hs
parentc6137229ebb66b0a299b3ff09bd6fabf01444884 (diff)
gfcc generation with HOAS: var fields appended to records
Diffstat (limited to 'src/GF/GFCC/Macros.hs')
-rw-r--r--src/GF/GFCC/Macros.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/GF/GFCC/Macros.hs b/src/GF/GFCC/Macros.hs
index 383b77d34..d38ccb2e5 100644
--- a/src/GF/GFCC/Macros.hs
+++ b/src/GF/GFCC/Macros.hs
@@ -69,10 +69,18 @@ catSkeleton :: Type -> ([CId],CId)
catSkeleton ty = case ty of
DTyp hyps val _ -> ([valCat ty | Hyp _ ty <- hyps],val)
+typeSkeleton :: Type -> ([(Int,CId)],CId)
+typeSkeleton ty = case ty of
+ DTyp hyps val _ -> ([(contextLength ty, valCat ty) | Hyp _ ty <- hyps],val)
+
valCat :: Type -> CId
valCat ty = case ty of
DTyp _ val _ -> val
+contextLength :: Type -> Int
+contextLength ty = case ty of
+ DTyp hyps _ _ -> length hyps
+
cid :: String -> CId
cid = CId