summaryrefslogtreecommitdiff
path: root/src/GF/GFCC/Linearize.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-01-31 20:56:42 +0000
committeraarne <aarne@cs.chalmers.se>2008-01-31 20:56:42 +0000
commit3addf256bcfaaa7748b0159a3dd6f6ce8fcd8b7c (patch)
tree7bc860aa21e18b1db20889fdc19a764c92c5535f /src/GF/GFCC/Linearize.hs
parent8f8aac4d24b8ea7d0867df8b3f890422a1f833d8 (diff)
GFCC: TM with argument; fixed labels from bindings in gfc
Diffstat (limited to 'src/GF/GFCC/Linearize.hs')
-rw-r--r--src/GF/GFCC/Linearize.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/GF/GFCC/Linearize.hs b/src/GF/GFCC/Linearize.hs
index b585385ea..03dc864d5 100644
--- a/src/GF/GFCC/Linearize.hs
+++ b/src/GF/GFCC/Linearize.hs
@@ -23,11 +23,11 @@ realize trm = case trm of
W s t -> s ++ realize t
FV ts -> realize (ts !! 0) ---- other variants TODO
RP _ r -> realize r ---- DEPREC
- TM -> "?"
+ TM s -> s
_ -> "ERROR " ++ show trm ---- debug
linExp :: GFCC -> CId -> Exp -> Term
-linExp mcfg lang tree@(DTr xs at trees) = ---- bindings TODO
+linExp mcfg lang tree@(DTr xs at trees) =
case at of
AC fun -> addB $ comp (lmap lin trees) $ look fun
AS s -> R [kks (show s)] -- quoted
@@ -35,8 +35,8 @@ linExp mcfg lang tree@(DTr xs at trees) = ---- bindings TODO
--- [C lst, kks (show i), C size] where
--- lst = mod (fromInteger i) 10 ; size = if i < 10 then 0 else 1
AF d -> R [kks (show d)]
- AV x -> addB $ R [kks (prCId x)] ---- lindef of cat
- AM _ -> TM
+ AV x -> addB $ TM (prCId x)
+ AM i -> TM (show i)
where
lin = linExp mcfg lang
comp = compute mcfg lang
@@ -63,7 +63,7 @@ compute mcfg lang args = comp where
idx xs i = if i > length xs - 1
then trace
- ("too large " ++ show i ++ " for\n" ++ unlines (lmap show xs) ++ "\n") TM
+ ("too large " ++ show i ++ " for\n" ++ unlines (lmap show xs) ++ "\n") tm0
else xs !! i
proj r p = case (r,p) of
@@ -79,12 +79,12 @@ compute mcfg lang args = comp where
getIndex t = case t of
C i -> i
RP p _ -> getIndex p ---- DEPREC
- TM -> 0 -- default value for parameter
+ TM _ -> 0 -- default value for parameter
_ -> trace ("ERROR in grammar compiler: index from " ++ show t) 666
getField t i = case t of
R rs -> idx rs i
RP _ r -> getField r i ---- DEPREC
- TM -> TM
+ TM s -> TM s
_ -> error ("ERROR in grammar compiler: field from " ++ show t) t