mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-16 22:52:50 -06:00
change the library root namespace from GF.GFCC to PGF
This commit is contained in:
64
GF.cabal
64
GF.cabal
@@ -25,20 +25,21 @@ library
|
|||||||
hs-source-dirs: src-3.0
|
hs-source-dirs: src-3.0
|
||||||
extensions:
|
extensions:
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
GF.GFCC.API
|
PGF
|
||||||
other-modules:
|
other-modules:
|
||||||
GF.GFCC.Raw.AbsGFCCRaw
|
PGF.CId
|
||||||
GF.GFCC.DataGFCC
|
PGF.Data
|
||||||
GF.GFCC.CId
|
PGF.Macros
|
||||||
GF.GFCC.Raw.ParGFCCRaw
|
PGF.Generate
|
||||||
GF.GFCC.Macros
|
PGF.Linearize
|
||||||
GF.GFCC.Generate
|
PGF.BuildParser
|
||||||
GF.GFCC.Linearize
|
PGF.Parsing.FCFG.Utilities
|
||||||
GF.GFCC.BuildParser
|
PGF.Parsing.FCFG.Active
|
||||||
GF.GFCC.Parsing.FCFG.Utilities
|
PGF.Parsing.FCFG
|
||||||
GF.GFCC.Parsing.FCFG.Active
|
PGF.Raw.Parse
|
||||||
GF.GFCC.Parsing.FCFG
|
PGF.Raw.Print
|
||||||
GF.GFCC.Raw.ConvertGFCC
|
PGF.Raw.Convert
|
||||||
|
PGF.Raw.Abstract
|
||||||
GF.Data.RedBlackSet
|
GF.Data.RedBlackSet
|
||||||
GF.Data.GeneralDeduction
|
GF.Data.GeneralDeduction
|
||||||
GF.Data.Utilities
|
GF.Data.Utilities
|
||||||
@@ -77,7 +78,6 @@ executable gf3
|
|||||||
GF.Source.PrintGF
|
GF.Source.PrintGF
|
||||||
GF.JavaScript.AbsJS
|
GF.JavaScript.AbsJS
|
||||||
GF.JavaScript.PrintJS
|
GF.JavaScript.PrintJS
|
||||||
GF.GFCC.Raw.AbsGFCCRaw
|
|
||||||
GF.Command.LexGFShell
|
GF.Command.LexGFShell
|
||||||
GF.Command.AbsGFShell
|
GF.Command.AbsGFShell
|
||||||
GF.Command.PrintGFShell
|
GF.Command.PrintGFShell
|
||||||
@@ -89,29 +89,12 @@ executable gf3
|
|||||||
GF.Data.SortedList
|
GF.Data.SortedList
|
||||||
GF.Data.Assoc
|
GF.Data.Assoc
|
||||||
GF.Infra.PrintClass
|
GF.Infra.PrintClass
|
||||||
GF.GFCC.CId
|
|
||||||
GF.GFCC.Raw.ParGFCCRaw
|
|
||||||
GF.GFCC.Raw.PrintGFCCRaw
|
|
||||||
GF.GFCC.BuildParser
|
|
||||||
GF.GFCC.DataGFCC
|
|
||||||
GF.GFCC.Parsing.FCFG.Utilities
|
|
||||||
GF.GFCC.Parsing.FCFG.Active
|
|
||||||
GF.GFCC.Parsing.FCFG
|
|
||||||
GF.GFCC.Raw.ConvertGFCC
|
|
||||||
GF.GFCC.Macros
|
|
||||||
GF.GFCC.Generate
|
|
||||||
GF.GFCC.Linearize
|
|
||||||
GF.Compile.GenerateFCFG
|
GF.Compile.GenerateFCFG
|
||||||
GF.Data.ErrM
|
GF.Data.ErrM
|
||||||
GF.Command.ParGFShell
|
GF.Command.ParGFShell
|
||||||
GF.Command.PPrTree
|
GF.Command.PPrTree
|
||||||
GF.GFCC.API
|
|
||||||
GF.GFCC.CheckGFCC
|
|
||||||
GF.Source.ParGF
|
GF.Source.ParGF
|
||||||
GF.Data.Operations
|
GF.Data.Operations
|
||||||
GF.GFCC.GFCCtoHaskell
|
|
||||||
GF.GFCC.ShowLinearize
|
|
||||||
GF.GFCC.OptimizeGFCC
|
|
||||||
GF.Infra.Ident
|
GF.Infra.Ident
|
||||||
GF.Grammar.Predef
|
GF.Grammar.Predef
|
||||||
GF.Data.Str
|
GF.Data.Str
|
||||||
@@ -119,8 +102,6 @@ executable gf3
|
|||||||
GF.Infra.GetOpt
|
GF.Infra.GetOpt
|
||||||
GF.Infra.Option
|
GF.Infra.Option
|
||||||
GF.Infra.UseIO
|
GF.Infra.UseIO
|
||||||
GF.GFCC.GFCCtoJS
|
|
||||||
GF.GFCC.PrintGFCC
|
|
||||||
GF.Command.Commands
|
GF.Command.Commands
|
||||||
GF.Command.Interpreter
|
GF.Command.Interpreter
|
||||||
GF.Infra.Modules
|
GF.Infra.Modules
|
||||||
@@ -140,7 +121,6 @@ executable gf3
|
|||||||
GF.Grammar.Unify
|
GF.Grammar.Unify
|
||||||
GF.Compile.TypeCheck
|
GF.Compile.TypeCheck
|
||||||
GF.Compile.Update
|
GF.Compile.Update
|
||||||
GF.Compile.OptimizeGF
|
|
||||||
GF.Infra.CheckM
|
GF.Infra.CheckM
|
||||||
GF.Grammar.AppPredefined
|
GF.Grammar.AppPredefined
|
||||||
GF.Grammar.PatternMatch
|
GF.Grammar.PatternMatch
|
||||||
@@ -152,6 +132,8 @@ executable gf3
|
|||||||
GF.Compile.GrammarToGFCC
|
GF.Compile.GrammarToGFCC
|
||||||
GF.Compile.Compute
|
GF.Compile.Compute
|
||||||
GF.Compile.Optimize
|
GF.Compile.Optimize
|
||||||
|
GF.Compile.OptimizeGF
|
||||||
|
GF.Compile.OptimizeGFCC
|
||||||
GF.Compile.ModDeps
|
GF.Compile.ModDeps
|
||||||
GF.Compile.Rebuild
|
GF.Compile.Rebuild
|
||||||
GF.Source.SourceToGrammar
|
GF.Source.SourceToGrammar
|
||||||
@@ -159,6 +141,20 @@ executable gf3
|
|||||||
GF.Compile
|
GF.Compile
|
||||||
GF.Command.Importing
|
GF.Command.Importing
|
||||||
GF.System.Readline
|
GF.System.Readline
|
||||||
|
PGF
|
||||||
|
PGF.CId
|
||||||
|
PGF.Data
|
||||||
|
PGF.Macros
|
||||||
|
PGF.Generate
|
||||||
|
PGF.Linearize
|
||||||
|
PGF.BuildParser
|
||||||
|
PGF.Parsing.FCFG.Utilities
|
||||||
|
PGF.Parsing.FCFG.Active
|
||||||
|
PGF.Parsing.FCFG
|
||||||
|
PGF.Raw.Parse
|
||||||
|
PGF.Raw.Print
|
||||||
|
PGF.Raw.Convert
|
||||||
|
PGF.Raw.Abstract
|
||||||
GFC
|
GFC
|
||||||
GFI
|
GFI
|
||||||
|
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ module GF.Command.Commands (
|
|||||||
import GF.Command.AbsGFShell hiding (Tree)
|
import GF.Command.AbsGFShell hiding (Tree)
|
||||||
import GF.Command.PPrTree
|
import GF.Command.PPrTree
|
||||||
import GF.Command.ParGFShell
|
import GF.Command.ParGFShell
|
||||||
import GF.GFCC.CId
|
import PGF
|
||||||
import GF.GFCC.ShowLinearize
|
import PGF.CId
|
||||||
import GF.GFCC.API
|
import PGF.ShowLinearize
|
||||||
import GF.GFCC.Macros
|
import PGF.Macros
|
||||||
import GF.GFCC.PrintGFCC
|
import PGF.Data ----
|
||||||
import GF.GFCC.DataGFCC ----
|
import GF.Compile.Export
|
||||||
|
|
||||||
import GF.Data.ErrM ----
|
import GF.Data.ErrM ----
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
module GF.Command.Importing (importGrammar, importSource) where
|
module GF.Command.Importing (importGrammar, importSource) where
|
||||||
|
|
||||||
|
import PGF
|
||||||
|
import PGF.Data
|
||||||
|
|
||||||
import GF.Compile
|
import GF.Compile
|
||||||
import GF.GFCC.DataGFCC
|
|
||||||
import GF.GFCC.API
|
|
||||||
|
|
||||||
import GF.Grammar.Grammar (SourceGrammar) -- for cc command
|
import GF.Grammar.Grammar (SourceGrammar) -- for cc command
|
||||||
|
|
||||||
import GF.Infra.UseIO
|
import GF.Infra.UseIO
|
||||||
import GF.Infra.Option
|
import GF.Infra.Option
|
||||||
import GF.Data.ErrM
|
import GF.Data.ErrM
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import GF.Command.Commands
|
|||||||
import GF.Command.AbsGFShell hiding (Tree)
|
import GF.Command.AbsGFShell hiding (Tree)
|
||||||
import GF.Command.PPrTree
|
import GF.Command.PPrTree
|
||||||
import GF.Command.ParGFShell
|
import GF.Command.ParGFShell
|
||||||
import GF.GFCC.API
|
import PGF
|
||||||
import GF.GFCC.Macros
|
import PGF.Data
|
||||||
import GF.GFCC.DataGFCC
|
import PGF.Macros
|
||||||
import GF.System.Signal
|
import GF.System.Signal
|
||||||
|
|
||||||
import GF.Data.ErrM ----
|
import GF.Data.ErrM ----
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
module GF.Command.PPrTree (pTree, prExp, tree2exp) where
|
module GF.Command.PPrTree (pTree, prExp, tree2exp) where
|
||||||
|
|
||||||
import GF.GFCC.DataGFCC
|
import PGF.CId
|
||||||
import GF.GFCC.CId
|
import PGF.Data
|
||||||
import GF.GFCC.Macros
|
import PGF.Macros
|
||||||
import qualified GF.Command.ParGFShell as P
|
import qualified GF.Command.ParGFShell as P
|
||||||
import GF.Command.PrintGFShell
|
import GF.Command.PrintGFShell
|
||||||
import GF.Command.AbsGFShell
|
import GF.Command.AbsGFShell
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import GF.Compile.Rename
|
|||||||
import GF.Compile.CheckGrammar
|
import GF.Compile.CheckGrammar
|
||||||
import GF.Compile.Optimize
|
import GF.Compile.Optimize
|
||||||
import GF.Compile.OptimizeGF
|
import GF.Compile.OptimizeGF
|
||||||
|
import GF.Compile.OptimizeGFCC
|
||||||
import GF.Compile.GrammarToGFCC
|
import GF.Compile.GrammarToGFCC
|
||||||
import GF.Compile.ReadFiles
|
import GF.Compile.ReadFiles
|
||||||
import GF.Compile.Update
|
import GF.Compile.Update
|
||||||
@@ -34,9 +35,8 @@ import System.FilePath
|
|||||||
import System.Time
|
import System.Time
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
|
|
||||||
import GF.GFCC.OptimizeGFCC
|
import PGF.Check
|
||||||
import GF.GFCC.CheckGFCC
|
import PGF.Data
|
||||||
import GF.GFCC.DataGFCC
|
|
||||||
|
|
||||||
|
|
||||||
-- | Compiles a number of source files and builds a 'GFCC' structure for them.
|
-- | Compiles a number of source files and builds a 'GFCC' structure for them.
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
module GF.GFCC.PrintGFCC where
|
module GF.Compile.Export where
|
||||||
|
|
||||||
import GF.GFCC.DataGFCC (GFCC)
|
import PGF.Data (GFCC)
|
||||||
import GF.GFCC.Raw.ConvertGFCC (fromGFCC)
|
import PGF.Raw.Print (printTree)
|
||||||
import GF.GFCC.Raw.PrintGFCCRaw (printTree)
|
import PGF.Raw.Convert (fromGFCC)
|
||||||
import GF.GFCC.GFCCtoHaskell
|
import GF.Compile.GFCCtoHaskell
|
||||||
import GF.GFCC.GFCCtoJS
|
import GF.Compile.GFCCtoJS
|
||||||
import GF.Infra.Option
|
import GF.Infra.Option
|
||||||
import GF.Text.UTF8
|
import GF.Text.UTF8
|
||||||
|
|
||||||
@@ -14,11 +14,11 @@
|
|||||||
-- AR 11/11/1999 -- 7/12/2000 -- 18/5/2004
|
-- AR 11/11/1999 -- 7/12/2000 -- 18/5/2004
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GF.GFCC.GFCCtoHaskell (grammar2haskell, grammar2haskellGADT) where
|
module GF.Compile.GFCCtoHaskell (grammar2haskell, grammar2haskellGADT) where
|
||||||
|
|
||||||
import GF.GFCC.Macros
|
import PGF.CId
|
||||||
import GF.GFCC.DataGFCC
|
import PGF.Data
|
||||||
import GF.GFCC.CId
|
import PGF.Macros
|
||||||
|
|
||||||
import GF.Data.Operations
|
import GF.Data.Operations
|
||||||
import GF.Text.UTF8
|
import GF.Text.UTF8
|
||||||
@@ -46,8 +46,8 @@ haskPreamble =
|
|||||||
[
|
[
|
||||||
"module GSyntax where",
|
"module GSyntax where",
|
||||||
"",
|
"",
|
||||||
"import GF.GFCC.DataGFCC",
|
"import PGF.CId",
|
||||||
"import GF.GFCC.CId",
|
"import PGF.Data",
|
||||||
"----------------------------------------------------",
|
"----------------------------------------------------",
|
||||||
"-- automatic translation from GF to Haskell",
|
"-- automatic translation from GF to Haskell",
|
||||||
"----------------------------------------------------",
|
"----------------------------------------------------",
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
module GF.GFCC.GFCCtoJS (gfcc2js) where
|
module GF.Compile.GFCCtoJS (gfcc2js) where
|
||||||
|
|
||||||
import qualified GF.GFCC.Macros as M
|
import PGF.CId
|
||||||
import GF.GFCC.CId
|
import PGF.Data
|
||||||
import GF.GFCC.DataGFCC
|
import qualified PGF.Macros as M
|
||||||
import qualified GF.JavaScript.AbsJS as JS
|
import qualified GF.JavaScript.AbsJS as JS
|
||||||
import qualified GF.JavaScript.PrintJS as JS
|
import qualified GF.JavaScript.PrintJS as JS
|
||||||
|
|
||||||
@@ -15,13 +15,10 @@
|
|||||||
module GF.Compile.GenerateFCFG
|
module GF.Compile.GenerateFCFG
|
||||||
(convertConcrete) where
|
(convertConcrete) where
|
||||||
|
|
||||||
import Control.Monad
|
import PGF.CId
|
||||||
|
import PGF.Data
|
||||||
import GF.GFCC.Parsing.FCFG.Utilities
|
import PGF.Macros --hiding (prt)
|
||||||
|
import PGF.Parsing.FCFG.Utilities
|
||||||
import GF.GFCC.Macros --hiding (prt)
|
|
||||||
import GF.GFCC.DataGFCC
|
|
||||||
import GF.GFCC.CId
|
|
||||||
|
|
||||||
import GF.Data.BacktrackM
|
import GF.Data.BacktrackM
|
||||||
import GF.Data.SortedList
|
import GF.Data.SortedList
|
||||||
@@ -33,6 +30,7 @@ import qualified Data.List as List
|
|||||||
import qualified Data.ByteString.Char8 as BS
|
import qualified Data.ByteString.Char8 as BS
|
||||||
import Data.Array
|
import Data.Array
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
|
import Control.Monad
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
-- main conversion function
|
-- main conversion function
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
{-# LANGUAGE PatternGuards #-}
|
{-# LANGUAGE PatternGuards #-}
|
||||||
module GF.Compile.GrammarToGFCC (prGrammar2gfcc,mkCanon2gfcc,addParsers) where
|
module GF.Compile.GrammarToGFCC (prGrammar2gfcc,mkCanon2gfcc,addParsers) where
|
||||||
|
|
||||||
|
import GF.Compile.Export
|
||||||
import GF.Compile.OptimizeGF (unshareModule)
|
import GF.Compile.OptimizeGF (unshareModule)
|
||||||
|
import GF.Compile.GenerateFCFG (convertConcrete)
|
||||||
|
|
||||||
import qualified GF.GFCC.Macros as CM
|
import PGF.CId
|
||||||
import qualified GF.GFCC.DataGFCC as C
|
import PGF.BuildParser (buildParserInfo)
|
||||||
import qualified GF.GFCC.DataGFCC as D
|
import qualified PGF.Macros as CM
|
||||||
import GF.GFCC.CId
|
import qualified PGF.Data as C
|
||||||
import GF.GFCC.PrintGFCC
|
import qualified PGF.Data as D
|
||||||
import GF.GFCC.BuildParser (buildParserInfo)
|
|
||||||
import GF.Grammar.Predef
|
import GF.Grammar.Predef
|
||||||
import GF.Grammar.PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import GF.Grammar.Grammar
|
import GF.Grammar.Grammar
|
||||||
@@ -19,7 +20,6 @@ import qualified GF.Compile.Compute as Compute ----
|
|||||||
import qualified GF.Infra.Modules as M
|
import qualified GF.Infra.Modules as M
|
||||||
import qualified GF.Infra.Option as O
|
import qualified GF.Infra.Option as O
|
||||||
|
|
||||||
import GF.Compile.GenerateFCFG (convertConcrete)
|
|
||||||
import GF.Infra.Ident
|
import GF.Infra.Ident
|
||||||
import GF.Infra.Option
|
import GF.Infra.Option
|
||||||
import GF.Data.Operations
|
import GF.Data.Operations
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
module GF.GFCC.OptimizeGFCC where
|
module GF.Compile.OptimizeGFCC where
|
||||||
|
|
||||||
import GF.GFCC.CId
|
import PGF.CId
|
||||||
import GF.GFCC.DataGFCC
|
import PGF.Data
|
||||||
|
|
||||||
import GF.Data.Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
Grm. Grammar ::=
|
|
||||||
"grammar" CId "(" [CId] ")" "(" [Flag] ")" ";"
|
|
||||||
Abstract ";"
|
|
||||||
[Concrete] ;
|
|
||||||
|
|
||||||
Abs. Abstract ::=
|
|
||||||
"abstract" "{"
|
|
||||||
"flags" [Flag]
|
|
||||||
"fun" [FunDef]
|
|
||||||
"cat" [CatDef]
|
|
||||||
"}" ;
|
|
||||||
|
|
||||||
Cnc. Concrete ::=
|
|
||||||
"concrete" CId "{"
|
|
||||||
"flags" [Flag]
|
|
||||||
"lin" [LinDef]
|
|
||||||
"oper" [LinDef]
|
|
||||||
"lincat" [LinDef]
|
|
||||||
"lindef" [LinDef]
|
|
||||||
"printname" [LinDef]
|
|
||||||
"param" [LinDef] -- lincats with param value names
|
|
||||||
"}" ;
|
|
||||||
|
|
||||||
Flg. Flag ::= CId "=" String ;
|
|
||||||
Cat. CatDef ::= CId "[" [Hypo] "]" ;
|
|
||||||
|
|
||||||
Fun. FunDef ::= CId ":" Type "=" Exp ;
|
|
||||||
Lin. LinDef ::= CId "=" Term ;
|
|
||||||
|
|
||||||
DTyp. Type ::= "[" [Hypo] "]" CId [Exp] ; -- dependent type
|
|
||||||
DTr. Exp ::= "[" "(" [CId] ")" Atom [Exp] "]" ; -- term with bindings
|
|
||||||
|
|
||||||
AC. Atom ::= CId ;
|
|
||||||
AS. Atom ::= String ;
|
|
||||||
AI. Atom ::= Integer ;
|
|
||||||
AF. Atom ::= Double ;
|
|
||||||
AM. Atom ::= "?" Integer ;
|
|
||||||
|
|
||||||
R. Term ::= "[" [Term] "]" ; -- record/table
|
|
||||||
P. Term ::= "(" Term "!" Term ")" ; -- projection/selection
|
|
||||||
S. Term ::= "(" [Term] ")" ; -- concatenated sequence
|
|
||||||
K. Term ::= Tokn ; -- token
|
|
||||||
V. Term ::= "$" Integer ; -- argument
|
|
||||||
C. Term ::= Integer ; -- parameter value/label
|
|
||||||
F. Term ::= CId ; -- global constant
|
|
||||||
FV. Term ::= "[|" [Term] "|]" ; -- free variation
|
|
||||||
W. Term ::= "(" String "+" Term ")" ; -- prefix + suffix table
|
|
||||||
TM. Term ::= "?" ; -- lin of metavariable
|
|
||||||
|
|
||||||
KS. Tokn ::= String ;
|
|
||||||
KP. Tokn ::= "[" "pre" [String] "[" [Variant] "]" "]" ;
|
|
||||||
Var. Variant ::= [String] "/" [String] ;
|
|
||||||
|
|
||||||
|
|
||||||
RP. Term ::= "(" Term "@" Term ")"; -- DEPRECATED: record parameter alias
|
|
||||||
|
|
||||||
terminator Concrete ";" ;
|
|
||||||
terminator Flag ";" ;
|
|
||||||
terminator CatDef ";" ;
|
|
||||||
terminator FunDef ";" ;
|
|
||||||
terminator LinDef ";" ;
|
|
||||||
separator CId "," ;
|
|
||||||
separator Term "," ;
|
|
||||||
terminator Exp "" ;
|
|
||||||
terminator String "" ;
|
|
||||||
separator Variant "," ;
|
|
||||||
|
|
||||||
token CId (('_' | letter) (letter | digit | '\'' | '_')*) ;
|
|
||||||
|
|
||||||
|
|
||||||
-- the following are needed if dependent types or HOAS or defs are present
|
|
||||||
|
|
||||||
Hyp. Hypo ::= CId ":" Type ;
|
|
||||||
AV. Atom ::= "$" CId ;
|
|
||||||
|
|
||||||
EEq. Exp ::= "{" [Equation] "}" ; -- list of pattern eqs; primitive: []
|
|
||||||
Equ. Equation ::= [Exp] "->" Exp ; -- patterns are encoded as exps
|
|
||||||
|
|
||||||
separator Hypo "," ;
|
|
||||||
terminator Equation ";" ;
|
|
||||||
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
Grm. Grammar ::= [RExp] ;
|
|
||||||
|
|
||||||
App. RExp ::= "(" CId [RExp] ")" ;
|
|
||||||
AId. RExp ::= CId ;
|
|
||||||
AInt. RExp ::= Integer ;
|
|
||||||
AStr. RExp ::= String ;
|
|
||||||
AFlt. RExp ::= Double ;
|
|
||||||
AMet. RExp ::= "?" ;
|
|
||||||
|
|
||||||
terminator RExp "" ;
|
|
||||||
|
|
||||||
token CId (('_' | letter) (letter | digit | '\'' | '_')*) ;
|
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
module GFC (mainGFC) where
|
module GFC (mainGFC) where
|
||||||
-- module Main where
|
-- module Main where
|
||||||
|
|
||||||
|
import PGF
|
||||||
|
import PGF.CId
|
||||||
|
import PGF.Data
|
||||||
|
import PGF.Raw.Parse
|
||||||
|
import PGF.Raw.Convert
|
||||||
import GF.Compile
|
import GF.Compile
|
||||||
import GF.GFCC.PrintGFCC
|
import GF.Compile.Export
|
||||||
import GF.GFCC.CId
|
|
||||||
import GF.GFCC.DataGFCC
|
|
||||||
import GF.GFCC.Raw.ParGFCCRaw
|
|
||||||
import GF.GFCC.Raw.ConvertGFCC
|
|
||||||
import GF.Infra.UseIO
|
import GF.Infra.UseIO
|
||||||
import GF.Infra.Option
|
import GF.Infra.Option
|
||||||
import GF.GFCC.API
|
|
||||||
import GF.Data.ErrM
|
import GF.Data.ErrM
|
||||||
|
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
|
|||||||
@@ -4,12 +4,11 @@ import GF.Command.Interpreter
|
|||||||
import GF.Command.Importing
|
import GF.Command.Importing
|
||||||
import GF.Command.Commands
|
import GF.Command.Commands
|
||||||
import GF.Data.ErrM
|
import GF.Data.ErrM
|
||||||
import GF.GFCC.API
|
|
||||||
import GF.Grammar.API -- for cc command
|
import GF.Grammar.API -- for cc command
|
||||||
|
|
||||||
import GF.Infra.UseIO
|
import GF.Infra.UseIO
|
||||||
import GF.Infra.Option
|
import GF.Infra.Option
|
||||||
import GF.System.Readline (fetchCommand)
|
import GF.System.Readline (fetchCommand)
|
||||||
|
import PGF
|
||||||
|
|
||||||
import System.CPUTime
|
import System.CPUTime
|
||||||
|
|
||||||
|
|||||||
@@ -13,20 +13,19 @@
|
|||||||
-- embedded GF systems. AR 19/9/2007
|
-- embedded GF systems. AR 19/9/2007
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GF.GFCC.API where
|
module PGF where
|
||||||
|
|
||||||
import GF.GFCC.Linearize
|
import PGF.CId
|
||||||
import GF.GFCC.Generate
|
import PGF.Linearize
|
||||||
import GF.GFCC.Macros
|
import PGF.Generate
|
||||||
import GF.GFCC.DataGFCC
|
import PGF.Macros
|
||||||
import GF.GFCC.CId
|
import PGF.Data
|
||||||
import GF.GFCC.Raw.ConvertGFCC
|
import PGF.Raw.Convert
|
||||||
import GF.GFCC.Raw.ParGFCCRaw
|
import PGF.Raw.Parse
|
||||||
|
import PGF.Parsing.FCFG
|
||||||
|
|
||||||
import GF.Data.ErrM
|
import GF.Data.ErrM
|
||||||
|
|
||||||
import GF.GFCC.Parsing.FCFG
|
|
||||||
|
|
||||||
import Data.Char
|
import Data.Char
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
@@ -85,7 +84,7 @@ file2gfcc f = do
|
|||||||
g <- parseGrammar s
|
g <- parseGrammar s
|
||||||
return $ toGFCC g
|
return $ toGFCC g
|
||||||
|
|
||||||
linearize mgr lang = GF.GFCC.Linearize.linearize (gfcc mgr) (mkCId lang)
|
linearize mgr lang = PGF.Linearize.linearize (gfcc mgr) (mkCId lang)
|
||||||
|
|
||||||
parse mgr lang cat s =
|
parse mgr lang cat s =
|
||||||
case lookParser (gfcc mgr) (mkCId lang) of
|
case lookParser (gfcc mgr) (mkCId lang) of
|
||||||
@@ -96,7 +95,7 @@ parse mgr lang cat s =
|
|||||||
|
|
||||||
linearizeAll mgr = map snd . linearizeAllLang mgr
|
linearizeAll mgr = map snd . linearizeAllLang mgr
|
||||||
linearizeAllLang mgr t =
|
linearizeAllLang mgr t =
|
||||||
[(lang,linearThis mgr lang t) | lang <- languages mgr]
|
[(lang,PGF.linearize mgr lang t) | lang <- languages mgr]
|
||||||
|
|
||||||
parseAll mgr cat = map snd . parseAllLang mgr cat
|
parseAll mgr cat = map snd . parseAllLang mgr cat
|
||||||
|
|
||||||
@@ -172,8 +171,6 @@ emptyMultiGrammar = MultiGrammar emptyGFCC
|
|||||||
|
|
||||||
------------ for internal use only
|
------------ for internal use only
|
||||||
|
|
||||||
linearThis = GF.GFCC.API.linearize
|
|
||||||
|
|
||||||
err f g ex = case ex of
|
err f g ex = case ex of
|
||||||
Ok x -> g x
|
Ok x -> g x
|
||||||
Bad s -> f s
|
Bad s -> f s
|
||||||
@@ -7,13 +7,13 @@
|
|||||||
-- FCFG parsing, parser information
|
-- FCFG parsing, parser information
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GF.GFCC.BuildParser where
|
module PGF.BuildParser where
|
||||||
|
|
||||||
import GF.GFCC.Parsing.FCFG.Utilities
|
|
||||||
import GF.Data.SortedList
|
import GF.Data.SortedList
|
||||||
import GF.Data.Assoc
|
import GF.Data.Assoc
|
||||||
import GF.GFCC.CId
|
import PGF.CId
|
||||||
import GF.GFCC.DataGFCC
|
import PGF.Data
|
||||||
|
import PGF.Parsing.FCFG.Utilities
|
||||||
|
|
||||||
import Data.Array
|
import Data.Array
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
module GF.GFCC.CId (CId(..), wildCId, mkCId, prCId) where
|
module PGF.CId (CId(..), wildCId, mkCId, prCId) where
|
||||||
|
|
||||||
import Data.ByteString.Char8 as BS
|
import Data.ByteString.Char8 as BS
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
module GF.GFCC.CheckGFCC (checkGFCC, checkGFCCio, checkGFCCmaybe) where
|
module PGF.Check (checkGFCC, checkGFCCio, checkGFCCmaybe) where
|
||||||
|
|
||||||
import GF.GFCC.CId
|
import PGF.CId
|
||||||
import GF.GFCC.Macros
|
import PGF.Data
|
||||||
import GF.GFCC.DataGFCC
|
import PGF.Macros
|
||||||
import GF.Data.ErrM
|
import GF.Data.ErrM
|
||||||
|
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
module GF.GFCC.DataGFCC where
|
module PGF.Data where
|
||||||
|
|
||||||
import GF.GFCC.CId
|
import PGF.CId
|
||||||
import GF.Text.UTF8
|
import GF.Text.UTF8
|
||||||
import GF.Data.Assoc
|
import GF.Data.Assoc
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
module GF.GFCC.Generate where
|
module PGF.Generate where
|
||||||
|
|
||||||
import GF.GFCC.Macros
|
import PGF.CId
|
||||||
import GF.GFCC.DataGFCC
|
import PGF.Data
|
||||||
import GF.GFCC.CId
|
import PGF.Macros
|
||||||
|
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
import System.Random
|
import System.Random
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
module GF.GFCC.Linearize where
|
module PGF.Linearize where
|
||||||
|
|
||||||
import GF.GFCC.Macros
|
import PGF.CId
|
||||||
import GF.GFCC.DataGFCC
|
import PGF.Data
|
||||||
import GF.GFCC.CId
|
import PGF.Macros
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
import Data.List
|
import Data.List
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
module GF.GFCC.Macros where
|
module PGF.Macros where
|
||||||
|
|
||||||
import GF.GFCC.CId
|
import PGF.CId
|
||||||
import GF.GFCC.DataGFCC
|
import PGF.Data
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
import qualified Data.Array as Array
|
import qualified Data.Array as Array
|
||||||
@@ -7,20 +7,19 @@
|
|||||||
-- FCFG parsing
|
-- FCFG parsing
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GF.GFCC.Parsing.FCFG
|
module PGF.Parsing.FCFG
|
||||||
(parseFCF,buildParserInfo,ParserInfo(..),makeFinalEdge) where
|
(parseFCF,buildParserInfo,ParserInfo(..),makeFinalEdge) where
|
||||||
|
|
||||||
import GF.Data.SortedList
|
|
||||||
import GF.Data.Assoc
|
|
||||||
|
|
||||||
import GF.GFCC.Parsing.FCFG.Utilities
|
|
||||||
import GF.GFCC.Parsing.FCFG.Active
|
|
||||||
|
|
||||||
import GF.GFCC.CId
|
|
||||||
import GF.GFCC.DataGFCC
|
|
||||||
import GF.GFCC.BuildParser
|
|
||||||
import GF.GFCC.Macros
|
|
||||||
import GF.Data.ErrM
|
import GF.Data.ErrM
|
||||||
|
import GF.Data.Assoc
|
||||||
|
import GF.Data.SortedList
|
||||||
|
|
||||||
|
import PGF.CId
|
||||||
|
import PGF.Data
|
||||||
|
import PGF.Macros
|
||||||
|
import PGF.BuildParser
|
||||||
|
import PGF.Parsing.FCFG.Utilities
|
||||||
|
import PGF.Parsing.FCFG.Active
|
||||||
|
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
|
|
||||||
@@ -7,16 +7,16 @@
|
|||||||
-- MCFG parsing, the active algorithm
|
-- MCFG parsing, the active algorithm
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GF.GFCC.Parsing.FCFG.Active (FCFParser, parse, makeFinalEdge) where
|
module PGF.Parsing.FCFG.Active (FCFParser, parse, makeFinalEdge) where
|
||||||
|
|
||||||
import GF.Data.GeneralDeduction
|
import GF.Data.GeneralDeduction
|
||||||
import GF.Data.Assoc
|
import GF.Data.Assoc
|
||||||
import GF.Data.SortedList
|
import GF.Data.SortedList
|
||||||
import GF.Data.Utilities
|
import GF.Data.Utilities
|
||||||
|
|
||||||
import GF.GFCC.CId
|
import PGF.CId
|
||||||
import GF.GFCC.DataGFCC
|
import PGF.Data
|
||||||
import GF.GFCC.Parsing.FCFG.Utilities
|
import PGF.Parsing.FCFG.Utilities
|
||||||
|
|
||||||
import Control.Monad (guard)
|
import Control.Monad (guard)
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
module GF.GFCC.Parsing.FCFG.Utilities where
|
module PGF.Parsing.FCFG.Utilities where
|
||||||
|
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
import Data.Array
|
import Data.Array
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
module GF.GFCC.Raw.AbsGFCCRaw where
|
module PGF.Raw.Abstract where
|
||||||
|
|
||||||
data Grammar =
|
data Grammar =
|
||||||
Grm [RExp]
|
Grm [RExp]
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
module GF.GFCC.Raw.ConvertGFCC (toGFCC,fromGFCC) where
|
module PGF.Raw.Convert (toGFCC,fromGFCC) where
|
||||||
|
|
||||||
import GF.GFCC.CId
|
import PGF.CId
|
||||||
import GF.GFCC.DataGFCC
|
import PGF.Data
|
||||||
import GF.GFCC.Raw.AbsGFCCRaw
|
import PGF.Raw.Abstract
|
||||||
import GF.GFCC.BuildParser (buildParserInfo)
|
import PGF.BuildParser (buildParserInfo)
|
||||||
import GF.GFCC.Parsing.FCFG.Utilities
|
import PGF.Parsing.FCFG.Utilities
|
||||||
|
|
||||||
import qualified Data.Array as Array
|
import qualified Data.Array as Array
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
module GF.GFCC.Raw.ParGFCCRaw (parseGrammar) where
|
module PGF.Raw.Parse (parseGrammar) where
|
||||||
|
|
||||||
import GF.GFCC.CId
|
import PGF.CId
|
||||||
import GF.GFCC.Raw.AbsGFCCRaw
|
import PGF.Raw.Abstract
|
||||||
|
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
import Data.Char
|
import Data.Char
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
module GF.GFCC.Raw.PrintGFCCRaw (printTree) where
|
module PGF.Raw.Print (printTree) where
|
||||||
|
|
||||||
import GF.GFCC.CId
|
import PGF.CId
|
||||||
import GF.GFCC.Raw.AbsGFCCRaw
|
import PGF.Raw.Abstract
|
||||||
|
|
||||||
import Data.List (intersperse)
|
import Data.List (intersperse)
|
||||||
import Numeric (showFFloat)
|
import Numeric (showFFloat)
|
||||||
@@ -1,15 +1,14 @@
|
|||||||
module GF.GFCC.ShowLinearize (
|
module PGF.ShowLinearize (
|
||||||
tableLinearize,
|
tableLinearize,
|
||||||
recordLinearize,
|
recordLinearize,
|
||||||
termLinearize,
|
termLinearize,
|
||||||
allLinearize
|
allLinearize
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import GF.GFCC.Linearize
|
import PGF.CId
|
||||||
import GF.GFCC.Macros
|
import PGF.Data
|
||||||
import GF.GFCC.DataGFCC
|
import PGF.Macros
|
||||||
import GF.GFCC.CId
|
import PGF.Linearize
|
||||||
--import GF.GFCC.PrintGFCC ----
|
|
||||||
|
|
||||||
import GF.Data.Operations
|
import GF.Data.Operations
|
||||||
import Data.List
|
import Data.List
|
||||||
Reference in New Issue
Block a user