summaryrefslogtreecommitdiff
path: root/src/GF/Compile
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2009-03-13 07:00:04 +0000
committerkrasimir <krasimir@chalmers.se>2009-03-13 07:00:04 +0000
commitbae62cf7c2138d7d59127bde04e545818e907425 (patch)
tree9354b19ebd0bf9738077a8a80393d839b635db02 /src/GF/Compile
parentd1276ee52b2065111b5e45c669de42d025ff0574 (diff)
remove the obsolete GF.Infra.PrintClass
Diffstat (limited to 'src/GF/Compile')
-rw-r--r--src/GF/Compile/RemoveLiT.hs61
1 files changed, 0 insertions, 61 deletions
diff --git a/src/GF/Compile/RemoveLiT.hs b/src/GF/Compile/RemoveLiT.hs
deleted file mode 100644
index 14a9a1da1..000000000
--- a/src/GF/Compile/RemoveLiT.hs
+++ /dev/null
@@ -1,61 +0,0 @@
-----------------------------------------------------------------------
--- |
--- Module : RemoveLiT
--- Maintainer : AR
--- Stability : (stable)
--- Portability : (portable)
---
--- > CVS $Date: 2005/04/21 16:21:45 $
--- > CVS $Author: bringert $
--- > CVS $Revision: 1.6 $
---
--- remove obsolete (Lin C) expressions before doing anything else. AR 21/6/2003
---
--- What the program does is replace the occurrences of Lin C with the actual
--- definition T given in lincat C = T ; with {s : Str} if no lincat is found.
--- The procedure is uncertain, if T contains another Lin.
------------------------------------------------------------------------------
-
-module GF.Compile.RemoveLiT (removeLiT) where
-
-import GF.Grammar.Grammar
-import GF.Infra.Ident
-import GF.Infra.Modules
-import GF.Grammar.Macros
-import GF.Grammar.Lookup
-import GF.Grammar.Predef
-
-import GF.Data.Operations
-
-import Control.Monad
-
-removeLiT :: SourceGrammar -> Err SourceGrammar
-removeLiT gr = liftM MGrammar $ mapM (remlModule gr) (modules gr)
-
-remlModule :: SourceGrammar -> SourceModule -> Err SourceModule
-remlModule gr mi@(name,mo) = do
- js1 <- mapMTree (remlResInfo gr) (jments mo)
- return (name,mo{jments = js1})
-
-remlResInfo :: SourceGrammar -> (Ident,Info) -> Err Info
-remlResInfo gr (i,info) = case info of
- ResOper pty ptr -> liftM2 ResOper (ren pty) (ren ptr)
- CncCat pty ptr ppr -> liftM3 CncCat (ren pty) (ren ptr) (ren ppr)
- CncFun mt ptr ppr -> liftM2 (CncFun mt) (ren ptr) (ren ppr)
- _ -> return info
- where
- ren = remlPerh gr
-
-remlPerh gr pt = case pt of
- Yes t -> liftM Yes $ remlTerm gr t
- _ -> return pt
-
-remlTerm :: SourceGrammar -> Term -> Err Term
-remlTerm gr trm = case trm of
- LiT c -> look c >>= remlTerm gr
- _ -> composOp (remlTerm gr) trm
- where
- look c = err (const $ return defLinType) return $ lookupLincat gr m c
- m = case [cnc | (cnc,m) <- modules gr, isModCnc m] of
- cnc:_ -> cnc -- actually there is always exactly one
- _ -> cCNC