summaryrefslogtreecommitdiff
path: root/src/runtime/haskell/PGF/Macros.hs
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2012-08-29 11:43:02 +0000
committerkr.angelov <kr.angelov@gmail.com>2012-08-29 11:43:02 +0000
commitf8fe23fda7b97d5301bfb2ec1d89ce9967c5b200 (patch)
treea2db1d1dbe1cd294a7f323abb0123ea8c551fc82 /src/runtime/haskell/PGF/Macros.hs
parent27196778ace6de265407947a21a5b0eb3fd0caf8 (diff)
A basic infrastructure for generating Teyjus bytecode from the GF abstract syntax
Diffstat (limited to 'src/runtime/haskell/PGF/Macros.hs')
-rw-r--r--src/runtime/haskell/PGF/Macros.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/runtime/haskell/PGF/Macros.hs b/src/runtime/haskell/PGF/Macros.hs
index 7879004cd..88057ce45 100644
--- a/src/runtime/haskell/PGF/Macros.hs
+++ b/src/runtime/haskell/PGF/Macros.hs
@@ -21,18 +21,18 @@ mapConcretes f pgf = pgf { concretes = Map.map f (concretes pgf) }
lookType :: Abstr -> CId -> Type
lookType abs f =
case lookMap (error $ "lookType " ++ show f) f (funs abs) of
- (ty,_,_,_) -> ty
+ (ty,_,_,_,_) -> ty
lookDef :: Abstr -> CId -> Maybe [Equation]
lookDef abs f =
case lookMap (error $ "lookDef " ++ show f) f (funs abs) of
- (_,a,eqs,_) -> eqs
+ (_,a,eqs,_,_) -> eqs
isData :: Abstr -> CId -> Bool
isData abs f =
case Map.lookup f (funs abs) of
- Just (_,_,Nothing,_) -> True -- the encoding of data constrs
- _ -> False
+ Just (_,_,Nothing,_,_) -> True -- the encoding of data constrs
+ _ -> False
lookValCat :: Abstr -> CId -> CId
lookValCat abs = valCat . lookType abs
@@ -65,9 +65,9 @@ lookConcrFlag pgf lang f = Map.lookup f $ cflags $ lookConcr pgf lang
functionsToCat :: PGF -> CId -> [(CId,Type)]
functionsToCat pgf cat =
- [(f,ty) | (_,f) <- fs, Just (ty,_,_,_) <- [Map.lookup f $ funs $ abstract pgf]]
+ [(f,ty) | (_,f) <- fs, Just (ty,_,_,_,_) <- [Map.lookup f $ funs $ abstract pgf]]
where
- (_,fs) = lookMap ([],[]) cat $ cats $ abstract pgf
+ (_,fs,_) = lookMap ([],[],0) cat $ cats $ abstract pgf
missingLins :: PGF -> CId -> [CId]
missingLins pgf lang = [c | c <- fs, not (hasl c)] where
@@ -81,7 +81,7 @@ restrictPGF :: (CId -> Bool) -> PGF -> PGF
restrictPGF cond pgf = pgf {
abstract = abstr {
funs = Map.filterWithKey (\c _ -> cond c) (funs abstr),
- cats = Map.map (\(hyps,fs) -> (hyps,filter (cond . snd) fs)) (cats abstr)
+ cats = Map.map (\(hyps,fs,addr) -> (hyps,filter (cond . snd) fs,addr)) (cats abstr)
}
} ---- restrict concrs also, might be needed
where