summaryrefslogtreecommitdiff
path: root/src-3.0/GF/UseGrammar/GetTree.hs
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@chalmers.se>2008-05-22 11:59:31 +0000
committerkr.angelov <kr.angelov@chalmers.se>2008-05-22 11:59:31 +0000
commitdf0c4f81fa9c620d7c63af79c0b183a6beccf0bd (patch)
tree0cdc80b29f8f5df0ad280f17be0ba9d46fbd948c /src-3.0/GF/UseGrammar/GetTree.hs
parent6394f3ccfbb9d14017393b433a38a3921f1083e5 (diff)
remove all files that aren't used in GF-3.0
Diffstat (limited to 'src-3.0/GF/UseGrammar/GetTree.hs')
-rw-r--r--src-3.0/GF/UseGrammar/GetTree.hs74
1 files changed, 0 insertions, 74 deletions
diff --git a/src-3.0/GF/UseGrammar/GetTree.hs b/src-3.0/GF/UseGrammar/GetTree.hs
deleted file mode 100644
index e980a3d95..000000000
--- a/src-3.0/GF/UseGrammar/GetTree.hs
+++ /dev/null
@@ -1,74 +0,0 @@
-----------------------------------------------------------------------
--- |
--- Module : GetTree
--- Maintainer : AR
--- Stability : (stable)
--- Portability : (portable)
---
--- > CVS $Date: 2005/09/15 16:22:02 $
--- > CVS $Author: aarne $
--- > CVS $Revision: 1.9 $
---
--- how to form linearizable trees from strings and from terms of different levels
---
--- 'String' --> raw 'Term' --> annot, qualif 'Term' --> 'Tree'
------------------------------------------------------------------------------
-
-module GF.UseGrammar.GetTree where
-
-import GF.Canon.GFC
-import GF.Grammar.Values
-import qualified GF.Grammar.Grammar as G
-import GF.Infra.Ident
-import GF.Grammar.MMacros
-import GF.Grammar.Macros
-import GF.Compile.Rename
-import GF.Grammar.TypeCheck
-import GF.Grammar.AbsCompute (beta)
-import GF.Compile.PGrammar
-import GF.Compile.ShellState
-
-import GF.Data.Operations
-
-import Data.Char
-
--- how to form linearizable trees from strings and from terms of different levels
---
--- String --> raw Term --> annot, qualif Term --> Tree
-
-string2tree :: StateGrammar -> String -> Tree
-string2tree gr = errVal uTree . string2treeErr gr
-
-string2treeErr :: StateGrammar -> String -> Err Tree
-string2treeErr _ "" = Bad "empty string"
-string2treeErr gr s = do
- t <- pTerm s
- let t0 = beta [] t
- let t1 = refreshMetas [] t0
- let t2 = qualifTerm abstr t1
- annotate grc t2
- where
- abstr = absId gr
- grc = grammar gr
-
-string2Cat, string2Fun :: StateGrammar -> String -> (Ident,Ident)
-string2Cat gr c = (absId gr,identC c)
-string2Fun = string2Cat
-
-strings2Cat, strings2Fun :: String -> (Ident,Ident)
-strings2Cat s = (identC m, identC (drop 1 c)) where (m,c) = span (/= '.') s
-strings2Fun = strings2Cat
-
-string2ref :: StateGrammar -> String -> Err G.Term
-string2ref gr s = case s of
- 'x':'_':ds -> return $ freshAsTerm ds --- hack for generated vars
- '"':_:_ -> return $ G.K $ init $ tail s
- _:_ | all isDigit s -> return $ G.EInt $ read s
- _ | elem '.' s -> return $ uncurry G.Q $ strings2Fun s
- _ -> return $ G.Vr $ identC s
-
-string2cat :: StateGrammar -> String -> Err G.Cat
-string2cat gr s =
- if elem '.' s
- then return $ strings2Fun s
- else return $ curry id (absId gr) (identC s)