diff options
| author | gdetrez <gdetrez@crans.org> | 2010-12-11 16:36:30 +0000 |
|---|---|---|
| committer | gdetrez <gdetrez@crans.org> | 2010-12-11 16:36:30 +0000 |
| commit | d7ae73f1c7c5b95f1f08dadd314fa7143602b523 (patch) | |
| tree | e76f59a491f36859ae8636affcb6e969ada65af6 /src/compiler/GF/Infra | |
| parent | a59df6b49575f54756615c6e2b860ea0972a81eb (diff) | |
Adding an option to the gf compiler to add an index to pgf files
This is gonna be used by the android library to skip unused part of a
pgf file
Diffstat (limited to 'src/compiler/GF/Infra')
| -rw-r--r-- | src/compiler/GF/Infra/Option.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/GF/Infra/Option.hs b/src/compiler/GF/Infra/Option.hs index fecfa273f..9c8925f3d 100644 --- a/src/compiler/GF/Infra/Option.hs +++ b/src/compiler/GF/Infra/Option.hs @@ -167,6 +167,7 @@ data Flags = Flags { optEncoding :: String, optOptimizations :: Set Optimization, optOptimizePGF :: Bool, + optMkIndexPGF :: Bool, optCFGTransforms :: Set CFGTransform, optLibraryPath :: [FilePath], optStartCat :: Maybe String, @@ -268,6 +269,7 @@ defaultFlags = Flags { optEncoding = "latin1", optOptimizations = Set.fromList [OptStem,OptCSE,OptExpand,OptParametrize], optOptimizePGF = False, + optMkIndexPGF = False, optCFGTransforms = Set.fromList [CFGRemoveCycles, CFGBottomUpFilter, CFGTopDownFilter, CFGMergeIdentical], optLibraryPath = [], @@ -360,6 +362,8 @@ optDescr = "Select an optimization package. OPT = all | values | parametrize | none", Option [] ["optimize-pgf"] (NoArg (optimize_pgf True)) "Enable or disable global grammar optimization. This could significantly reduce the size of the final PGF file", + Option [] ["mk-index"] (NoArg (mkIndex True)) + "Add an index to the pgf file", Option [] ["stem"] (onOff (toggleOptimize OptStem) True) "Perform stem-suffix analysis (default on).", Option [] ["cse"] (onOff (toggleOptimize OptCSE) True) "Perform common sub-expression elimination (default on).", Option [] ["cfg"] (ReqArg cfgTransform "TRANS") "Enable or disable specific CFG transformations. TRANS = merge, no-merge, bottomup, no-bottomup, ...", @@ -421,6 +425,7 @@ optDescr = Nothing -> fail $ "Unknown optimization package: " ++ x optimize_pgf x = set $ \o -> o { optOptimizePGF = x } + mkIndex x = set $ \o -> o { optMkIndexPGF = x } toggleOptimize x b = set $ setOptimization' x b |
