summaryrefslogtreecommitdiff
path: root/src/GF/Parsing/CFG
diff options
context:
space:
mode:
authorpeb <unknown>2005-05-09 08:25:56 +0000
committerpeb <unknown>2005-05-09 08:25:56 +0000
commit2b059b811db03a53e8e0f8ec1a655e507851a995 (patch)
tree467ad9a1849bf454b22d5b2a457d09f8247041e6 /src/GF/Parsing/CFG
parent01696e4f86fa156d079f2febaf103fbe229ffdb1 (diff)
"Committed_by_peb"
Diffstat (limited to 'src/GF/Parsing/CFG')
-rw-r--r--src/GF/Parsing/CFG/PInfo.hs27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/GF/Parsing/CFG/PInfo.hs b/src/GF/Parsing/CFG/PInfo.hs
index 81d8d3724..f877b225e 100644
--- a/src/GF/Parsing/CFG/PInfo.hs
+++ b/src/GF/Parsing/CFG/PInfo.hs
@@ -4,9 +4,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/04/21 16:23:10 $
--- > CVS $Author: bringert $
--- > CVS $Revision: 1.4 $
+-- > CVS $Date: 2005/05/09 09:28:45 $
+-- > CVS $Author: peb $
+-- > CVS $Revision: 1.5 $
--
-- CFG parsing, parser information
-----------------------------------------------------------------------------
@@ -47,7 +47,7 @@ data CFPInfo c n t
-- ^ DOES NOT WORK WITH EMPTY RULES!!!
}
-buildCFPInfo :: (Ord n, Ord c, Ord t) => CFGrammar c n t -> CFPInfo c n t
+buildCFPInfo :: (Ord c, Ord n, Ord t) => CFGrammar c n t -> CFPInfo c n t
-- this is not permanent...
buildCFPInfo grammar = traceCalcFirst grammar $
@@ -82,16 +82,17 @@ isCyclic _ = False
----------------------------------------------------------------------
+-- pretty-printing of statistics
-instance (Ord n, Ord c, Ord t) => Print (CFPInfo n c t) where
- prt pI = "[ nr. tokens=" ++ sl grammarTokens ++
- "; nr. names=" ++ sla nameRules ++
- "; nr. tdCats=" ++ sla topdownRules ++
- "; nr. buCats=" ++ sla bottomupRules ++
- "; nr. elcCats=" ++ sla emptyLeftcornerRules ++
- "; nr. eCats=" ++ sla emptyCategories ++
- "; nr. cCats=" ++ sl cyclicCategories ++
- "; nr. lctokCats=" ++ sla leftcornerTokens ++
+instance (Ord c, Ord n, Ord t) => Print (CFPInfo c n t) where
+ prt pI = "[ tokens=" ++ sl grammarTokens ++
+ "; names=" ++ sla nameRules ++
+ "; tdCats=" ++ sla topdownRules ++
+ "; buCats=" ++ sla bottomupRules ++
+ "; elcCats=" ++ sla emptyLeftcornerRules ++
+ "; eCats=" ++ sla emptyCategories ++
+ -- "; cCats=" ++ sl cyclicCategories ++
+ -- "; lctokCats=" ++ sla leftcornerTokens ++
" ]"
where sla f = show $ length $ aElems $ f pI
sl f = show $ length $ f pI