diff options
| author | peb <unknown> | 2005-02-18 18:21:06 +0000 |
|---|---|---|
| committer | peb <unknown> | 2005-02-18 18:21:06 +0000 |
| commit | 9568d7a844ba6a1872a8e8f6ef002860057e62ab (patch) | |
| tree | 9e25c6ed62e48101a2782d5fb8dcba68462dc613 /src/GF/Infra/Option.hs | |
| parent | 1c4f025320900897ae3acdab6982f7d595b98dd1 (diff) | |
"Committed_by_peb"
Diffstat (limited to 'src/GF/Infra/Option.hs')
| -rw-r--r-- | src/GF/Infra/Option.hs | 81 |
1 files changed, 72 insertions, 9 deletions
diff --git a/src/GF/Infra/Option.hs b/src/GF/Infra/Option.hs index 4d3cf5393..af2f53735 100644 --- a/src/GF/Infra/Option.hs +++ b/src/GF/Infra/Option.hs @@ -1,18 +1,72 @@ ---------------------------------------------------------------------- -- | --- Module : (Module) --- Maintainer : (Maintainer) +-- Module : Option +-- Maintainer : AR -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date $ --- > CVS $Author $ --- > CVS $Revision $ +-- > CVS $Date: 2005/02/18 19:21:15 $ +-- > CVS $Author: peb $ +-- > CVS $Revision: 1.19 $ -- -- Options and flags used in GF shell commands and files. +-- +-- The types 'Option' and 'Options' should be kept abstract, but: +-- +-- - The constructor 'Opt' is used in "ShellCommands" and "GrammarToSource" +-- +-- - The constructor 'Opts' us udes in "API", "Shell" and "ShellCommands" ----------------------------------------------------------------------------- -module Option where +module Option (-- * all kinds of options, should be kept abstract + Option(..), Options(..), OptFun, OptFunId, + noOptions, iOpt, aOpt, iOpts, oArg, oElem, eqOpt, + getOptVal, getOptInt, optIntOrAll, optIntOrN, optIntOrOne, + changeOptVal, addOption, addOptions, concatOptions, + removeOption, removeOptions, options, unionOptions, + + -- * parsing options, with prefix pre (e.g. \"-\") + getOptions, pOption, isOption, + + -- * printing options, without prefix + prOpt, prOpts, + + -- * a suggestion for option names + -- ** parsing + strictParse, forgiveParse, ignoreParse, literalParse, + rawParse, firstParse, dontParse, + -- ** grammar formats + showAbstr, showXML, showOld, showLatex, showFullForm, + showEBNF, showCF, showWords, showOpts, + isCompiled, isHaskell, noCompOpers, retainOpers, defaultGrOpts, + newParser, noCF, checkCirc, noCheckCirc, lexerByNeed, + -- ** linearization + allLin, firstLin, distinctLin, dontLin, showRecord, showStruct, + xmlLin, latexLin, tableLin, defaultLinOpts, useUTF8, showLang, withMetas, + -- ** other + beVerbose, showInfo, beSilent, emitCode, getHelp, doMake, doBatch, + notEmitCode, makeMulti, beShort, wholeGrammar, makeFudget, byLines, byWords, + analMorpho, doTrace, noCPU, doCompute, optimizeCanon, optimizeValues, + stripQualif, nostripQualif, showAll, fromSource, + -- ** mainly for stand-alone + useUnicode, optCompute, optCheck, optParaphrase, forJava, + -- ** for edit session + allLangs, absView, + -- ** options that take arguments + useTokenizer, useUntokenizer, useParser, withFun, firstCat, gStartCat, + useLanguage, useResource, speechLanguage, useFont, + grammarFormat, grammarPrinter, filterString, termCommand, transferFun, + forForms, menuDisplay, sizeDisplay, typeDisplay, + noDepTypes, extractGr, pathList, uniCoding, + useName, useAbsName, useCncName, useResName, useFile, useOptimizer, + markLin, markOptXML, markOptJava, markOptStruct, markOptFocus, + -- ** refinement order + nextRefine, firstRefine, lastRefine, + -- ** Boolean flags + flagYes, flagNo, caseYesNo, + -- ** integer flags + flagDepth, flagAlts, flagLength, flagNumber, flagRawtrees + ) where import List (partition) import Char (isDigit) @@ -25,11 +79,20 @@ newtype Options = Opts [Option] deriving (Eq,Show,Read) noOptions :: Options noOptions = Opts [] -iOpt o = Opt (o,[]) -- simple option -o -aOpt o a = Opt (o,[a]) -- option with argument -o=a +iOpt :: String -> Option +iOpt o = Opt (o,[]) +-- ^ simple option -o + +aOpt :: String -> String -> Option +aOpt o a = Opt (o,[a]) +-- ^ option with argument -o=a + +iOpts :: [Option] -> Options iOpts = Opts -oArg s = s -- value of option argument +oArg :: String -> String +oArg s = s +-- ^ value of option argument oElem :: Option -> Options -> Bool oElem o (Opts os) = elem o os |
