CFRules tracing.

This commit is contained in:
bringert
2007-06-28 01:26:09 +00:00
parent cbf851b516
commit da6e0efc11
2 changed files with 7 additions and 1 deletions

View File

@@ -369,3 +369,9 @@ isLeftLinear :: Ord c =>
-> CFRule c n t -- ^ The rule to check for left-linearity
-> Bool
isLeftLinear cs = noCatsInSet cs . drop 1 . ruleRhs
prCFRules :: CFRules -> String
prCFRules = unlines . map prRule . allRules
where
prRule r = lhsCat r ++ " --> " ++ unwords (map prSym (ruleRhs r))
prSym = symbol id (\t -> "\""++ t ++"\"")