From 741dde5a2a00dc737e570a7005663c2534ea4f6d Mon Sep 17 00:00:00 2001 From: bringert Date: Fri, 5 Jan 2007 14:34:20 +0000 Subject: 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. --- src/GF/Speech/TransformCFG.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/GF/Speech/TransformCFG.hs') diff --git a/src/GF/Speech/TransformCFG.hs b/src/GF/Speech/TransformCFG.hs index 57563af19..923e90d7c 100644 --- a/src/GF/Speech/TransformCFG.hs +++ b/src/GF/Speech/TransformCFG.hs @@ -32,6 +32,7 @@ import GF.Infra.Ident import GF.Infra.Option import GF.Infra.Print import GF.Speech.Relation +import GF.Compile.ShellState (StateGrammar, stateCFG) import Control.Monad import Control.Monad.State (State, get, put, evalState) @@ -63,11 +64,12 @@ type CFSymbol_ = Symbol Cat_ Token type CFRules = [(Cat_,[CFRule_])] -cfgToCFRules :: CGrammar -> CFRules -cfgToCFRules cfg = +cfgToCFRules :: StateGrammar -> CFRules +cfgToCFRules s = groupProds [CFRule (catToString c) (map symb r) (nameToTerm n) | CFRule c r n <- cfg] - where symb = mapSymbol catToString id + where cfg = stateCFG s + symb = mapSymbol catToString id catToString = prt nameToTerm (Name f prs) = CFObj f (map profileToTerm prs) profileToTerm (Unify []) = CFMeta -- cgit v1.2.3