From b96b36f43de3e2f8b58d5f539daa6f6d47f25870 Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 25 Jun 2008 16:43:48 +0000 Subject: removed src for 2.9 --- src/GF/Speech/PrFA.hs | 56 --------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 src/GF/Speech/PrFA.hs (limited to 'src/GF/Speech/PrFA.hs') diff --git a/src/GF/Speech/PrFA.hs b/src/GF/Speech/PrFA.hs deleted file mode 100644 index 2856039ec..000000000 --- a/src/GF/Speech/PrFA.hs +++ /dev/null @@ -1,56 +0,0 @@ ----------------------------------------------------------------------- --- | --- Module : PrSLF --- Maintainer : BB --- Stability : (stable) --- Portability : (portable) --- --- > CVS $Date: 2005/11/10 16:43:44 $ --- > CVS $Author: bringert $ --- > CVS $Revision: 1.2 $ --- --- This module prints finite automata and regular grammars --- for a context-free grammar. --- --- FIXME: remove \/ warn \/ fail if there are int \/ string literal --- categories in the grammar ------------------------------------------------------------------------------ - -module GF.Speech.PrFA (faGraphvizPrinter,regularPrinter,faCPrinter) where - -import GF.Data.Utilities -import GF.Conversion.Types -import GF.Formalism.CFG -import GF.Formalism.Utilities (Symbol(..),symbol) -import GF.Infra.Ident -import GF.Infra.Option (Options) -import GF.Infra.Print -import GF.Speech.CFGToFiniteState -import GF.Speech.FiniteState -import GF.Speech.TransformCFG -import GF.Compile.ShellState (StateGrammar) - -import Data.Char (toUpper,toLower) -import Data.List -import Data.Maybe (fromMaybe) - - - -faGraphvizPrinter :: Options -> StateGrammar -> String -faGraphvizPrinter opts s = - prFAGraphviz $ mapStates (const "") $ cfgToFA opts s - --- | Convert the grammar to a regular grammar and print it in BNF -regularPrinter :: Options -> StateGrammar -> String -regularPrinter opts s = prCFRules $ makeSimpleRegular opts s - where - prCFRules :: CFRules -> String - prCFRules g = unlines [ c ++ " ::= " ++ join " | " (map (showRhs . ruleRhs) rs) | (c,rs) <- allRulesGrouped g] - join g = concat . intersperse g - showRhs = unwords . map (symbol id show) - -faCPrinter :: Options -> StateGrammar -> String -faCPrinter opts s = fa2c $ cfgToFA opts s - -fa2c :: DFA String -> String -fa2c fa = undefined -- cgit v1.2.3