From a78acc722ec26be2be20f22f74e98329d57008b1 Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 5 Oct 2005 19:02:19 +0000 Subject: grep etc --- src/GF/UseGrammar/Information.hs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/GF/UseGrammar/Information.hs') diff --git a/src/GF/UseGrammar/Information.hs b/src/GF/UseGrammar/Information.hs index 446173aa2..094eb698c 100644 --- a/src/GF/UseGrammar/Information.hs +++ b/src/GF/UseGrammar/Information.hs @@ -5,16 +5,19 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/05/30 18:39:45 $ +-- > CVS $Date: 2005/10/05 20:02:20 $ -- > CVS $Author: aarne $ --- > CVS $Revision: 1.6 $ +-- > CVS $Revision: 1.7 $ -- -- information on module, category, function, operation, parameter,... -- AR 16\/9\/2003. -- uses source grammar ----------------------------------------------------------------------------- -module GF.UseGrammar.Information (showInformation) where +module GF.UseGrammar.Information ( + showInformation, + missingLinCanonGrammar + ) where import GF.Grammar.Grammar import GF.Infra.Ident @@ -25,6 +28,7 @@ import GF.CF.PPrCF import GF.Compile.ShellState import GF.Grammar.PrGrammar import GF.Grammar.Lookup +import GF.Grammar.Macros (zIdent) import qualified GF.Canon.GFC as GFC import qualified GF.Canon.AbsGFC as AbsGFC @@ -141,3 +145,11 @@ ownConstants = map fst . filter isOwn . tree2list where AnyInd _ _ -> False _ -> True +missingLinCanonGrammar :: GFC.CanonGrammar -> String +missingLinCanonGrammar cgr = + unlines $ concat [prt_ c : missing js | (c,js) <- concretes] where + missing js = map ((" " ++) . prt_) $ filter (not . flip isInBinTree js) abstract + abstract = err (const []) (map fst . tree2list . jments) $ lookupModMod cgr absId + absId = maybe (zIdent "") id $ greatestAbstract cgr + concretes = [(cnc,jments mo) | + cnc <- allConcretes cgr absId, Ok mo <- [lookupModMod cgr cnc]] -- cgit v1.2.3