diff options
| author | peb <unknown> | 2005-05-13 11:40:18 +0000 |
|---|---|---|
| committer | peb <unknown> | 2005-05-13 11:40:18 +0000 |
| commit | 20eae7786f420ce02e8043c43c82e31e49c5af72 (patch) | |
| tree | 9396d462d993cfb499703cf7a05ef3a553588c16 /src/GF/CFGM | |
| parent | 0853d7bcfb64b683d7d8b4f6d912717f11bdd4a7 (diff) | |
"Committed_by_peb"
Diffstat (limited to 'src/GF/CFGM')
| -rw-r--r-- | src/GF/CFGM/PrintCFGrammar.hs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/GF/CFGM/PrintCFGrammar.hs b/src/GF/CFGM/PrintCFGrammar.hs index 504c21e6c..bf7d8320a 100644 --- a/src/GF/CFGM/PrintCFGrammar.hs +++ b/src/GF/CFGM/PrintCFGrammar.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/04/21 16:21:19 $ --- > CVS $Author: bringert $ --- > CVS $Revision: 1.17 $ +-- > CVS $Date: 2005/05/13 12:40:18 $ +-- > CVS $Author: peb $ +-- > CVS $Revision: 1.18 $ -- -- Handles printing a CFGrammar in CFGM format. ----------------------------------------------------------------------------- @@ -23,6 +23,7 @@ import GF.Infra.Modules import qualified GF.Conversion.GFC as Cnv import GF.Infra.Print (prt) import GF.Formalism.CFG (CFRule(..)) +import qualified GF.Formalism.Utilities as GU import qualified GF.Conversion.Types as GT import qualified GF.CFGM.AbsCFG as AbsCFG import GF.Formalism.Utilities (Symbol(..)) @@ -66,7 +67,7 @@ cfGrammarToCFGM gr i start = AbsCFG.Grammar (identToCFGMIdent i) flags (map rule where flags = maybe [] (\c -> [AbsCFG.StartCat $ strToCFGMCat (c++"{}.s")]) start ruleToCFGMRule :: GT.CRule -> AbsCFG.Rule -ruleToCFGMRule (CFRule c rhs (GT.Name fun profile)) +ruleToCFGMRule (CFRule c rhs (GU.Name fun profile)) = AbsCFG.Rule fun' p' c' rhs' where fun' = identToFun fun @@ -74,10 +75,10 @@ ruleToCFGMRule (CFRule c rhs (GT.Name fun profile)) c' = catToCFGMCat c rhs' = map symbolToGFCMSymbol rhs -profileToCFGMProfile :: [GT.Profile a] -> AbsCFG.Profile +profileToCFGMProfile :: [GU.Profile a] -> AbsCFG.Profile profileToCFGMProfile = AbsCFG.Profile . map cnvProfile - where cnvProfile (GT.Unify ns) = AbsCFG.Ints $ map fromIntegral ns - cnvProfile (GT.Constant a) = AbsCFG.Ints [] + where cnvProfile (GU.Unify ns) = AbsCFG.Ints $ map fromIntegral ns + cnvProfile (GU.Constant a) = AbsCFG.Ints [] -- FIXME: this should be replaced with a new constructor in 'AbsCFG' identToCFGMIdent :: Ident -> AbsCFG.Ident |
