summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2014-06-12 14:43:18 +0000
committerhallgren <hallgren@chalmers.se>2014-06-12 14:43:18 +0000
commitd6252d1c16d59ad26db0d08a531cddf39864d9db (patch)
tree93d4c2be28e430bb64a1cb2db22299b1b4b8afb7 /src/compiler/GF/Compile
parent352ecb7eb89b3f427667c7c51f71812b619393af (diff)
PGF library: expose only PGF and PGF.Internal instead of all modules
PGF exports the public, stable API. PGF.Internal exports additional things needed in the GF compiler & shell, including the nonstardard version of Data.Binary.
Diffstat (limited to 'src/compiler/GF/Compile')
-rw-r--r--src/compiler/GF/Compile/CFGtoPGF.hs4
-rw-r--r--src/compiler/GF/Compile/Compute/Value.hs2
-rw-r--r--src/compiler/GF/Compile/Export.hs2
-rw-r--r--src/compiler/GF/Compile/GenerateBC.hs4
-rw-r--r--src/compiler/GF/Compile/GeneratePMCFG.hs11
-rw-r--r--src/compiler/GF/Compile/GrammarToPGF.hs8
-rw-r--r--src/compiler/GF/Compile/Instructions.hs5
-rw-r--r--src/compiler/GF/Compile/PGFtoHaskell.hs3
-rw-r--r--src/compiler/GF/Compile/PGFtoJS.hs5
-rw-r--r--src/compiler/GF/Compile/PGFtoLProlog.hs2
-rw-r--r--src/compiler/GF/Compile/PGFtoProlog.hs2
-rw-r--r--src/compiler/GF/Compile/PGFtoPython.hs3
-rw-r--r--src/compiler/GF/Compile/ToAPI.hs2
13 files changed, 22 insertions, 31 deletions
diff --git a/src/compiler/GF/Compile/CFGtoPGF.hs b/src/compiler/GF/Compile/CFGtoPGF.hs
index e1eaf53b2..96fc13554 100644
--- a/src/compiler/GF/Compile/CFGtoPGF.hs
+++ b/src/compiler/GF/Compile/CFGtoPGF.hs
@@ -4,9 +4,7 @@ import GF.Grammar.CFG
import GF.Infra.UseIO
import PGF
-import PGF.Data
-import PGF.Macros
-import PGF.Optimize
+import PGF.Internal
import qualified Data.Set as Set
import qualified Data.Map as Map
diff --git a/src/compiler/GF/Compile/Compute/Value.hs b/src/compiler/GF/Compile/Compute/Value.hs
index 8f47ad184..64683a3de 100644
--- a/src/compiler/GF/Compile/Compute/Value.hs
+++ b/src/compiler/GF/Compile/Compute/Value.hs
@@ -1,6 +1,6 @@
module GF.Compile.Compute.Value where
import GF.Grammar.Grammar(Label,Type,MetaId,Patt,QIdent)
-import PGF.Data(BindType)
+import PGF.Internal(BindType)
import GF.Infra.Ident(Ident)
import Text.Show.Functions()
import Data.Ix(Ix)
diff --git a/src/compiler/GF/Compile/Export.hs b/src/compiler/GF/Compile/Export.hs
index 727a21f2d..ff7d5790a 100644
--- a/src/compiler/GF/Compile/Export.hs
+++ b/src/compiler/GF/Compile/Export.hs
@@ -1,7 +1,7 @@
module GF.Compile.Export where
import PGF
-import PGF.Printer(ppPGF)
+import PGF.Internal(ppPGF)
import GF.Compile.PGFtoHaskell
import GF.Compile.PGFtoProlog
import GF.Compile.PGFtoLProlog
diff --git a/src/compiler/GF/Compile/GenerateBC.hs b/src/compiler/GF/Compile/GenerateBC.hs
index 26d48380f..61605e3f8 100644
--- a/src/compiler/GF/Compile/GenerateBC.hs
+++ b/src/compiler/GF/Compile/GenerateBC.hs
@@ -2,13 +2,13 @@ module GF.Compile.GenerateBC(generateByteCode) where
import GF.Grammar
import GF.Compile.Instructions
-import PGF.Data
+import PGF.Internal(Binary(..),encode,BCAddr)
import Data.Maybe
import qualified Data.IntMap as IntMap
import qualified Data.ByteString as BSS
import qualified Data.ByteString.Lazy as BS
-import Data.Binary
+import PGF.Internal()
generateByteCode :: [(QIdent,Info)] -> ([(QIdent,Info,BCAddr)], BSS.ByteString)
generateByteCode = runGenM . mapM genFun
diff --git a/src/compiler/GF/Compile/GeneratePMCFG.hs b/src/compiler/GF/Compile/GeneratePMCFG.hs
index 5a3f01c86..fb51f9be9 100644
--- a/src/compiler/GF/Compile/GeneratePMCFG.hs
+++ b/src/compiler/GF/Compile/GeneratePMCFG.hs
@@ -14,7 +14,7 @@ module GF.Compile.GeneratePMCFG
) where
--import PGF.CId
-import PGF.Data(CncCat(..),Symbol(..),fidVar)
+import PGF.Internal as PGF(CncCat(..),Symbol(..),fidVar)
import GF.Infra.Option
import GF.Grammar hiding (Env, mkRecord, mkTable)
@@ -194,13 +194,12 @@ unfactor t = CM (\gr c -> c (unfac gr t))
Vr y | y == x -> u
_ -> composSafeOp (restore x u) t
-pgfCncCat :: SourceGrammar -> Type -> Int -> PGF.Data.CncCat
+pgfCncCat :: SourceGrammar -> Type -> Int -> CncCat
pgfCncCat gr lincat index =
let ((_,size),schema) = computeCatRange gr lincat
- in PGF.Data.CncCat index
- (index+size-1)
- (mkArray (map (renderStyle style{mode=OneLineMode} . ppPath)
- (getStrPaths schema)))
+ in PGF.CncCat index (index+size-1)
+ (mkArray (map (renderStyle style{mode=OneLineMode} . ppPath)
+ (getStrPaths schema)))
where
getStrPaths :: Schema Identity s c -> [Path]
getStrPaths = collect CNil []
diff --git a/src/compiler/GF/Compile/GrammarToPGF.hs b/src/compiler/GF/Compile/GrammarToPGF.hs
index 5917b709c..b72bbb347 100644
--- a/src/compiler/GF/Compile/GrammarToPGF.hs
+++ b/src/compiler/GF/Compile/GrammarToPGF.hs
@@ -6,11 +6,11 @@ import GF.Compile.GeneratePMCFG
import GF.Compile.GenerateBC
import PGF(CId,mkCId,utf8CId)
-import PGF.Data(fidInt,fidFloat,fidString,fidVar)
-import PGF.Optimize(updateProductionIndices)
+import PGF.Internal(fidInt,fidFloat,fidString,fidVar)
+import PGF.Internal(updateProductionIndices)
--import qualified PGF.Macros as CM
-import qualified PGF.Data as C
-import qualified PGF.Data as D
+import qualified PGF.Internal as C
+import qualified PGF.Internal as D
import GF.Grammar.Predef
--import GF.Grammar.Printer
import GF.Grammar.Grammar
diff --git a/src/compiler/GF/Compile/Instructions.hs b/src/compiler/GF/Compile/Instructions.hs
index 586671a4d..138fabe97 100644
--- a/src/compiler/GF/Compile/Instructions.hs
+++ b/src/compiler/GF/Compile/Instructions.hs
@@ -1,10 +1,7 @@
module GF.Compile.Instructions where
--import Data.IORef
-import Data.Binary
-import Data.Binary.Put
-import Data.Binary.Get
-import Data.Binary.IEEE754
+import PGF.Internal -- Binary
import PGF(CId)
--import PGF.CId
--import PGF.Binary
diff --git a/src/compiler/GF/Compile/PGFtoHaskell.hs b/src/compiler/GF/Compile/PGFtoHaskell.hs
index 17c9bb2f5..9a921f645 100644
--- a/src/compiler/GF/Compile/PGFtoHaskell.hs
+++ b/src/compiler/GF/Compile/PGFtoHaskell.hs
@@ -17,8 +17,7 @@
module GF.Compile.PGFtoHaskell (grammar2haskell) where
import PGF(showCId)
-import PGF.Data
-import PGF.Macros
+import PGF.Internal
import GF.Data.Operations
import GF.Infra.Option
diff --git a/src/compiler/GF/Compile/PGFtoJS.hs b/src/compiler/GF/Compile/PGFtoJS.hs
index 707739025..534b00812 100644
--- a/src/compiler/GF/Compile/PGFtoJS.hs
+++ b/src/compiler/GF/Compile/PGFtoJS.hs
@@ -1,8 +1,7 @@
module GF.Compile.PGFtoJS (pgf2js) where
-import PGF(showCId)
-import PGF.Data hiding (mkStr)
-import qualified PGF.Macros as M
+import PGF(CId,showCId)
+import PGF.Internal as M
import qualified GF.JavaScript.AbsJS as JS
import qualified GF.JavaScript.PrintJS as JS
diff --git a/src/compiler/GF/Compile/PGFtoLProlog.hs b/src/compiler/GF/Compile/PGFtoLProlog.hs
index 61e28eb17..b0825b26c 100644
--- a/src/compiler/GF/Compile/PGFtoLProlog.hs
+++ b/src/compiler/GF/Compile/PGFtoLProlog.hs
@@ -1,7 +1,7 @@
module GF.Compile.PGFtoLProlog(grammar2lambdaprolog_mod, grammar2lambdaprolog_sig) where
import PGF(mkCId,ppCId,showCId,wildCId)
-import PGF.Data hiding (ppExpr, ppType, ppHypo)
+import PGF.Internal hiding (ppExpr,ppType,ppHypo,ppCat,ppFun)
--import PGF.Macros
import Data.List
import Data.Maybe
diff --git a/src/compiler/GF/Compile/PGFtoProlog.hs b/src/compiler/GF/Compile/PGFtoProlog.hs
index 8fffd5f07..25d1e6e41 100644
--- a/src/compiler/GF/Compile/PGFtoProlog.hs
+++ b/src/compiler/GF/Compile/PGFtoProlog.hs
@@ -9,7 +9,7 @@
module GF.Compile.PGFtoProlog (grammar2prolog) where
import PGF(mkCId,wildCId,showCId)
-import PGF.Data
+import PGF.Internal
--import PGF.Macros
import GF.Data.Operations
diff --git a/src/compiler/GF/Compile/PGFtoPython.hs b/src/compiler/GF/Compile/PGFtoPython.hs
index 57ac92a79..a186509fe 100644
--- a/src/compiler/GF/Compile/PGFtoPython.hs
+++ b/src/compiler/GF/Compile/PGFtoPython.hs
@@ -9,8 +9,7 @@
module GF.Compile.PGFtoPython (pgf2python) where
import PGF(showCId)
-import PGF.Data
-import qualified PGF.Macros as M
+import PGF.Internal as M
import GF.Data.Operations
diff --git a/src/compiler/GF/Compile/ToAPI.hs b/src/compiler/GF/Compile/ToAPI.hs
index a67abd1fb..d59ee4305 100644
--- a/src/compiler/GF/Compile/ToAPI.hs
+++ b/src/compiler/GF/Compile/ToAPI.hs
@@ -2,7 +2,7 @@ module GF.Compile.ToAPI
(stringToAPI,exprToAPI)
where
-import PGF.Data
+import PGF.Internal
import PGF(showCId)
import Data.Maybe
--import System.IO