Do the same initial transformations as for CFGs when generating FAs: remove cycles, identical rules and down top-down and bottom-up filtering.

This commit is contained in:
bringert
2007-03-20 22:00:50 +00:00
parent 50614d399a
commit 00e681aee8
2 changed files with 11 additions and 7 deletions

View File

@@ -43,7 +43,7 @@ faGraphvizPrinter opts s =
-- | Convert the grammar to a regular grammar and print it in BNF
regularPrinter :: Options -> StateGrammar -> String
regularPrinter opts s = prCFRules $ makeSimpleRegular s
regularPrinter opts s = prCFRules $ makeSimpleRegular opts s
where
prCFRules :: CFRules -> String
prCFRules g = unlines [ c ++ " ::= " ++ join " | " (map (showRhs . ruleRhs) rs) | (c,rs) <- g]