summaryrefslogtreecommitdiff
path: root/src/GF/API.hs
diff options
context:
space:
mode:
authoraarne <unknown>2005-05-10 11:49:13 +0000
committeraarne <unknown>2005-05-10 11:49:13 +0000
commit5111762d31a50c4fccc8da02c7c327a2b51d0e77 (patch)
treea3165802392173f30968061df88ebe6b76e09308 /src/GF/API.hs
parent75f12f69e3c00eb6e6beec3f027cb2264cd3ea60 (diff)
modules for embedded GF
Diffstat (limited to 'src/GF/API.hs')
-rw-r--r--src/GF/API.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/GF/API.hs b/src/GF/API.hs
index 64572e041..3b252f4f3 100644
--- a/src/GF/API.hs
+++ b/src/GF/API.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/04/21 16:45:57 $
--- > CVS $Author: bringert $
--- > CVS $Revision: 1.33 $
+-- > CVS $Date: 2005/05/10 12:49:13 $
+-- > CVS $Author: aarne $
+-- > CVS $Revision: 1.34 $
--
-- Application Programmer's Interface to GF; also used by Shell. AR 10/11/2001
-----------------------------------------------------------------------------
@@ -88,6 +88,12 @@ linearize :: GFGrammar -> Tree -> String
linearize sgr = err id id . optLinearizeTree opts sgr where
opts = addOption firstLin $ stateOptions sgr
+term2tree :: GFGrammar -> G.Term -> Tree
+term2tree gr = errVal uTree . annotate (grammar gr) . qualifTerm (absId gr)
+
+tree2term :: Tree -> G.Term
+tree2term = tree2exp
+
linearizeToAll :: [GFGrammar] -> Tree -> [String]
linearizeToAll grs t = [linearize gr t | gr <- grs]