diff options
| author | aarne <aarne@cs.chalmers.se> | 2008-06-25 16:43:48 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2008-06-25 16:43:48 +0000 |
| commit | b96b36f43de3e2f8b58d5f539daa6f6d47f25870 (patch) | |
| tree | 0992334be13cec6538a1dea22fbbf26ad6bdf224 /src/GF/Conversion/MCFGtoCFG.hs | |
| parent | fe367412e0aeb4ad5c02de68e6eca382e0f96984 (diff) | |
removed src for 2.9
Diffstat (limited to 'src/GF/Conversion/MCFGtoCFG.hs')
| -rw-r--r-- | src/GF/Conversion/MCFGtoCFG.hs | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/GF/Conversion/MCFGtoCFG.hs b/src/GF/Conversion/MCFGtoCFG.hs deleted file mode 100644 index a58c31d37..000000000 --- a/src/GF/Conversion/MCFGtoCFG.hs +++ /dev/null @@ -1,53 +0,0 @@ ----------------------------------------------------------------------- --- | --- Maintainer : PL --- Stability : (stable) --- Portability : (portable) --- --- > CVS $Date: 2005/05/09 09:28:43 $ --- > CVS $Author: peb $ --- > CVS $Revision: 1.6 $ --- --- Converting MCFG grammars to (possibly overgenerating) CFG ------------------------------------------------------------------------------ - - -module GF.Conversion.MCFGtoCFG - (convertGrammar) where - -import GF.System.Tracing -import GF.Infra.Print - -import Control.Monad -import GF.Formalism.Utilities -import GF.Formalism.GCFG -import GF.Formalism.MCFG -import GF.Formalism.CFG -import GF.Conversion.Types - ----------------------------------------------------------------------- --- * converting (possibly erasing) MCFG grammars - -convertGrammar :: EGrammar -> CGrammar -convertGrammar gram = tracePrt "MCFGtoCFG - context-free rules" (prt.length) $ - concatMap convertRule gram - -convertRule :: ERule -> [CRule] -convertRule (Rule (Abs cat args (Name fun mprofile)) (Cnc _ _ record)) - = [ CFRule (CCat cat lbl) rhs (Name fun profile) | - Lin lbl lin <- record, - let rhs = map (mapSymbol convertArg id) lin, - let cprofile = map (Unify . argPlaces lin) [0 .. length args-1], - let profile = mprofile `composeProfiles` cprofile - ] - -convertArg :: (ECat, ELabel, Int) -> CCat -convertArg (cat, lbl, _) = CCat cat lbl - -argPlaces :: [Symbol (cat, lbl, Int) tok] -> Int -> [Int] -argPlaces lin nr = [ place | (nr', place) <- zip linArgs [0..], nr == nr' ] - where linArgs = [ nr' | (_, _, nr') <- filterCats lin ] - - - - |
