1
0
forked from GitHub/gf-core

Added --cfg option for specifying which CFG transformations to use. Added startcatonly CFG trasnformation. Removed output formats that are now easily done with --cfg: "regular", "nolr".

This commit is contained in:
bjorn
2008-09-30 11:52:11 +00:00
parent 794fbd4a41
commit 446aa1b5db
8 changed files with 106 additions and 69 deletions

View File

@@ -101,6 +101,10 @@ mergeIdentical g = onRules (map subst) g
subst (CFRule c r n) = CFRule (substCat c) (map (mapSymbol substCat id) r) n
substCat c = Map.findWithDefault (error $ "mergeIdentical: " ++ c) c m
-- | Keeps only the start category as an external category.
purgeExternalCats :: CFG -> CFG
purgeExternalCats cfg = cfg { cfgExternalCats = Set.singleton (cfgStartCat cfg) }
--
-- * Removing left recursion
--