mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-11 05:49:31 -06:00
23 lines
556 B
Haskell
23 lines
556 B
Haskell
module GF.Compile.Export where
|
|
|
|
import PGF.Data (GFCC)
|
|
import PGF.Raw.Print (printTree)
|
|
import PGF.Raw.Convert (fromGFCC)
|
|
import GF.Compile.GFCCtoHaskell
|
|
import GF.Compile.GFCCtoJS
|
|
import GF.Infra.Option
|
|
import GF.Text.UTF8
|
|
|
|
-- top-level access to code generation
|
|
|
|
prGFCC :: OutputFormat -> GFCC -> String
|
|
prGFCC fmt gr = case fmt of
|
|
FmtGFCC -> printGFCC gr
|
|
FmtJavaScript -> gfcc2js gr
|
|
FmtHaskell -> grammar2haskell gr
|
|
FmtHaskellGADT -> grammar2haskellGADT gr
|
|
|
|
printGFCC :: GFCC -> String
|
|
printGFCC = encodeUTF8 . printTree . fromGFCC
|
|
|