summaryrefslogtreecommitdiff
path: root/src/GF/Conversion
diff options
context:
space:
mode:
authorpeb <unknown>2005-04-20 11:49:44 +0000
committerpeb <unknown>2005-04-20 11:49:44 +0000
commit78108f7817fbf3269bb75f278eb9a8540737873e (patch)
tree6fc47a586e0d4eb223fc5b1bc3a25b1ef77762c8 /src/GF/Conversion
parent5621344c73f75f6d5a89ec77c6a4b432f391b16d (diff)
"Committed_by_peb"
Diffstat (limited to 'src/GF/Conversion')
-rw-r--r--src/GF/Conversion/Types.hs16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/GF/Conversion/Types.hs b/src/GF/Conversion/Types.hs
index a8dc20393..404d090ba 100644
--- a/src/GF/Conversion/Types.hs
+++ b/src/GF/Conversion/Types.hs
@@ -4,9 +4,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/04/18 14:55:32 $
+-- > CVS $Date: 2005/04/20 12:49:44 $
-- > CVS $Author: peb $
--- > CVS $Revision: 1.5 $
+-- > CVS $Revision: 1.6 $
--
-- All possible instantiations of different grammar formats used in conversion from GFC
-----------------------------------------------------------------------------
@@ -44,6 +44,7 @@ data Name = Name Fun [Profile (SyntaxForest Fun)]
name2fun :: Name -> Fun
name2fun (Name fun _) = fun
+----------------------------------------------------------------------
-- * profiles
-- | A profile is a simple representation of a function on a number of arguments.
@@ -155,7 +156,10 @@ data MCat = MCat ECat [ELabel] deriving (Eq, Ord, Show)
type MLabel = ELabel
mcat2ecat :: MCat -> ECat
-mcat2ecat (MCat mcat _) = mcat
+mcat2ecat (MCat cat _) = cat
+
+mcat2scat :: MCat -> SCat
+mcat2scat = ecat2scat . mcat2ecat
----------------------------------------------------------------------
-- * CFG
@@ -164,6 +168,12 @@ type CGrammar = CFGrammar CCat Name Token
type CRule = CFRule CCat Name Token
data CCat = CCat ECat ELabel deriving (Eq, Ord, Show)
+ccat2ecat :: CCat -> ECat
+ccat2ecat (CCat cat _) = cat
+
+ccat2scat :: CCat -> SCat
+ccat2scat = ecat2scat . ccat2ecat
+
----------------------------------------------------------------------
-- * pretty-printing