Removed cycles when building SRGs, to avoid getting left-recursive grammars.

This commit is contained in:
bringert
2006-04-13 14:47:37 +00:00
parent 26b61d82ee
commit c47da3d351
2 changed files with 5 additions and 3 deletions

View File

@@ -74,7 +74,7 @@ makeSimpleSRG :: Ident -- ^ Grammar name
-> CGrammar -- ^ A context-free grammar
-> SRG
makeSimpleSRG
= makeSRG_ (removeLeftRecursion . removeIdenticalRules . removeEmptyCats)
= makeSRG_ (removeLeftRecursion . removeIdenticalRules . removeEmptyCats . removeCycles)
-- | Create a SRG preserving the names, profiles and probabilities of the
-- input grammar. The returned grammar may be left-recursive.