From e4abff772556ebee68a7e3b2cbe4fd413a5e845e Mon Sep 17 00:00:00 2001 From: Thomas Hallgren Date: Tue, 22 Jan 2019 17:16:32 +0100 Subject: 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). --- src/compiler/GF/Compile/Export.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/compiler/GF/Compile/Export.hs') 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] -- cgit v1.2.3