mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
Rename module GF.Compile.ConcreteToCanonical to GF.Compile.GrammarToCanonical
This commit is contained in:
2
gf.cabal
2
gf.cabal
@@ -189,7 +189,7 @@ Library
|
|||||||
GF.Compile.PGFtoJava
|
GF.Compile.PGFtoJava
|
||||||
GF.Haskell
|
GF.Haskell
|
||||||
GF.Compile.ConcreteToHaskell
|
GF.Compile.ConcreteToHaskell
|
||||||
GF.Compile.ConcreteToCanonical
|
GF.Compile.GrammarToCanonical
|
||||||
GF.Grammar.Canonical
|
GF.Grammar.Canonical
|
||||||
GF.Grammar.CanonicalJSON
|
GF.Grammar.CanonicalJSON
|
||||||
GF.Compile.PGFtoJS
|
GF.Compile.PGFtoJS
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import GF.Infra.Ident(Ident,identS,identW,prefixIdent)
|
|||||||
import GF.Infra.Option
|
import GF.Infra.Option
|
||||||
import GF.Haskell as H
|
import GF.Haskell as H
|
||||||
import GF.Grammar.Canonical as C
|
import GF.Grammar.Canonical as C
|
||||||
import GF.Compile.ConcreteToCanonical
|
import GF.Compile.GrammarToCanonical
|
||||||
import Debug.Trace(trace)
|
import Debug.Trace(trace)
|
||||||
|
|
||||||
-- | Generate Haskell code for the all concrete syntaxes associated with
|
-- | Generate Haskell code for the all concrete syntaxes associated with
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
-- | Translate grammars to Canonical form
|
-- | Translate grammars to Canonical form
|
||||||
-- (a common intermediate representation to simplify export to other formats)
|
-- (a common intermediate representation to simplify export to other formats)
|
||||||
module GF.Compile.ConcreteToCanonical(grammar2canonical,abstract2canonical,concretes2canonical) where
|
module GF.Compile.GrammarToCanonical(grammar2canonical,abstract2canonical,concretes2canonical) where
|
||||||
import Data.List(nub,partition)
|
import Data.List(nub,partition)
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
import qualified Data.Set as S
|
import qualified Data.Set as S
|
||||||
@@ -55,7 +55,7 @@ abstract2canonical absname gr =
|
|||||||
-- | Generate Canonical code for the all concrete syntaxes associated with
|
-- | Generate Canonical code for the all concrete syntaxes associated with
|
||||||
-- the named abstract syntax in given the grammar.
|
-- the named abstract syntax in given the grammar.
|
||||||
concretes2canonical opts absname gr =
|
concretes2canonical opts absname gr =
|
||||||
[(cncname,concrete2canonical opts gr cenv absname cnc cncmod)
|
[(cncname,concrete2canonical gr cenv absname cnc cncmod)
|
||||||
| let cenv = resourceValues opts gr,
|
| let cenv = resourceValues opts gr,
|
||||||
cnc<-allConcretes gr absname,
|
cnc<-allConcretes gr absname,
|
||||||
let cncname = "canonical/"++render cnc ++ ".gf" :: FilePath
|
let cncname = "canonical/"++render cnc ++ ".gf" :: FilePath
|
||||||
@@ -63,9 +63,7 @@ concretes2canonical opts absname gr =
|
|||||||
]
|
]
|
||||||
|
|
||||||
-- | Generate Canonical GF for the given concrete module.
|
-- | Generate Canonical GF for the given concrete module.
|
||||||
-- The only options that make a difference are
|
concrete2canonical gr cenv absname cnc modinfo =
|
||||||
-- @-haskell=noprefix@ and @-haskell=variants@.
|
|
||||||
concrete2canonical opts gr cenv absname cnc modinfo =
|
|
||||||
Concrete (modId cnc) (modId absname) (convFlags gr cnc)
|
Concrete (modId cnc) (modId absname) (convFlags gr cnc)
|
||||||
(neededParamTypes S.empty (params defs))
|
(neededParamTypes S.empty (params defs))
|
||||||
[lincat|(_,Left lincat)<-defs]
|
[lincat|(_,Left lincat)<-defs]
|
||||||
@@ -7,7 +7,7 @@ import GF.Compile as S(batchCompile,link,srcAbsName)
|
|||||||
import GF.CompileInParallel as P(parallelBatchCompile)
|
import GF.CompileInParallel as P(parallelBatchCompile)
|
||||||
import GF.Compile.Export
|
import GF.Compile.Export
|
||||||
import GF.Compile.ConcreteToHaskell(concretes2haskell)
|
import GF.Compile.ConcreteToHaskell(concretes2haskell)
|
||||||
import GF.Compile.ConcreteToCanonical--(concretes2canonical)
|
import GF.Compile.GrammarToCanonical--(concretes2canonical)
|
||||||
import GF.Compile.CFGtoPGF
|
import GF.Compile.CFGtoPGF
|
||||||
import GF.Compile.GetGrammar
|
import GF.Compile.GetGrammar
|
||||||
import GF.Grammar.BNFC
|
import GF.Grammar.BNFC
|
||||||
|
|||||||
Reference in New Issue
Block a user