diff options
| author | bringert <bringert@cs.chalmers.se> | 2007-01-05 15:38:47 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2007-01-05 15:38:47 +0000 |
| commit | 6ee7296f9dd5290bb3ee581403a18464444ab28b (patch) | |
| tree | e78719e9463866a899bfe5e1cabc26844860e7c0 /src/GF/Speech/PrFA.hs | |
| parent | 741dde5a2a00dc737e570a7005663c2534ea4f6d (diff) | |
Changed all SRG printer to take Options and StateGrammar arguments. This makes Custom a lot cleaner.
Diffstat (limited to 'src/GF/Speech/PrFA.hs')
| -rw-r--r-- | src/GF/Speech/PrFA.hs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/GF/Speech/PrFA.hs b/src/GF/Speech/PrFA.hs index c1d5ca8ec..aeb43fde2 100644 --- a/src/GF/Speech/PrFA.hs +++ b/src/GF/Speech/PrFA.hs @@ -23,6 +23,7 @@ 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 @@ -36,23 +37,21 @@ import Data.Maybe (fromMaybe) -faGraphvizPrinter :: Ident -- ^ Grammar name - -> String -> StateGrammar -> String -faGraphvizPrinter name start = - prFAGraphviz . mapStates (const "") . cfgToFA start +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 :: StateGrammar -> String -regularPrinter = prCFRules . makeSimpleRegular +regularPrinter :: Options -> StateGrammar -> String +regularPrinter opts s = prCFRules $ makeSimpleRegular s where prCFRules :: CFRules -> String prCFRules g = unlines [ c ++ " ::= " ++ join " | " (map (showRhs . ruleRhs) rs) | (c,rs) <- g] join g = concat . intersperse g showRhs = unwords . map (symbol id show) -faCPrinter :: Ident -- ^ Grammar name - -> String -> StateGrammar -> String -faCPrinter name start = fa2c . cfgToFA start +faCPrinter :: Options -> StateGrammar -> String +faCPrinter opts s = fa2c $ cfgToFA opts s fa2c :: DFA String -> String fa2c fa = undefined
\ No newline at end of file |
