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:
@@ -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
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user