diff options
| author | Thomas H <Thomas-H@users.noreply.github.com> | 2019-02-21 14:26:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-21 14:26:11 +0100 |
| commit | b6fd9a7744dd170950d7ffb654c11b036564fb81 (patch) | |
| tree | e8dceb47c970e0431e65a9992053f3dbdd28305e /src/compiler/GF/Infra | |
| parent | 64a2483b12f17e98160a5974a3015a54629de480 (diff) | |
| parent | f8346c4557f5e29e85245f259bce952014870dd6 (diff) | |
Merge pull request #34 from heatherleaf/master
Encode/decode of canonical grammars to/from JSON/YAML
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 bd65db2f6..276b41c8a 100644 --- a/src/compiler/GF/Infra/Option.hs +++ b/src/compiler/GF/Infra/Option.hs @@ -88,6 +88,8 @@ data Phase = Preproc | Convert | Compile | Link data OutputFormat = FmtPGFPretty | FmtCanonicalGF + | FmtCanonicalJson + | FmtCanonicalYaml | FmtJavaScript | FmtPython | FmtHaskell @@ -326,6 +328,7 @@ optDescr = Option [] ["gfo-dir"] (ReqArg gfoDir "DIR") "Directory to put .gfo files in (default = '.').", Option ['f'] ["output-format"] (ReqArg outFmt "FMT") (unlines ["Output format. FMT can be one of:", + "Canonical GF grammar: canonical_gf, canonical_json, canonical_yaml, (and haskell with option --haskell=concrete)", "Multiple concrete: pgf (default), js, pgf_pretty, prolog, python, ...", -- gar, "Single concrete only: bnf, ebnf, fa, gsl, jsgf, regexp, slf, srgs_xml, srgs_abnf, vxml, ....", -- cf, lbnf, "Abstract only: haskell, ..."]), -- prolog_abs, @@ -470,6 +473,8 @@ outputFormatsExpl :: [((String,OutputFormat),String)] outputFormatsExpl = [(("pgf_pretty", FmtPGFPretty),"human-readable pgf"), (("canonical_gf", FmtCanonicalGF),"Canonical GF source files"), + (("canonical_json", FmtCanonicalJson),"Canonical JSON source files"), + (("canonical_yaml", FmtCanonicalYaml),"Canonical YAML source files"), (("js", FmtJavaScript),"JavaScript (whole grammar)"), (("python", FmtPython),"Python (whole grammar)"), (("haskell", FmtHaskell),"Haskell (abstract syntax)"), |
