diff options
| author | peb <unknown> | 2005-03-21 21:31:43 +0000 |
|---|---|---|
| committer | peb <unknown> | 2005-03-21 21:31:43 +0000 |
| commit | 531be3a72e938f2360d312c7fd9cd173e5442594 (patch) | |
| tree | 7857722b476b4091e600301525f394b98e886095 /src/GF/Parsing/ConvertGrammar.hs | |
| parent | 75d228629a267da1be6c26a6fb13a14f3da0f7c2 (diff) | |
"Committed_by_peb"
Diffstat (limited to 'src/GF/Parsing/ConvertGrammar.hs')
| -rw-r--r-- | src/GF/Parsing/ConvertGrammar.hs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/GF/Parsing/ConvertGrammar.hs b/src/GF/Parsing/ConvertGrammar.hs new file mode 100644 index 000000000..f8ce9335f --- /dev/null +++ b/src/GF/Parsing/ConvertGrammar.hs @@ -0,0 +1,42 @@ +---------------------------------------------------------------------- +-- | +-- Module : ConvertGrammar +-- Maintainer : PL +-- Stability : (stable) +-- Portability : (portable) +-- +-- > CVS $Date: 2005/03/21 22:31:46 $ +-- > CVS $Author: peb $ +-- > CVS $Revision: 1.1 $ +-- +-- All (?) grammar conversions which are used in GF +----------------------------------------------------------------------------- + + +module GF.Parsing.ConvertGrammar + (pInfo, emptyPInfo, + module GF.Parsing.GrammarTypes + ) where + +import GFC (CanonGrammar) +import GF.Parsing.GrammarTypes +import Ident (Ident(..)) +import Option +import Tracing + +import qualified GF.Parsing.ConvertGFCtoMCFG as G2M +import qualified GF.Parsing.ConvertMCFGtoCFG as M2C +import qualified GF.Parsing.MCFGrammar as MCFG +import qualified GF.Parsing.CFGrammar as CFG + +pInfo :: Options -> CanonGrammar -> Ident -> PInfo +pInfo opts canon lng = PInfo mcfg cfg mcfp cfp + where mcfg = G2M.convertGrammar cnv (canon, lng) + cnv = maybe "nondet" id $ getOptVal opts gfcConversion + cfg = M2C.convertGrammar mcfg + mcfp = MCFG.pInfo mcfg + cfp = CFG.pInfo cfg + +emptyPInfo :: PInfo +emptyPInfo = PInfo [] [] (MCFG.pInfo []) (CFG.pInfo []) + |
