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).
This commit is contained in:
Thomas Hallgren
2019-01-22 17:16:32 +01:00
parent a40130ddc4
commit e4abff7725
6 changed files with 101 additions and 27 deletions

View File

@@ -18,6 +18,8 @@ import GF.Infra.Ident(Ident,identS,prefixIdent) --,moduleNameS
import GF.Infra.Option
import GF.Compile.Compute.ConcreteNew(normalForm,resourceValues)
import GF.Haskell
--import GF.Grammar.Canonical
--import GF.Compile.ConcreteToCanonical
import Debug.Trace
-- | Generate Haskell code for the all concrete syntaxes associated with
@@ -28,6 +30,9 @@ concretes2haskell opts absname gr =
cnc<-allConcretes gr absname,
let cncname = render cnc ++ ".hs" :: FilePath
Ok cncmod = lookupModule gr cnc
{- (_,cnc)<-concretes2canonical opt absname gr,
let ModId name = concName cnc
cncname = name ++ ".hs" :: FilePath--}
]
-- | Generate Haskell code for the given concrete module.