summaryrefslogtreecommitdiff
path: root/src/GF
diff options
context:
space:
mode:
authoraarne <unknown>2005-04-20 19:09:19 +0000
committeraarne <unknown>2005-04-20 19:09:19 +0000
commitb60b42ccefb3dba990fba7b2d4e3391008602756 (patch)
tree167a0213d1f720e3bb902aa4f88cf30c874eb817 /src/GF
parent78108f7817fbf3269bb75f278eb9a8540737873e (diff)
pg printnames
Diffstat (limited to 'src/GF')
-rw-r--r--src/GF/Canon/GFC.hs21
-rw-r--r--src/GF/Grammar/PrGrammar.hs7
-rw-r--r--src/GF/UseGrammar/Custom.hs7
3 files changed, 26 insertions, 9 deletions
diff --git a/src/GF/Canon/GFC.hs b/src/GF/Canon/GFC.hs
index ba6f217b9..6e8648045 100644
--- a/src/GF/Canon/GFC.hs
+++ b/src/GF/Canon/GFC.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/03/08 15:51:17 $
--- > CVS $Author: bringert $
--- > CVS $Revision: 1.10 $
+-- > CVS $Date: 2005/04/20 20:09:19 $
+-- > CVS $Author: aarne $
+-- > CVS $Revision: 1.11 $
--
-- canonical GF. AR 10\/9\/2002 -- 9\/5\/2003 -- 21\/9
-----------------------------------------------------------------------------
@@ -19,6 +19,7 @@ module GFC (Context,
CanonAbs,
Info(..),
Printname,
+ prPrintnamesGrammar,
mapInfoTerms,
setFlag
) where
@@ -69,3 +70,17 @@ mapInfoTerms f i = case i of
setFlag :: String -> String -> [Flag] -> [Flag]
setFlag n v fs = Flg (IC n) (IC v):[f | f@(Flg (IC n') _) <- fs, n' /= n]
+
+-- for Ha-Jo 20/2/2005
+
+prPrintnamesGrammar :: CanonGrammar -> String
+prPrintnamesGrammar gr = unlines $ filter (not . null) [prPrint j |
+ (_,M.ModMod m) <- M.modules gr,
+ M.isModCnc m,
+ j <- tree2list $ M.jments m
+ ]
+ where
+ prPrint j = case j of
+ (c,CncCat _ _ p) -> "printname cat" +++ A.prt_ c +++ "=" +++ A.prt_ p
+ (c,CncFun _ _ _ p) -> "printname fun" +++ A.prt_ c +++ "=" +++ A.prt_ p
+ _ -> []
diff --git a/src/GF/Grammar/PrGrammar.hs b/src/GF/Grammar/PrGrammar.hs
index 4f77470fe..47369804b 100644
--- a/src/GF/Grammar/PrGrammar.hs
+++ b/src/GF/Grammar/PrGrammar.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/02/18 19:21:13 $
--- > CVS $Author: peb $
--- > CVS $Revision: 1.11 $
+-- > CVS $Date: 2005/04/20 20:09:19 $
+-- > CVS $Author: aarne $
+-- > CVS $Revision: 1.12 $
--
-- AR 7\/12\/1999 - 1\/4\/2000 - 10\/5\/2003
--
@@ -41,6 +41,7 @@ import qualified PrintGFC as C
import qualified AbsGFC as A
import Values
import GrammarToSource
+--- import GFC (CanonGrammar) --- cycle of modules
import Option
import Ident
diff --git a/src/GF/UseGrammar/Custom.hs b/src/GF/UseGrammar/Custom.hs
index b597447ef..f237f92ad 100644
--- a/src/GF/UseGrammar/Custom.hs
+++ b/src/GF/UseGrammar/Custom.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/04/18 14:55:33 $
--- > CVS $Author: peb $
--- > CVS $Revision: 1.56 $
+-- > CVS $Date: 2005/04/20 20:09:19 $
+-- > CVS $Author: aarne $
+-- > CVS $Revision: 1.57 $
--
-- A database for customizable GF shell commands.
--
@@ -240,6 +240,7 @@ customGrammarPrinter =
,(strCI "fullform",prFullForm . stateMorpho)
,(strCI "opts", prOpts . stateOptions)
,(strCI "words", unwords . stateGrammarWords)
+ ,(strCI "printnames", C.prPrintnamesGrammar . stateGrammarST)
{- ----
(strCI "gf", prt . st2grammar . stateGrammarST) -- DEFAULT
,(strCI "canon", showCanon "Lang" . stateGrammarST)