summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile/Export.hs
diff options
context:
space:
mode:
authorThomas Hallgren <th-github@altocumulus.org>2019-01-22 17:16:32 +0100
committerThomas Hallgren <th-github@altocumulus.org>2019-01-22 17:16:32 +0100
commite4abff772556ebee68a7e3b2cbe4fd413a5e845e (patch)
treeaa15cf56c3f30718de75eba48a175242266c4cbf /src/compiler/GF/Compile/Export.hs
parenta40130ddc445110871c7c406b1c562d7d726f393 (diff)
More work on the canonica_gf export
+ Abstract syntax now is converted directly from the Grammar and not via PGF, so you can use `gf -batch -no-pmcfg -f canonical_gf ...`, to export to canonical_gf while skipping PMCFG and PGF file generation completely. + Flags that are normally copied to PGF files are now included in the caninical_gf output as well (in particular the startcat flag).
Diffstat (limited to 'src/compiler/GF/Compile/Export.hs')
-rw-r--r--src/compiler/GF/Compile/Export.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/GF/Compile/Export.hs b/src/compiler/GF/Compile/Export.hs
index 5403298f9..c86c9dd03 100644
--- a/src/compiler/GF/Compile/Export.hs
+++ b/src/compiler/GF/Compile/Export.hs
@@ -3,7 +3,7 @@ module GF.Compile.Export where
import PGF
import PGF.Internal(ppPGF)
import GF.Compile.PGFtoHaskell
-import GF.Compile.PGFtoAbstract
+--import GF.Compile.PGFtoAbstract
import GF.Compile.PGFtoJava
import GF.Compile.PGFtoProlog
import GF.Compile.PGFtoJS
@@ -35,7 +35,7 @@ exportPGF :: Options
exportPGF opts fmt pgf =
case fmt of
FmtPGFPretty -> multi "txt" (render . ppPGF)
- FmtCanonicalGF -> canon "gf" (render80 . abstract2canonical)
+ FmtCanonicalGF -> [] -- canon "gf" (render80 . abstract2canonical)
FmtJavaScript -> multi "js" pgf2js
FmtPython -> multi "py" pgf2python
FmtHaskell -> multi "hs" (grammar2haskell opts name)
@@ -58,7 +58,8 @@ exportPGF opts fmt pgf =
multi :: String -> (PGF -> String) -> [(FilePath,String)]
multi ext pr = [(name <.> ext, pr pgf)]
- canon ext pr = [("canonical"</>name<.>ext,pr pgf)]
+
+-- canon ext pr = [("canonical"</>name<.>ext,pr pgf)]
single :: String -> (PGF -> CId -> String) -> [(FilePath,String)]
single ext pr = [(showCId cnc <.> ext, pr pgf cnc) | cnc <- languages pgf]