summaryrefslogtreecommitdiff
path: root/src/GF/Speech/TransformCFG.hs
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2007-01-05 15:38:47 +0000
committerbringert <bringert@cs.chalmers.se>2007-01-05 15:38:47 +0000
commit6ee7296f9dd5290bb3ee581403a18464444ab28b (patch)
treee78719e9463866a899bfe5e1cabc26844860e7c0 /src/GF/Speech/TransformCFG.hs
parent741dde5a2a00dc737e570a7005663c2534ea4f6d (diff)
Changed all SRG printer to take Options and StateGrammar arguments. This makes Custom a lot cleaner.
Diffstat (limited to 'src/GF/Speech/TransformCFG.hs')
-rw-r--r--src/GF/Speech/TransformCFG.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/GF/Speech/TransformCFG.hs b/src/GF/Speech/TransformCFG.hs
index 923e90d7c..3a167eeef 100644
--- a/src/GF/Speech/TransformCFG.hs
+++ b/src/GF/Speech/TransformCFG.hs
@@ -24,6 +24,7 @@ module GF.Speech.TransformCFG {- (CFRule_, CFRules,
removeEmptyCats, removeIdenticalRules) -} where
import GF.Conversion.Types
+import GF.CF.PPrCF (prCFCat)
import GF.Data.Utilities
import GF.Formalism.CFG
import GF.Formalism.Utilities (Symbol(..), mapSymbol, filterCats, symbol,
@@ -32,7 +33,7 @@ import GF.Infra.Ident
import GF.Infra.Option
import GF.Infra.Print
import GF.Speech.Relation
-import GF.Compile.ShellState (StateGrammar, stateCFG)
+import GF.Compile.ShellState (StateGrammar, stateCFG, startCatStateOpts)
import Control.Monad
import Control.Monad.State (State, get, put, evalState)
@@ -76,6 +77,13 @@ cfgToCFRules s =
profileToTerm (Unify xs) = CFRes (last xs) -- FIXME: unify
profileToTerm (Constant f) = maybe CFMeta (\x -> CFObj x []) (forestName f)
+getStartCat :: Options -> StateGrammar -> String
+getStartCat opts sgr = prCFCat (startCatStateOpts opts sgr)
+
+getStartCatCF :: Options -> StateGrammar -> String
+getStartCatCF opts sgr = getStartCat opts sgr ++ "{}.s"
+
+
-- | Remove productions which use categories which have no productions
removeEmptyCats :: CFRules -> CFRules
removeEmptyCats = fix removeEmptyCats'