summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbjorn <bjorn@bringert.net>2008-09-26 10:03:42 +0000
committerbjorn <bjorn@bringert.net>2008-09-26 10:03:42 +0000
commit7a81b559fe90b4d1c389c21025da56e5159769e9 (patch)
tree54d3ac7391ff48ee81efa221ba70dd1adbb1ae12 /src
parenta372357adce9839b31c248f4797512031c624a2a (diff)
Changed nolr printer to use EBNF format.
Diffstat (limited to 'src')
-rw-r--r--src/GF/Compile/Export.hs4
-rw-r--r--src/GF/Speech/PGFToCFG.hs5
-rw-r--r--src/GF/Speech/SRG.hs4
3 files changed, 7 insertions, 6 deletions
diff --git a/src/GF/Compile/Export.hs b/src/GF/Compile/Export.hs
index e89fbd033..328072f87 100644
--- a/src/GF/Compile/Export.hs
+++ b/src/GF/Compile/Export.hs
@@ -14,7 +14,7 @@ import GF.Speech.SRGS_ABNF
import GF.Speech.SRGS_XML
import GF.Speech.JSGF
import GF.Speech.GSL
-import GF.Speech.SRG (ebnfPrinter)
+import GF.Speech.SRG (ebnfPrinter, nonLeftRecursivePrinter)
import GF.Speech.VoiceXML
import GF.Speech.SLF
import GF.Speech.PrRegExp
@@ -39,7 +39,7 @@ exportPGF opts fmt pgf =
FmtProlog_Abs -> multi "pl" grammar2prolog_abs
FmtBNF -> single "bnf" bnfPrinter
FmtEBNF -> single "ebnf" ebnfPrinter
- FmtNoLR -> single "bnf" nonLeftRecursivePrinter
+ FmtNoLR -> single "ebnf" nonLeftRecursivePrinter
FmtRegular -> single "bnf" regularPrinter
FmtFCFG -> single "fcfg" fcfgPrinter
FmtSRGS_XML -> single "grxml" (srgsXmlPrinter sisr)
diff --git a/src/GF/Speech/PGFToCFG.hs b/src/GF/Speech/PGFToCFG.hs
index 0602e5a58..27f08ba2d 100644
--- a/src/GF/Speech/PGFToCFG.hs
+++ b/src/GF/Speech/PGFToCFG.hs
@@ -4,7 +4,7 @@
--
-- Approximates PGF grammars with context-free grammars.
----------------------------------------------------------------------
-module GF.Speech.PGFToCFG (bnfPrinter, nonLeftRecursivePrinter, regularPrinter,
+module GF.Speech.PGFToCFG (bnfPrinter, regularPrinter,
fcfgPrinter, pgfToCFG) where
import PGF.CId
@@ -26,9 +26,6 @@ import qualified Data.Set as Set
bnfPrinter :: PGF -> CId -> String
bnfPrinter = toBNF id
-nonLeftRecursivePrinter :: PGF -> CId -> String
-nonLeftRecursivePrinter = toBNF removeLeftRecursion
-
regularPrinter :: PGF -> CId -> String
regularPrinter = toBNF makeRegular
diff --git a/src/GF/Speech/SRG.hs b/src/GF/Speech/SRG.hs
index 7ac5ab081..cee210dff 100644
--- a/src/GF/Speech/SRG.hs
+++ b/src/GF/Speech/SRG.hs
@@ -11,6 +11,7 @@
module GF.Speech.SRG (SRG(..), SRGRule(..), SRGAlt(..), SRGItem, SRGSymbol
, SRGNT, CFTerm
, ebnfPrinter
+ , nonLeftRecursivePrinter
, makeSimpleSRG
, makeNonRecursiveSRG
, getSpeechLanguage
@@ -69,6 +70,9 @@ type SRGNT = (Cat, Int)
ebnfPrinter :: PGF -> CId -> String
ebnfPrinter pgf cnc = prSRG $ makeSRG id pgf cnc
+nonLeftRecursivePrinter :: PGF -> CId -> String
+nonLeftRecursivePrinter pgf cnc = prSRG $ makeSRG removeLeftRecursion pgf cnc
+
makeSRG :: (CFG -> CFG) -> PGF -> CId -> SRG
makeSRG = mkSRG cfgToSRG
where