summaryrefslogtreecommitdiff
path: root/src/GF/Speech/PrFA.hs
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2007-01-05 14:34:20 +0000
committerbringert <bringert@cs.chalmers.se>2007-01-05 14:34:20 +0000
commit741dde5a2a00dc737e570a7005663c2534ea4f6d (patch)
tree6aebd85fc4d9417a0bb3fbfb450fcf3ea72101b8 /src/GF/Speech/PrFA.hs
parent2b1c6763cc29857ba2890a12eb4330f6e03edd06 (diff)
Change input to the different SRG printers to be StateGrammar instead of CGrammar. This to allow looking at the types in SISR, and to reduce the number of argument passed from Custom.
Diffstat (limited to 'src/GF/Speech/PrFA.hs')
-rw-r--r--src/GF/Speech/PrFA.hs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/GF/Speech/PrFA.hs b/src/GF/Speech/PrFA.hs
index c5ac4e134..c1d5ca8ec 100644
--- a/src/GF/Speech/PrFA.hs
+++ b/src/GF/Speech/PrFA.hs
@@ -28,6 +28,7 @@ import GF.Speech.CFGToFiniteState
import GF.Speech.FiniteState
import GF.Speech.SRG
import GF.Speech.TransformCFG
+import GF.Compile.ShellState (StateGrammar)
import Data.Char (toUpper,toLower)
import Data.List
@@ -36,14 +37,12 @@ import Data.Maybe (fromMaybe)
faGraphvizPrinter :: Ident -- ^ Grammar name
- -> String -> CGrammar -> String
-faGraphvizPrinter name start cfg =
- prFAGraphviz $ mapStates (const "") fa
- where fa = cfgToFA start cfg
-
+ -> String -> StateGrammar -> String
+faGraphvizPrinter name start =
+ prFAGraphviz . mapStates (const "") . cfgToFA start
-- | Convert the grammar to a regular grammar and print it in BNF
-regularPrinter :: CGrammar -> String
+regularPrinter :: StateGrammar -> String
regularPrinter = prCFRules . makeSimpleRegular
where
prCFRules :: CFRules -> String
@@ -52,8 +51,8 @@ regularPrinter = prCFRules . makeSimpleRegular
showRhs = unwords . map (symbol id show)
faCPrinter :: Ident -- ^ Grammar name
- -> String -> CGrammar -> String
-faCPrinter name start cfg = fa2c $ cfgToFA start cfg
+ -> String -> StateGrammar -> String
+faCPrinter name start = fa2c . cfgToFA start
fa2c :: DFA String -> String
fa2c fa = undefined \ No newline at end of file