summaryrefslogtreecommitdiff
path: root/src/GF
diff options
context:
space:
mode:
authorbjorn <bjorn@bringert.net>2008-10-20 11:35:05 +0000
committerbjorn <bjorn@bringert.net>2008-10-20 11:35:05 +0000
commita26290659d2d7799f920d0aae64383e17004abdb (patch)
treefdb009690775fe0fd92936a406af315e62005fc3 /src/GF
parent3d92897a944fef8f201b3ced837156b50c415106 (diff)
Replace Category with Type in the PGF API. Added readLanguage and showLanguage.
Diffstat (limited to 'src/GF')
-rw-r--r--src/GF/Command/Commands.hs4
-rw-r--r--src/GF/Compile/GFCCtoJS.hs2
-rw-r--r--src/GF/Speech/PGFToCFG.hs2
-rw-r--r--src/GF/Speech/VoiceXML.hs2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/GF/Command/Commands.hs b/src/GF/Command/Commands.hs
index a2850b6a2..4d6a29ce7 100644
--- a/src/GF/Command/Commands.hs
+++ b/src/GF/Command/Commands.hs
@@ -578,7 +578,7 @@ allCommands cod pgf = Map.fromList [
lang -> map mkCId (chunks ',' lang)
optLang opts = head $ optLangs opts ++ [wildCId]
optType opts =
- let str = valStrOpts "cat" (lookStartCat pgf) opts
+ let str = valStrOpts "cat" (prCId $ lookStartCat pgf) opts
in case readType str of
Just ty -> ty
Nothing -> error ("Can't parse '"++str++"' as type")
@@ -595,7 +595,7 @@ allCommands cod pgf = Map.fromList [
toString = unwords . toStrings
prGrammar opts = case opts of
- _ | isOpt "cats" opts -> unwords $ map prCId $ categories pgf
+ _ | isOpt "cats" opts -> unwords $ map showType $ categories pgf
_ | isOpt "fullform" opts -> concatMap
(prFullFormLexicon . buildMorpho pgf) $ optLangs opts
_ | isOpt "missing" opts ->
diff --git a/src/GF/Compile/GFCCtoJS.hs b/src/GF/Compile/GFCCtoJS.hs
index 12c424844..2c3b762da 100644
--- a/src/GF/Compile/GFCCtoJS.hs
+++ b/src/GF/Compile/GFCCtoJS.hs
@@ -26,7 +26,7 @@ pgf2js pgf =
n = prCId $ absname pgf
as = abstract pgf
cs = Map.assocs (concretes pgf)
- start = M.lookStartCat pgf
+ start = prCId $ M.lookStartCat pgf
grammar = new "GFGrammar" [js_abstract, js_concrete]
js_abstract = abstract2js start as
js_concrete = JS.EObj $ map (concrete2js start n) cs
diff --git a/src/GF/Speech/PGFToCFG.hs b/src/GF/Speech/PGFToCFG.hs
index ee778a106..37bc9c0e5 100644
--- a/src/GF/Speech/PGFToCFG.hs
+++ b/src/GF/Speech/PGFToCFG.hs
@@ -31,7 +31,7 @@ toBNF f pgf cnc = prCFG $ f $ pgfToCFG pgf cnc
pgfToCFG :: PGF
-> CId -- ^ Concrete syntax name
-> CFG
-pgfToCFG pgf lang = mkCFG (lookStartCat pgf) extCats (startRules ++ concatMap fruleToCFRule rules)
+pgfToCFG pgf lang = mkCFG (prCId (lookStartCat pgf)) extCats (startRules ++ concatMap fruleToCFRule rules)
where
pinfo = fromMaybe (error "pgfToCFG: No parser.") (lookParser pgf lang)
diff --git a/src/GF/Speech/VoiceXML.hs b/src/GF/Speech/VoiceXML.hs
index 27a948863..a30342cd0 100644
--- a/src/GF/Speech/VoiceXML.hs
+++ b/src/GF/Speech/VoiceXML.hs
@@ -32,7 +32,7 @@ grammar2vxml pgf cnc = showsXMLDoc (skel2vxml name language start skel qs) ""
name = prCId cnc
qs = catQuestions pgf cnc (map fst skel)
language = getSpeechLanguage pgf cnc
- start = mkCId (lookStartCat pgf)
+ start = lookStartCat pgf
--
-- * VSkeleton: a simple description of the abstract syntax.