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/Speech/PrFA.hs | |
| parent | fe367412e0aeb4ad5c02de68e6eca382e0f96984 (diff) | |
removed src for 2.9
Diffstat (limited to 'src/GF/Speech/PrFA.hs')
| -rw-r--r-- | src/GF/Speech/PrFA.hs | 56 |
1 files changed, 0 insertions, 56 deletions
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 |
