diff options
| author | bringert <unknown> | 2005-04-15 08:45:32 +0000 |
|---|---|---|
| committer | bringert <unknown> | 2005-04-15 08:45:32 +0000 |
| commit | 2c36d9c62386c6d06a40c4b6ed4a12e96119b5ae (patch) | |
| tree | 7489f901458afb66e86a741e7e2dae14d94c08a5 /src | |
| parent | 5207c27bffd077f1ab322824b485fc6c92d554eb (diff) | |
Removed some dead code from gsl and cfgm generation.
Diffstat (limited to 'src')
| -rw-r--r-- | src/GF/CFGM/PrintCFGrammar.hs | 38 | ||||
| -rw-r--r-- | src/GF/Speech/PrGSL.hs | 11 | ||||
| -rw-r--r-- | src/GF/Speech/PrJSGF.hs | 10 | ||||
| -rw-r--r-- | src/GF/Speech/TransformCFG.hs | 12 |
4 files changed, 15 insertions, 56 deletions
diff --git a/src/GF/CFGM/PrintCFGrammar.hs b/src/GF/CFGM/PrintCFGrammar.hs index bb213e32b..a0bc4ea9c 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/14 18:38:36 $ --- > CVS $Author: peb $ --- > CVS $Revision: 1.14 $ +-- > CVS $Date: 2005/04/15 09:45:32 $ +-- > CVS $Author: bringert $ +-- > CVS $Revision: 1.15 $ -- -- Handles printing a CFGrammar in CFGM format. ----------------------------------------------------------------------------- @@ -20,12 +20,6 @@ import Ident import GFC import Modules --- import qualified GF.OldParsing.ConvertGrammar as Cnv --- import qualified GF.Printing.PrintParser as Prt --- import qualified GF.OldParsing.CFGrammar as CFGrammar --- import qualified GF.OldParsing.GrammarTypes as GT --- import qualified AbsCFG --- import qualified GF.OldParsing.Utilities as Parser import qualified GF.Conversion.GFC as Cnv import GF.Infra.Print (prt) import GF.Formalism.CFG (CFRule(..)) @@ -39,7 +33,6 @@ import qualified Option import List (intersperse) import Maybe (listToMaybe, maybe) --- | FIXME: fix warning about bad -printer= value prCanonAsCFGM :: CanonGrammar -> String prCanonAsCFGM gr = unlines $ map (uncurry (prLangAsCFGM gr)) xs where @@ -60,17 +53,6 @@ prLangAsCFGM gr i start = prCFGrammarAsCFGM (Cnv.gfc2cfg (gr, i)) i start -- prLangAsCFGM gr i start = prCFGrammarAsCFGM (Cnv.cfg (Cnv.pInfo opts gr i)) i start -- where opts = Option.Opts [Option.gfcConversion "nondet"] -{- -prCFGrammarAsCFGM :: GT.CFGrammar -> Ident -> Maybe String -> String -prCFGrammarAsCFGM gr i@(IC lang) start = (header . startcat . rules . footer) "" - where - header = showString "grammar " . showString lang . showString "\n" - startcat = maybe id (\s -> showString "startcat " . showString (s++"{}.s") . showString ";\n") start - rules0 = map prt gr - rules = showString $ concat $ map (\l -> init l++";\n") rules0 - footer = showString "end grammar\n" --} - prCFGrammarAsCFGM :: GT.CGrammar -> Ident -> Maybe String -> String prCFGrammarAsCFGM gr i start = PrintCFG.printTree $ cfGrammarToCFGM gr i start @@ -79,7 +61,6 @@ 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 --- new version, without the MCFName constructor: ruleToCFGMRule (CFRule c rhs (GT.Name fun profile)) = AbsCFG.Rule fun' p' c' rhs' where @@ -88,22 +69,11 @@ ruleToCFGMRule (CFRule c rhs (GT.Name fun profile)) c' = catToCFGMCat c rhs' = map symbolToGFCMSymbol rhs -{- old version, with the MCFName constructor: -ruleToCFGMRule (CFGrammar.Rule c rhs (GT.CFName (GT.MCFName fun cat args) lbl profile)) - = AbsCFG.Rule fun' n' p' c' rhs' - where - fun' = identToCFGMIdent fun - n' = strToCFGMName (prt cat ++ concat [ "/" ++ prt arg | arg <- args ] ++ prt lbl) - p' = profileToCFGMProfile profile - c' = catToCFGMCat c - rhs' = map symbolToGFCMSymbol rhs --} - profileToCFGMProfile :: [GT.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 [] - -- this should be replaced with a new constructor in 'AbsCFG' + -- FIXME: this should be replaced with a new constructor in 'AbsCFG' identToCFGMIdent :: Ident -> AbsCFG.Ident identToCFGMIdent = AbsCFG.Ident . prt diff --git a/src/GF/Speech/PrGSL.hs b/src/GF/Speech/PrGSL.hs index 84e3f2a74..0455e3653 100644 --- a/src/GF/Speech/PrGSL.hs +++ b/src/GF/Speech/PrGSL.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/04/14 18:38:36 $ --- > CVS $Author: peb $ --- > CVS $Revision: 1.16 $ +-- > CVS $Date: 2005/04/15 09:45:32 $ +-- > CVS $Author: bringert $ +-- > CVS $Revision: 1.17 $ -- -- This module prints a CFG as a Nuance GSL 2.0 grammar. -- @@ -19,10 +19,7 @@ module PrGSL (gslPrinter) where import SRG import Ident --- import GF.OldParsing.CFGrammar --- import GF.OldParsing.Utilities (Symbol(..)) --- import GF.OldParsing.GrammarTypes --- import GF.Printing.PrintParser + import GF.Formalism.CFG import GF.Formalism.Utilities (Symbol(..)) import GF.Conversion.Types diff --git a/src/GF/Speech/PrJSGF.hs b/src/GF/Speech/PrJSGF.hs index 975685d81..178365bac 100644 --- a/src/GF/Speech/PrJSGF.hs +++ b/src/GF/Speech/PrJSGF.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/04/14 18:38:36 $ --- > CVS $Author: peb $ --- > CVS $Revision: 1.10 $ +-- > CVS $Date: 2005/04/15 09:45:32 $ +-- > CVS $Author: bringert $ +-- > CVS $Revision: 1.11 $ -- -- This module prints a CFG as a JSGF grammar. -- @@ -21,10 +21,6 @@ module PrJSGF (jsgfPrinter) where import SRG import Ident --- import GF.OldParsing.CFGrammar --- import GF.OldParsing.Utilities (Symbol(..)) --- import GF.OldParsing.GrammarTypes --- import GF.Printing.PrintParser import GF.Formalism.CFG import GF.Formalism.Utilities (Symbol(..)) import GF.Conversion.Types diff --git a/src/GF/Speech/TransformCFG.hs b/src/GF/Speech/TransformCFG.hs index 6a1b7c817..8e2673a9f 100644 --- a/src/GF/Speech/TransformCFG.hs +++ b/src/GF/Speech/TransformCFG.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/04/14 18:38:36 $ --- > CVS $Author: peb $ --- > CVS $Revision: 1.10 $ +-- > CVS $Date: 2005/04/15 09:45:32 $ +-- > CVS $Author: bringert $ +-- > CVS $Revision: 1.11 $ -- -- This module does some useful transformations on CFGs. -- @@ -19,10 +19,6 @@ module TransformCFG (makeNice, CFRule_) where import Ident --- import GF.OldParsing.CFGrammar --- import GF.OldParsing.Utilities (Symbol(..)) --- import GF.OldParsing.GrammarTypes --- import GF.Printing.PrintParser import GF.Formalism.CFG import GF.Formalism.Utilities (Symbol(..), mapSymbol) import GF.Conversion.Types @@ -35,7 +31,7 @@ import Data.Maybe (fromJust) import Debug.Trace --- | not very nice to get replace the structured CFCat type with a simple string +-- | not very nice to replace the structured CFCat type with a simple string type CFRule_ = CFRule Cat_ Name Token type Cat_ = String |
