forked from GitHub/gf-core
Fixed module names and imports after giant file move.
This commit is contained in:
34
src/GF.hs
34
src/GF.hs
@@ -5,32 +5,32 @@
|
|||||||
-- Stability : (stability)
|
-- Stability : (stability)
|
||||||
-- Portability : (portability)
|
-- Portability : (portability)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/05 21:52:31 $
|
-- > CVS $Date: 2005/04/21 16:21:02 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.20 $
|
-- > CVS $Revision: 1.21 $
|
||||||
--
|
--
|
||||||
-- The Main module of GF program.
|
-- The Main module of GF program.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Main (main) where
|
module Main (main) where
|
||||||
|
|
||||||
import GFModes (gfInteract, gfBatch, batchCompile)
|
import GF.GFModes (gfInteract, gfBatch, batchCompile)
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import UseIO
|
import GF.Infra.UseIO
|
||||||
import Option
|
import GF.Infra.Option
|
||||||
import IOGrammar
|
import GF.API.IOGrammar
|
||||||
import ShellState
|
import GF.Compile.ShellState
|
||||||
import Shell
|
import GF.Shell
|
||||||
import SubShell
|
import GF.Shell.SubShell
|
||||||
import ShellCommands
|
import GF.Shell.ShellCommands
|
||||||
import PShell
|
import GF.Shell.PShell
|
||||||
import JGF
|
import GF.Shell.JGF
|
||||||
import UTF8
|
import GF.Text.UTF8
|
||||||
|
|
||||||
import Today (today)
|
import GF.Today (today)
|
||||||
import Arch
|
import Arch
|
||||||
import System (getArgs)
|
import System (getArgs)
|
||||||
import Monad (foldM)
|
import Control.Monad (foldM)
|
||||||
|
|
||||||
-- AR 19/4/2000 -- 11/11/2001
|
-- AR 19/4/2000 -- 11/11/2001
|
||||||
|
|
||||||
|
|||||||
@@ -5,57 +5,57 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/12 15:20:29 $
|
-- > CVS $Date: 2005/04/21 16:21:03 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.31 $
|
-- > CVS $Revision: 1.32 $
|
||||||
--
|
--
|
||||||
-- Application Programmer's Interface to GF; also used by Shell. AR 10/11/2001
|
-- Application Programmer's Interface to GF; also used by Shell. AR 10/11/2001
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module API where
|
module GF.API where
|
||||||
|
|
||||||
import qualified AbsGF as GF
|
import qualified GF.Source.AbsGF as GF
|
||||||
import qualified AbsGFC as A
|
import qualified GF.Canon.AbsGFC as A
|
||||||
import qualified Rename as R
|
import qualified GF.Compile.Rename as R
|
||||||
import GetTree
|
import GF.UseGrammar.GetTree
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
--- import qualified Values as V
|
--- import qualified Values as V
|
||||||
import Values
|
import GF.Grammar.Values
|
||||||
|
|
||||||
-----import GetGrammar
|
-----import GetGrammar
|
||||||
import Compile
|
import GF.Compile.Compile
|
||||||
import IOGrammar
|
import GF.API.IOGrammar
|
||||||
import Linear
|
import GF.UseGrammar.Linear
|
||||||
import Parsing
|
import GF.UseGrammar.Parsing
|
||||||
import Morphology
|
import GF.UseGrammar.Morphology
|
||||||
import PPrCF
|
import GF.CF.PPrCF
|
||||||
import CFIdent
|
import GF.CF.CFIdent
|
||||||
import PGrammar
|
import GF.Compile.PGrammar
|
||||||
import Randomized (mkRandomTree)
|
import GF.UseGrammar.Randomized (mkRandomTree)
|
||||||
|
|
||||||
import MMacros
|
import GF.Grammar.MMacros
|
||||||
import qualified Macros as M
|
import qualified GF.Grammar.Macros as M
|
||||||
import TypeCheck
|
import GF.Grammar.TypeCheck
|
||||||
import CMacros
|
import GF.Canon.CMacros
|
||||||
import Transfer
|
import GF.UseGrammar.Transfer
|
||||||
import qualified Generate as Gen
|
import qualified GF.UseGrammar.Generate as Gen
|
||||||
|
|
||||||
import Text (untokWithXML)
|
import GF.Text.Text (untokWithXML)
|
||||||
import Option
|
import GF.Infra.Option
|
||||||
import Custom
|
import GF.UseGrammar.Custom
|
||||||
import ShellState
|
import GF.Compile.ShellState
|
||||||
import Linear
|
import GF.UseGrammar.Linear
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
import qualified Grammar as G
|
import qualified GF.Grammar.Grammar as G
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import qualified Compute as Co
|
import qualified GF.Grammar.Compute as Co
|
||||||
import qualified Ident as I
|
import qualified GF.Infra.Ident as I
|
||||||
import qualified GrammarToCanon as GC
|
import qualified GF.Compile.GrammarToCanon as GC
|
||||||
import qualified CanonToGrammar as CG
|
import qualified GF.Canon.CanonToGrammar as CG
|
||||||
import qualified MkGFC as MC
|
import qualified GF.Canon.MkGFC as MC
|
||||||
|
|
||||||
import Editing
|
import GF.UseGrammar.Editing
|
||||||
|
|
||||||
----import GrammarToXML
|
----import GrammarToXML
|
||||||
|
|
||||||
@@ -63,13 +63,13 @@ import Editing
|
|||||||
|
|
||||||
import Arch (myStdGen)
|
import Arch (myStdGen)
|
||||||
|
|
||||||
import UTF8
|
import GF.Text.UTF8
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import UseIO
|
import GF.Infra.UseIO
|
||||||
import Zipper
|
import GF.Data.Zipper
|
||||||
|
|
||||||
import List (nub)
|
import Data.List (nub)
|
||||||
import Monad (liftM)
|
import Control.Monad (liftM)
|
||||||
import System (system)
|
import System (system)
|
||||||
|
|
||||||
type GFGrammar = StateGrammar
|
type GFGrammar = StateGrammar
|
||||||
|
|||||||
@@ -5,16 +5,16 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:06 $
|
-- > CVS $Date: 2005/04/21 16:21:05 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- translate OCL, etc, files in batch mode
|
-- translate OCL, etc, files in batch mode
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module BatchTranslate (translate) where
|
module GF.API.BatchTranslate (translate) where
|
||||||
|
|
||||||
import API
|
import GF.API
|
||||||
import GetMyTree (file2tree)
|
import GetMyTree (file2tree)
|
||||||
|
|
||||||
translate :: FilePath -> FilePath -> IO ()
|
translate :: FilePath -> FilePath -> IO ()
|
||||||
@@ -40,4 +40,4 @@ It seems we should add open
|
|||||||
|
|
||||||
ParadigmsX, ResourceExtX, PredicationX
|
ParadigmsX, ResourceExtX, PredicationX
|
||||||
|
|
||||||
-}
|
-}
|
||||||
|
|||||||
@@ -5,22 +5,22 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:06 $
|
-- > CVS $Date: 2005/04/21 16:21:06 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- to write a GF abstract grammar into a Haskell module with translations from
|
-- to write a GF abstract grammar into a Haskell module with translations from
|
||||||
-- data objects into GF trees. Example: GSyntax for Agda.
|
-- data objects into GF trees. Example: GSyntax for Agda.
|
||||||
-- AR 11/11/1999 -- 7/12/2000 -- 18/5/2004
|
-- AR 11/11/1999 -- 7/12/2000 -- 18/5/2004
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GrammarToHaskell (grammar2haskell) where
|
module GF.API.GrammarToHaskell (grammar2haskell) where
|
||||||
|
|
||||||
import qualified GFC
|
import qualified GF.Canon.GFC as GFC
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
|
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
-- | the main function
|
-- | the main function
|
||||||
grammar2haskell :: GFC.CanonGrammar -> String
|
grammar2haskell :: GFC.CanonGrammar -> String
|
||||||
|
|||||||
@@ -5,31 +5,31 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/03/14 17:40:10 $
|
-- > CVS $Date: 2005/04/21 16:21:06 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.16 $
|
-- > CVS $Revision: 1.17 $
|
||||||
--
|
--
|
||||||
-- for reading grammars and terms from strings and files
|
-- for reading grammars and terms from strings and files
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module IOGrammar (shellStateFromFiles,
|
module GF.API.IOGrammar (shellStateFromFiles,
|
||||||
getShellStateFromFiles) where
|
getShellStateFromFiles) where
|
||||||
|
|
||||||
import Abstract
|
import GF.Grammar.Abstract
|
||||||
import qualified GFC
|
import qualified GF.Canon.GFC as GFC
|
||||||
import PGrammar
|
import GF.Compile.PGrammar
|
||||||
import TypeCheck
|
import GF.Grammar.TypeCheck
|
||||||
import Compile
|
import GF.Compile.Compile
|
||||||
import ShellState
|
import GF.Compile.ShellState
|
||||||
|
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import ReadFiles (isOldFile)
|
import GF.Infra.ReadFiles (isOldFile)
|
||||||
import Option
|
import GF.Infra.Option
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import UseIO
|
import GF.Infra.UseIO
|
||||||
import Arch
|
import Arch
|
||||||
|
|
||||||
import Monad (liftM)
|
import Control.Monad (liftM)
|
||||||
|
|
||||||
-- | a heuristic way of renaming constants is used
|
-- | a heuristic way of renaming constants is used
|
||||||
string2absTerm :: String -> String -> Term
|
string2absTerm :: String -> String -> Term
|
||||||
|
|||||||
@@ -5,19 +5,19 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:06 $
|
-- > CVS $Date: 2005/04/21 16:21:07 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- template to define your own parser (obsolete?)
|
-- template to define your own parser (obsolete?)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module MyParser (myParser) where
|
module GF.API.MyParser (myParser) where
|
||||||
|
|
||||||
import ShellState
|
import GF.Compile.ShellState
|
||||||
import CFIdent
|
import GF.CF.CFIdent
|
||||||
import CF
|
import GF.CF.CF
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
-- type CFParser = [CFTok] -> ([(CFTree,[CFTok])],String)
|
-- type CFParser = [CFTok] -> ([(CFTree,[CFTok])],String)
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:07 $
|
-- > CVS $Date: 2005/04/21 16:21:07 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- context-free grammars. AR 15\/12\/1999 -- 30\/3\/2000 -- 2\/6\/2001 -- 3\/12\/2001
|
-- context-free grammars. AR 15\/12\/1999 -- 30\/3\/2000 -- 2\/6\/2001 -- 3\/12\/2001
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module CF (-- * Types
|
module GF.CF.CF (-- * Types
|
||||||
CF(..), CFRule, CFRuleGroup,
|
CF(..), CFRule, CFRuleGroup,
|
||||||
CFItem(..), CFTree(..), CFPredef, CFParser,
|
CFItem(..), CFTree(..), CFPredef, CFParser,
|
||||||
RegExp(..), CFWord,
|
RegExp(..), CFWord,
|
||||||
@@ -34,13 +34,13 @@ module CF (-- * Types
|
|||||||
isCircularCF, predefRules
|
isCircularCF, predefRules
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Str
|
import GF.Data.Str
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
import CFIdent
|
import GF.CF.CFIdent
|
||||||
import List (nub,nubBy)
|
import Data.List (nub,nubBy)
|
||||||
import Char (isUpper, isLower, toUpper, toLower)
|
import Data.Char (isUpper, isLower, toUpper, toLower)
|
||||||
|
|
||||||
-- CF grammar data types
|
-- CF grammar data types
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/20 12:49:45 $
|
-- > CVS $Date: 2005/04/21 16:21:08 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.11 $
|
-- > CVS $Revision: 1.12 $
|
||||||
--
|
--
|
||||||
-- symbols (categories, functions) for context-free grammars.
|
-- symbols (categories, functions) for context-free grammars.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module CFIdent (-- * Tokens and categories
|
module GF.CF.CFIdent (-- * Tokens and categories
|
||||||
CFTok(..), CFCat(..),
|
CFTok(..), CFCat(..),
|
||||||
tS, tC, tL, tI, tV, tM, tInt,
|
tS, tC, tL, tI, tV, tM, tInt,
|
||||||
prCFTok,
|
prCFTok,
|
||||||
@@ -31,15 +31,15 @@ module CFIdent (-- * Tokens and categories
|
|||||||
compatToks, compatTok, compatCFFun, compatCF
|
compatToks, compatTok, compatCFFun, compatCF
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Values (cPredefAbs)
|
import GF.Grammar.Values (cPredefAbs)
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import Macros (ident2label)
|
import GF.Grammar.Macros (ident2label)
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import Str
|
import GF.Data.Str
|
||||||
import Char (toLower, toUpper)
|
import Data.Char (toLower, toUpper)
|
||||||
|
|
||||||
-- | this type should be abstract
|
-- | this type should be abstract
|
||||||
data CFTok =
|
data CFTok =
|
||||||
|
|||||||
@@ -5,29 +5,29 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/17 19:48:34 $
|
-- > CVS $Date: 2005/04/21 16:21:09 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.6 $
|
-- > CVS $Revision: 1.7 $
|
||||||
--
|
--
|
||||||
-- 26\/1\/2000 -- 18\/4 -- 24\/3\/2004
|
-- 26\/1\/2000 -- 18\/4 -- 24\/3\/2004
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module CFtoGrammar (cf2grammar) where
|
module GF.CF.CFtoGrammar (cf2grammar) where
|
||||||
|
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import qualified AbsGF as A
|
import qualified GF.Source.AbsGF as A
|
||||||
import qualified GrammarToSource as S
|
import qualified GF.Source.GrammarToSource as S
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
|
|
||||||
import CF
|
import GF.CF.CF
|
||||||
import CFIdent
|
import GF.CF.CFIdent
|
||||||
import PPrCF
|
import GF.CF.PPrCF
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
import List (nub)
|
import Data.List (nub)
|
||||||
import Char (isSpace)
|
import Data.Char (isSpace)
|
||||||
|
|
||||||
cf2grammar :: CF -> [A.TopDef]
|
cf2grammar :: CF -> [A.TopDef]
|
||||||
cf2grammar cf = concatMap S.trAnyDef (abs ++ conc) where
|
cf2grammar cf = concatMap S.trAnyDef (abs ++ conc) where
|
||||||
|
|||||||
@@ -5,23 +5,23 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:07 $
|
-- > CVS $Date: 2005/04/21 16:21:10 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- This module prints a CF as a SRG (Speech Recognition Grammar).
|
-- This module prints a CF as a SRG (Speech Recognition Grammar).
|
||||||
-- Created : 21 January, 2001.
|
-- Created : 21 January, 2001.
|
||||||
-- Modified : 16 April, 2004 by Aarne Ranta for GF 2.
|
-- Modified : 16 April, 2004 by Aarne Ranta for GF 2.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module CFtoSRG (prSRG) where
|
module GF.CF.CFtoSRG (prSRG) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import CF
|
import GF.CF.CF
|
||||||
import CFIdent
|
import GF.CF.CFIdent
|
||||||
---import UseGrammar
|
---import UseGrammar
|
||||||
import PPrCF
|
import GF.CF.PPrCF
|
||||||
import List (intersperse,nub)
|
import Data.List (intersperse,nub)
|
||||||
|
|
||||||
header :: String
|
header :: String
|
||||||
header = unlines ["#ABNF 1.0 ISO-8859-1;\n",
|
header = unlines ["#ABNF 1.0 ISO-8859-1;\n",
|
||||||
|
|||||||
@@ -5,33 +5,33 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/03/29 11:17:56 $
|
-- > CVS $Date: 2005/04/21 16:21:11 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.12 $
|
-- > CVS $Revision: 1.13 $
|
||||||
--
|
--
|
||||||
-- AR 27\/1\/2000 -- 3\/12\/2001 -- 8\/6\/2003
|
-- AR 27\/1\/2000 -- 3\/12\/2001 -- 8\/6\/2003
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module CanonToCF (canon2cf) where
|
module GF.CF.CanonToCF (canon2cf) where
|
||||||
|
|
||||||
import GF.System.Tracing -- peb 8/6-04
|
import GF.System.Tracing -- peb 8/6-04
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Option
|
import GF.Infra.Option
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import LookAbs (allBindCatsOf)
|
import GF.Grammar.LookAbs (allBindCatsOf)
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
import Values (isPredefCat,cPredefAbs)
|
import GF.Grammar.Values (isPredefCat,cPredefAbs)
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import CMacros
|
import GF.Canon.CMacros
|
||||||
import qualified Modules as M
|
import qualified GF.Infra.Modules as M
|
||||||
import CF
|
import GF.CF.CF
|
||||||
import CFIdent
|
import GF.CF.CFIdent
|
||||||
import Morphology
|
import GF.UseGrammar.Morphology
|
||||||
import Trie2
|
import GF.Data.Trie2
|
||||||
import List (nub,partition)
|
import Data.List (nub,partition)
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
-- | The main function: for a given cnc module 'm', build the CF grammar with all the
|
-- | The main function: for a given cnc module 'm', build the CF grammar with all the
|
||||||
-- rules coming from modules that 'm' extends. The categories are qualified by
|
-- rules coming from modules that 'm' extends. The categories are qualified by
|
||||||
|
|||||||
@@ -5,29 +5,29 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/16 05:40:50 $
|
-- > CVS $Date: 2005/04/21 16:21:12 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.9 $
|
-- > CVS $Revision: 1.10 $
|
||||||
--
|
--
|
||||||
-- Bottom-up Kilbury chart parser from "Pure Functional Parsing", chapter 5.
|
-- Bottom-up Kilbury chart parser from "Pure Functional Parsing", chapter 5.
|
||||||
-- OBSOLETE -- should use new MCFG parsers instead
|
-- OBSOLETE -- should use new MCFG parsers instead
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module ChartParser (chartParser) where
|
module GF.CF.ChartParser (chartParser) where
|
||||||
|
|
||||||
-- import Tracing
|
-- import Tracing
|
||||||
-- import PrintParser
|
-- import PrintParser
|
||||||
-- import PrintSimplifiedTerm
|
-- import PrintSimplifiedTerm
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import CF
|
import GF.CF.CF
|
||||||
import CFIdent
|
import GF.CF.CFIdent
|
||||||
import PPrCF (prCFItem)
|
import GF.CF.PPrCF (prCFItem)
|
||||||
|
|
||||||
import OrdSet
|
import GF.Data.OrdSet
|
||||||
import OrdMap2
|
import GF.Data.OrdMap2
|
||||||
|
|
||||||
import List (groupBy)
|
import Data.List (groupBy)
|
||||||
|
|
||||||
type Token = CFTok
|
type Token = CFTok
|
||||||
type Name = CFFun
|
type Name = CFFun
|
||||||
|
|||||||
@@ -5,26 +5,26 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:07 $
|
-- > CVS $Date: 2005/04/21 16:21:13 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.4 $
|
-- > CVS $Revision: 1.5 $
|
||||||
--
|
--
|
||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module EBNF (pEBNFasGrammar) where
|
module GF.CF.EBNF (pEBNFasGrammar) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Parsers
|
import GF.Data.Parsers
|
||||||
import Comments
|
import GF.Infra.Comments
|
||||||
import CF
|
import GF.CF.CF
|
||||||
import CFIdent
|
import GF.CF.CFIdent
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import CFtoGrammar
|
import GF.CF.CFtoGrammar
|
||||||
import qualified AbsGF as A
|
import qualified GF.Source.AbsGF as A
|
||||||
|
|
||||||
import List (nub, partition)
|
import Data.List (nub, partition)
|
||||||
|
|
||||||
-- AR 18/4/2000 - 31/3/2004
|
-- AR 18/4/2000 - 31/3/2004
|
||||||
|
|
||||||
|
|||||||
@@ -5,24 +5,24 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/17 19:48:34 $
|
-- > CVS $Date: 2005/04/21 16:21:13 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.10 $
|
-- > CVS $Revision: 1.11 $
|
||||||
--
|
--
|
||||||
-- printing and parsing CF grammars, rules, and trees AR 26/1/2000 -- 9/6/2003
|
-- printing and parsing CF grammars, rules, and trees AR 26/1/2000 -- 9/6/2003
|
||||||
--
|
--
|
||||||
-- use the Print class instead!
|
-- use the Print class instead!
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module PPrCF (prCF, prCFTree, prCFRule, prCFFun, prCFCat, prCFItem, prRegExp, pCF) where
|
module GF.CF.PPrCF (prCF, prCFTree, prCFRule, prCFFun, prCFCat, prCFItem, prRegExp, pCF) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import CF
|
import GF.CF.CF
|
||||||
import CFIdent
|
import GF.CF.CFIdent
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
|
|
||||||
import Char
|
import Data.Char
|
||||||
|
|
||||||
prCF :: CF -> String
|
prCF :: CF -> String
|
||||||
prCF = unlines . (map prCFRule) . rulesOfCF -- hiding the literal recogn function
|
prCF = unlines . (map prCFRule) . rulesOfCF -- hiding the literal recogn function
|
||||||
|
|||||||
@@ -5,31 +5,31 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/03/12 13:01:48 $
|
-- > CVS $Date: 2005/04/21 16:21:14 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.9 $
|
-- > CVS $Revision: 1.10 $
|
||||||
--
|
--
|
||||||
-- Printing CF grammars generated from GF as LBNF grammar for BNFC.
|
-- Printing CF grammars generated from GF as LBNF grammar for BNFC.
|
||||||
-- AR 26/1/2000 -- 9/6/2003 (PPrCF) -- 8/11/2003 -- 27/9/2004.
|
-- AR 26/1/2000 -- 9/6/2003 (PPrCF) -- 8/11/2003 -- 27/9/2004.
|
||||||
-- With primitive error messaging, by rules and rule tails commented out
|
-- With primitive error messaging, by rules and rule tails commented out
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module PrLBNF (prLBNF,prBNF) where
|
module GF.CF.PrLBNF (prLBNF,prBNF) where
|
||||||
|
|
||||||
import CF
|
import GF.CF.CF
|
||||||
import CFIdent
|
import GF.CF.CFIdent
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import ShellState
|
import GF.Compile.ShellState
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
import Look
|
import GF.Canon.Look
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
|
|
||||||
import Char
|
import Data.Char
|
||||||
import List (nub)
|
import Data.List (nub)
|
||||||
|
|
||||||
prLBNF :: Bool -> StateGrammar -> String
|
prLBNF :: Bool -> StateGrammar -> String
|
||||||
prLBNF new gr = unlines $ pragmas ++ (map (prCFRule cs) rules')
|
prLBNF new gr = unlines $ pragmas ++ (map (prCFRule cs) rules')
|
||||||
|
|||||||
@@ -5,30 +5,30 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:08 $
|
-- > CVS $Date: 2005/04/21 16:21:14 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.7 $
|
-- > CVS $Revision: 1.8 $
|
||||||
--
|
--
|
||||||
-- restoring parse trees for discontinuous constituents, bindings, etc. AR 25/1/2001
|
-- restoring parse trees for discontinuous constituents, bindings, etc. AR 25/1/2001
|
||||||
-- revised 8/4/2002 for the new profile structure
|
-- revised 8/4/2002 for the new profile structure
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Profile (postParse) where
|
module GF.CF.Profile (postParse) where
|
||||||
|
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
import qualified Ident as I
|
import qualified GF.Infra.Ident as I
|
||||||
import CMacros
|
import GF.Canon.CMacros
|
||||||
---import MMacros
|
---import MMacros
|
||||||
import CF
|
import GF.CF.CF
|
||||||
import CFIdent
|
import GF.CF.CFIdent
|
||||||
import PPrCF -- for error msg
|
import GF.CF.PPrCF -- for error msg
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
import List (nub)
|
import Data.List (nub)
|
||||||
|
|
||||||
-- | the job is done in two passes:
|
-- | the job is done in two passes:
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module AbsCFG where
|
module GF.CFGM.AbsCFG where
|
||||||
|
|
||||||
-- Haskell module generated by the BNF converter
|
-- Haskell module generated by the BNF converter
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{-# OPTIONS -fglasgow-exts -cpp #-}
|
{-# OPTIONS -fglasgow-exts -cpp #-}
|
||||||
{-# LINE 3 "LexCFG.x" #-}
|
{-# LINE 3 "LexCFG.x" #-}
|
||||||
module LexCFG where
|
module GF.CFGM.LexCFG where
|
||||||
|
|
||||||
import ErrM
|
import GF.Data.ErrM
|
||||||
|
|
||||||
|
|
||||||
#if __GLASGOW_HASKELL__ >= 503
|
#if __GLASGOW_HASKELL__ >= 503
|
||||||
@@ -10,8 +10,8 @@ import Data.Array
|
|||||||
import Data.Char (ord)
|
import Data.Char (ord)
|
||||||
import Data.Array.Base (unsafeAt)
|
import Data.Array.Base (unsafeAt)
|
||||||
#else
|
#else
|
||||||
import Array
|
import Data.Array
|
||||||
import Char (ord)
|
import Data.Char (ord)
|
||||||
#endif
|
#endif
|
||||||
#if __GLASGOW_HASKELL__ >= 503
|
#if __GLASGOW_HASKELL__ >= 503
|
||||||
import GHC.Exts
|
import GHC.Exts
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{-# OPTIONS -fglasgow-exts -cpp #-}
|
{-# OPTIONS -fglasgow-exts -cpp #-}
|
||||||
module ParCFG where
|
module GF.CFGM.ParCFG where
|
||||||
import AbsCFG
|
import GF.CFGM.AbsCFG
|
||||||
import LexCFG
|
import GF.CFGM.LexCFG
|
||||||
import ErrM
|
import GF.Data.ErrM
|
||||||
import Array
|
import Data.Array
|
||||||
#if __GLASGOW_HASKELL__ >= 503
|
#if __GLASGOW_HASKELL__ >= 503
|
||||||
import GHC.Exts
|
import GHC.Exts
|
||||||
#else
|
#else
|
||||||
@@ -476,7 +476,7 @@ happyError ts =
|
|||||||
|
|
||||||
myLexer = tokens
|
myLexer = tokens
|
||||||
{-# LINE 1 "GenericTemplate.hs" #-}
|
{-# LINE 1 "GenericTemplate.hs" #-}
|
||||||
-- $Id: ParCFG.hs,v 1.6 2005/03/21 14:27:06 bringert Exp $
|
-- $Id: ParCFG.hs,v 1.7 2005/04/21 16:21:17 bringert Exp $
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
module PrintCFG where
|
module GF.CFGM.PrintCFG where
|
||||||
|
|
||||||
-- pretty-printer generated by the BNF converter
|
-- pretty-printer generated by the BNF converter
|
||||||
|
|
||||||
import AbsCFG
|
import GF.CFGM.AbsCFG
|
||||||
import Char
|
import Data.Char
|
||||||
|
|
||||||
-- the top-level printing method
|
-- the top-level printing method
|
||||||
printTree :: Print a => a -> String
|
printTree :: Print a => a -> String
|
||||||
|
|||||||
@@ -5,33 +5,33 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/16 05:40:50 $
|
-- > CVS $Date: 2005/04/21 16:21:19 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.16 $
|
-- > CVS $Revision: 1.17 $
|
||||||
--
|
--
|
||||||
-- Handles printing a CFGrammar in CFGM format.
|
-- Handles printing a CFGrammar in CFGM format.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module PrintCFGrammar (prCanonAsCFGM) where
|
module GF.CFGM.PrintCFGrammar (prCanonAsCFGM) where
|
||||||
|
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import qualified PrintCFG
|
import qualified GF.CFGM.PrintCFG as PrintCFG
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
|
|
||||||
import qualified GF.Conversion.GFC as Cnv
|
import qualified GF.Conversion.GFC as Cnv
|
||||||
import GF.Infra.Print (prt)
|
import GF.Infra.Print (prt)
|
||||||
import GF.Formalism.CFG (CFRule(..))
|
import GF.Formalism.CFG (CFRule(..))
|
||||||
import qualified GF.Conversion.Types as GT
|
import qualified GF.Conversion.Types as GT
|
||||||
import qualified AbsCFG
|
import qualified GF.CFGM.AbsCFG as AbsCFG
|
||||||
import GF.Formalism.Utilities (Symbol(..))
|
import GF.Formalism.Utilities (Symbol(..))
|
||||||
|
|
||||||
import ErrM
|
import GF.Data.ErrM
|
||||||
import qualified Option
|
import qualified GF.Infra.Option as Option
|
||||||
|
|
||||||
import List (intersperse)
|
import Data.List (intersperse)
|
||||||
import Maybe (listToMaybe, maybe)
|
import Data.Maybe (listToMaybe, maybe)
|
||||||
|
|
||||||
-- | FIXME: should add an Options argument,
|
-- | FIXME: should add an Options argument,
|
||||||
-- to be able to decide which CFG conversion one wants to use
|
-- to be able to decide which CFG conversion one wants to use
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
module AbsGFC where
|
module GF.Canon.AbsGFC where
|
||||||
|
|
||||||
import Ident --H
|
import GF.Infra.Ident --H
|
||||||
|
|
||||||
-- Haskell module generated by the BNF converter, except --H
|
-- Haskell module generated by the BNF converter, except --H
|
||||||
|
|
||||||
|
|||||||
@@ -5,30 +5,30 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/03/08 15:31:22 $
|
-- > CVS $Date: 2005/04/21 16:21:21 $
|
||||||
-- > CVS $Author: bringert $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.23 $
|
-- > CVS $Revision: 1.24 $
|
||||||
--
|
--
|
||||||
-- Macros for building and analysing terms in GFC concrete syntax.
|
-- Macros for building and analysing terms in GFC concrete syntax.
|
||||||
--
|
--
|
||||||
-- macros for concrete syntax in GFC that do not need lookup in a grammar
|
-- macros for concrete syntax in GFC that do not need lookup in a grammar
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module CMacros where
|
module GF.Canon.CMacros where
|
||||||
|
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
import qualified Ident as A ---- no need to qualif? 21/9
|
import qualified GF.Infra.Ident as A ---- no need to qualif? 21/9
|
||||||
import qualified Values as V
|
import qualified GF.Grammar.Values as V
|
||||||
import qualified MMacros as M
|
import qualified GF.Grammar.MMacros as M
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import Str
|
import GF.Data.Str
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
import Char
|
import Data.Char
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
-- | how to mark subtrees, dep. on node, position, whether focus
|
-- | how to mark subtrees, dep. on node, position, whether focus
|
||||||
type JustMarker = V.TrNode -> [Int] -> Bool -> (String, String)
|
type JustMarker = V.TrNode -> [Int] -> Bool -> (String, String)
|
||||||
|
|||||||
@@ -5,28 +5,28 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:06 $
|
-- > CVS $Date: 2005/04/21 16:21:21 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.12 $
|
-- > CVS $Revision: 1.13 $
|
||||||
--
|
--
|
||||||
-- a decompiler. AR 12/6/2003 -- 19/4/2004
|
-- a decompiler. AR 12/6/2003 -- 19/4/2004
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module CanonToGrammar (canon2sourceGrammar, canon2sourceModule, redFlag) where
|
module GF.Canon.CanonToGrammar (canon2sourceGrammar, canon2sourceModule, redFlag) where
|
||||||
|
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
import MkGFC
|
import GF.Canon.MkGFC
|
||||||
---import CMacros
|
---import CMacros
|
||||||
import qualified Modules as M
|
import qualified GF.Infra.Modules as M
|
||||||
import qualified Option as O
|
import qualified GF.Infra.Option as O
|
||||||
import qualified Grammar as G
|
import qualified GF.Grammar.Grammar as G
|
||||||
import qualified Macros as F
|
import qualified GF.Grammar.Macros as F
|
||||||
|
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
canon2sourceGrammar :: CanonGrammar -> Err G.SourceGrammar
|
canon2sourceGrammar :: CanonGrammar -> Err G.SourceGrammar
|
||||||
canon2sourceGrammar gr = do
|
canon2sourceGrammar gr = do
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/20 20:09:19 $
|
-- > CVS $Date: 2005/04/21 16:21:22 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.11 $
|
-- > CVS $Revision: 1.12 $
|
||||||
--
|
--
|
||||||
-- canonical GF. AR 10\/9\/2002 -- 9\/5\/2003 -- 21\/9
|
-- canonical GF. AR 10\/9\/2002 -- 9\/5\/2003 -- 21\/9
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GFC (Context,
|
module GF.Canon.GFC (Context,
|
||||||
CanonGrammar,
|
CanonGrammar,
|
||||||
CanonModInfo,
|
CanonModInfo,
|
||||||
CanonModule,
|
CanonModule,
|
||||||
@@ -24,17 +24,17 @@ module GFC (Context,
|
|||||||
setFlag
|
setFlag
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import PrintGFC
|
import GF.Canon.PrintGFC
|
||||||
import qualified Abstract as A
|
import qualified GF.Grammar.Abstract as A
|
||||||
|
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Option
|
import GF.Infra.Option
|
||||||
import Zipper
|
import GF.Data.Zipper
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import qualified Modules as M
|
import qualified GF.Infra.Modules as M
|
||||||
|
|
||||||
import Char
|
import Data.Char
|
||||||
import Control.Arrow (first)
|
import Control.Arrow (first)
|
||||||
|
|
||||||
type Context = [(Ident,Exp)]
|
type Context = [(Ident,Exp)]
|
||||||
|
|||||||
@@ -5,22 +5,22 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:06 $
|
-- > CVS $Date: 2005/04/21 16:21:23 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.6 $
|
-- > CVS $Revision: 1.7 $
|
||||||
--
|
--
|
||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GetGFC (getCanonModule, getCanonGrammar) where
|
module GF.Canon.GetGFC (getCanonModule, getCanonGrammar) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import ParGFC
|
import GF.Canon.ParGFC
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
import MkGFC
|
import GF.Canon.MkGFC
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import GetGrammar (err2err) ---
|
import GF.Compile.GetGrammar (err2err) ---
|
||||||
import UseIO
|
import GF.Infra.UseIO
|
||||||
|
|
||||||
getCanonModule :: FilePath -> IOE CanonModule
|
getCanonModule :: FilePath -> IOE CanonModule
|
||||||
getCanonModule file = do
|
getCanonModule file = do
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
{-# OPTIONS -cpp #-}
|
{-# OPTIONS -cpp #-}
|
||||||
{-# LINE 3 "LexGFC.x" #-}
|
{-# LINE 3 "LexGFC.x" #-}
|
||||||
module LexGFC where
|
module GF.Canon.LexGFC where
|
||||||
|
|
||||||
import ErrM
|
import GF.Data.ErrM
|
||||||
|
|
||||||
#if __GLASGOW_HASKELL__ >= 503
|
#if __GLASGOW_HASKELL__ >= 503
|
||||||
import Data.Array
|
import Data.Array
|
||||||
import Data.Char (ord)
|
import Data.Char (ord)
|
||||||
import Data.Array.Base (unsafeAt)
|
import Data.Array.Base (unsafeAt)
|
||||||
#else
|
#else
|
||||||
import Array
|
import Data.Array
|
||||||
import Char (ord)
|
import Data.Char (ord)
|
||||||
#endif
|
#endif
|
||||||
alex_base :: Array Int Int
|
alex_base :: Array Int Int
|
||||||
alex_base = listArray (0,14) [1,57,66,0,9,29,11,32,154,362,0,277,485,211,51]
|
alex_base = listArray (0,14) [1,57,66,0,9,29,11,32,154,362,0,277,485,211,51]
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:06 $
|
-- > CVS $Date: 2005/04/21 16:21:25 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.11 $
|
-- > CVS $Revision: 1.12 $
|
||||||
--
|
--
|
||||||
-- lookup in GFC. AR 2003
|
-- lookup in GFC. AR 2003
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Look (lookupCncInfo,
|
module GF.Canon.Look (lookupCncInfo,
|
||||||
lookupLin,
|
lookupLin,
|
||||||
lookupLincat,
|
lookupLincat,
|
||||||
lookupPrintname,
|
lookupPrintname,
|
||||||
@@ -24,20 +24,20 @@ module Look (lookupCncInfo,
|
|||||||
ccompute
|
ccompute
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import CMacros
|
import GF.Canon.CMacros
|
||||||
----import Values
|
----import Values
|
||||||
import MMacros
|
import GF.Grammar.MMacros
|
||||||
import qualified Modules as M
|
import qualified GF.Infra.Modules as M
|
||||||
import qualified CanonToGrammar as CG
|
import qualified GF.Canon.CanonToGrammar as CG
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Option
|
import GF.Infra.Option
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
import List
|
import Data.List
|
||||||
|
|
||||||
-- linearization lookup
|
-- linearization lookup
|
||||||
|
|
||||||
|
|||||||
@@ -5,26 +5,26 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:07 $
|
-- > CVS $Date: 2005/04/21 16:21:26 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.11 $
|
-- > CVS $Revision: 1.12 $
|
||||||
--
|
--
|
||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module MkGFC (prCanonModInfo, prCanon, prCanonMGr,
|
module GF.Canon.MkGFC (prCanonModInfo, prCanon, prCanonMGr,
|
||||||
canon2grammar, grammar2canon,
|
canon2grammar, grammar2canon,
|
||||||
info2mod,
|
info2mod,
|
||||||
trExp, rtExp, rtQIdent) where
|
trExp, rtExp, rtQIdent) where
|
||||||
|
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import qualified Abstract as A
|
import qualified GF.Grammar.Abstract as A
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
|
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import qualified Modules as M
|
import qualified GF.Infra.Modules as M
|
||||||
|
|
||||||
prCanonModInfo :: CanonModule -> String
|
prCanonModInfo :: CanonModule -> String
|
||||||
prCanonModInfo = prt . info2mod
|
prCanonModInfo = prt . info2mod
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{-# OPTIONS -fglasgow-exts -cpp #-}
|
{-# OPTIONS -fglasgow-exts -cpp #-}
|
||||||
-- parser produced by Happy Version 1.13
|
-- parser produced by Happy Version 1.13
|
||||||
|
|
||||||
module ParGFC where
|
module GF.Canon.ParGFC where
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import LexGFC
|
import GF.Canon.LexGFC
|
||||||
import ErrM
|
import GF.Data.ErrM
|
||||||
import Ident --H
|
import GF.Infra.Ident --H
|
||||||
import Array
|
import Data.Array
|
||||||
#if __GLASGOW_HASKELL__ >= 503
|
#if __GLASGOW_HASKELL__ >= 503
|
||||||
import GHC.Exts
|
import GHC.Exts
|
||||||
#else
|
#else
|
||||||
@@ -1767,7 +1767,7 @@ happyError ts =
|
|||||||
|
|
||||||
myLexer = tokens
|
myLexer = tokens
|
||||||
{-# LINE 1 "GenericTemplate.hs" #-}
|
{-# LINE 1 "GenericTemplate.hs" #-}
|
||||||
-- $Id: ParGFC.hs,v 1.8 2005/02/04 14:17:06 bringert Exp $
|
-- $Id: ParGFC.hs,v 1.9 2005/04/21 16:21:27 bringert Exp $
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,19 +5,19 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:07 $
|
-- > CVS $Date: 2005/04/21 16:21:28 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.4 $
|
-- > CVS $Revision: 1.5 $
|
||||||
--
|
--
|
||||||
-- print trees without qualifications
|
-- print trees without qualifications
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module PrExp (prExp) where
|
module GF.Canon.PrExp (prExp) where
|
||||||
|
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
prExp :: Exp -> String
|
prExp :: Exp -> String
|
||||||
prExp e = case e of
|
prExp e = case e of
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
|
|
||||||
module PrintGFC where
|
module GF.Canon.PrintGFC where
|
||||||
|
|
||||||
-- pretty-printer generated by the BNF converter, except handhacked spacing --H
|
-- pretty-printer generated by the BNF converter, except handhacked spacing --H
|
||||||
|
|
||||||
import Ident --H
|
import GF.Infra.Ident --H
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import Char
|
import Data.Char
|
||||||
|
|
||||||
-- the top-level printing method
|
-- the top-level printing method
|
||||||
printTree :: Print a => a -> String
|
printTree :: Print a => a -> String
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:07 $
|
-- > CVS $Date: 2005/04/21 16:21:30 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.10 $
|
-- > CVS $Revision: 1.11 $
|
||||||
--
|
--
|
||||||
-- Optimizations on GFC code: sharing, parametrization, value sets.
|
-- Optimizations on GFC code: sharing, parametrization, value sets.
|
||||||
--
|
--
|
||||||
@@ -15,16 +15,16 @@
|
|||||||
-- following advice of Josef Svenningsson
|
-- following advice of Josef Svenningsson
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Share (shareModule, OptSpec, shareOpt, paramOpt, valOpt, allOpt) where
|
module GF.Canon.Share (shareModule, OptSpec, shareOpt, paramOpt, valOpt, allOpt) where
|
||||||
|
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
import qualified CMacros as C
|
import qualified GF.Canon.CMacros as C
|
||||||
import PrGrammar (prt)
|
import GF.Grammar.PrGrammar (prt)
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import List
|
import Data.List
|
||||||
import qualified Modules as M
|
import qualified GF.Infra.Modules as M
|
||||||
|
|
||||||
type OptSpec = [Integer] ---
|
type OptSpec = [Integer] ---
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
|
|
||||||
module SkelGFC where
|
module GF.Canon.SkelGFC where
|
||||||
|
|
||||||
-- Haskell module generated by the BNF converter
|
-- Haskell module generated by the BNF converter
|
||||||
|
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import ErrM
|
import GF.Data.ErrM
|
||||||
type Result = Err String
|
type Result = Err String
|
||||||
|
|
||||||
failure :: Show a => a -> Result
|
failure :: Show a => a -> Result
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
|
|
||||||
-- automatically generated by BNF Converter
|
-- automatically generated by BNF Converter
|
||||||
module Main where
|
module GF.Canon.TestGFC where
|
||||||
|
|
||||||
|
|
||||||
import IO ( stdin, hGetContents )
|
import System.IO ( stdin, hGetContents )
|
||||||
import System ( getArgs, getProgName )
|
import System ( getArgs, getProgName )
|
||||||
|
|
||||||
import LexGFC
|
import GF.Canon.LexGFC
|
||||||
import ParGFC
|
import GF.Canon.ParGFC
|
||||||
import SkelGFC
|
import GF.Canon.SkelGFC
|
||||||
import PrintGFC
|
import GF.Canon.PrintGFC
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
|
|
||||||
|
|
||||||
import ErrM
|
import GF.Data.ErrM
|
||||||
|
|
||||||
type ParseFun a = [Token] -> Err a
|
type ParseFun a = [Token] -> Err a
|
||||||
|
|
||||||
|
|||||||
@@ -5,20 +5,20 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:07 $
|
-- > CVS $Date: 2005/04/21 16:21:32 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.7 $
|
-- > CVS $Revision: 1.8 $
|
||||||
--
|
--
|
||||||
-- elementary text postprocessing. AR 21/11/2001
|
-- elementary text postprocessing. AR 21/11/2001
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Unlex (formatAsText, unlex, performBinds) where
|
module GF.Canon.Unlex (formatAsText, unlex, performBinds) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Str
|
import GF.Data.Str
|
||||||
|
|
||||||
import Char
|
import Data.Char
|
||||||
import List (isPrefixOf)
|
import Data.List (isPrefixOf)
|
||||||
|
|
||||||
formatAsText :: String -> String
|
formatAsText :: String -> String
|
||||||
formatAsText = unwords . format . cap . words where
|
formatAsText = unwords . format . cap . words where
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:08 $
|
-- > CVS $Date: 2005/04/21 16:21:33 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- Optimizations on GF source code: sharing, parametrization, value sets.
|
-- Optimizations on GF source code: sharing, parametrization, value sets.
|
||||||
--
|
--
|
||||||
@@ -15,15 +15,15 @@
|
|||||||
-- following advice of Josef Svenningsson
|
-- following advice of Josef Svenningsson
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module BackOpt (shareModule, OptSpec, shareOpt, paramOpt, valOpt, allOpt) where
|
module GF.Compile.BackOpt (shareModule, OptSpec, shareOpt, paramOpt, valOpt, allOpt) where
|
||||||
|
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import qualified Macros as C
|
import qualified GF.Grammar.Macros as C
|
||||||
import PrGrammar (prt)
|
import GF.Grammar.PrGrammar (prt)
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import List
|
import Data.List
|
||||||
import qualified Modules as M
|
import qualified GF.Infra.Modules as M
|
||||||
|
|
||||||
type OptSpec = [Integer] ---
|
type OptSpec = [Integer] ---
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/03/11 15:37:20 $
|
-- > CVS $Date: 2005/04/21 16:21:34 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.22 $
|
-- > CVS $Revision: 1.23 $
|
||||||
--
|
--
|
||||||
-- AR 4\/12\/1999 -- 1\/4\/2000 -- 8\/9\/2001 -- 15\/5\/2002 -- 27\/11\/2002 -- 18\/6\/2003
|
-- AR 4\/12\/1999 -- 1\/4\/2000 -- 8\/9\/2001 -- 15\/5\/2002 -- 27\/11\/2002 -- 18\/6\/2003
|
||||||
--
|
--
|
||||||
@@ -20,29 +20,29 @@
|
|||||||
-- - tables are type-annotated
|
-- - tables are type-annotated
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module CheckGrammar (showCheckModule, justCheckLTerm) where
|
module GF.Compile.CheckGrammar (showCheckModule, justCheckLTerm) where
|
||||||
|
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import Refresh ----
|
import GF.Grammar.Refresh ----
|
||||||
|
|
||||||
import TypeCheck
|
import GF.Grammar.TypeCheck
|
||||||
import Values (cPredefAbs) ---
|
import GF.Grammar.Values (cPredefAbs) ---
|
||||||
|
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import Lookup
|
import GF.Grammar.Lookup
|
||||||
import LookAbs
|
import GF.Grammar.LookAbs
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import ReservedWords ----
|
import GF.Grammar.ReservedWords ----
|
||||||
import PatternMatch
|
import GF.Grammar.PatternMatch
|
||||||
import AppPredefined
|
import GF.Grammar.AppPredefined
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import CheckM
|
import GF.Infra.CheckM
|
||||||
|
|
||||||
import List
|
import Data.List
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
showCheckModule :: [SourceModule] -> SourceModule -> Err ([SourceModule],String)
|
showCheckModule :: [SourceModule] -> SourceModule -> Err ([SourceModule],String)
|
||||||
showCheckModule mos m = do
|
showCheckModule mos m = do
|
||||||
|
|||||||
@@ -5,51 +5,51 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/03/08 18:08:58 $
|
-- > CVS $Date: 2005/04/21 16:21:35 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.35 $
|
-- > CVS $Revision: 1.36 $
|
||||||
--
|
--
|
||||||
-- The top-level compilation chain from source file to gfc\/gfr.
|
-- The top-level compilation chain from source file to gfc\/gfr.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Compile (compileModule, compileEnvShSt, compileOne,
|
module GF.Compile.Compile (compileModule, compileEnvShSt, compileOne,
|
||||||
CompileEnv, TimedCompileEnv
|
CompileEnv, TimedCompileEnv
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Option
|
import GF.Infra.Option
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import Update
|
import GF.Compile.Update
|
||||||
import Lookup
|
import GF.Grammar.Lookup
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import ReadFiles
|
import GF.Infra.ReadFiles
|
||||||
import ShellState
|
import GF.Compile.ShellState
|
||||||
import MkResource
|
import GF.Compile.MkResource
|
||||||
---- import MkUnion
|
---- import MkUnion
|
||||||
|
|
||||||
-- the main compiler passes
|
-- the main compiler passes
|
||||||
import GetGrammar
|
import GF.Compile.GetGrammar
|
||||||
import Extend
|
import GF.Compile.Extend
|
||||||
import Rebuild
|
import GF.Compile.Rebuild
|
||||||
import Rename
|
import GF.Compile.Rename
|
||||||
import Refresh
|
import GF.Grammar.Refresh
|
||||||
import CheckGrammar
|
import GF.Compile.CheckGrammar
|
||||||
import Optimize
|
import GF.Compile.Optimize
|
||||||
import GrammarToCanon
|
import GF.Compile.GrammarToCanon
|
||||||
import Share
|
import GF.Canon.Share
|
||||||
|
|
||||||
import qualified CanonToGrammar as CG
|
import qualified GF.Canon.CanonToGrammar as CG
|
||||||
|
|
||||||
import qualified GFC
|
import qualified GF.Canon.GFC as GFC
|
||||||
import qualified MkGFC
|
import qualified GF.Canon.MkGFC as MkGFC
|
||||||
import GetGFC
|
import GF.Canon.GetGFC
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import UseIO
|
import GF.Infra.UseIO
|
||||||
import Arch
|
import Arch
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
-- | environment variable for grammar search path
|
-- | environment variable for grammar search path
|
||||||
gfGrammarPathVar = "GF_LIB_PATH"
|
gfGrammarPathVar = "GF_LIB_PATH"
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:08 $
|
-- > CVS $Date: 2005/04/21 16:21:36 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.15 $
|
-- > CVS $Revision: 1.16 $
|
||||||
--
|
--
|
||||||
-- AR 14\/5\/2003 -- 11\/11
|
-- AR 14\/5\/2003 -- 11\/11
|
||||||
--
|
--
|
||||||
@@ -15,18 +15,18 @@
|
|||||||
-- extends a module symbol table by indirections to the module it extends
|
-- extends a module symbol table by indirections to the module it extends
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Extend (extendModule, extendMod
|
module GF.Compile.Extend (extendModule, extendMod
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import Update
|
import GF.Compile.Update
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
extendModule :: [SourceModule] -> SourceModule -> Err SourceModule
|
extendModule :: [SourceModule] -> SourceModule -> Err SourceModule
|
||||||
extendModule ms (name,mod) = case mod of
|
extendModule ms (name,mod) = case mod of
|
||||||
|
|||||||
@@ -5,42 +5,42 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:08 $
|
-- > CVS $Date: 2005/04/21 16:21:37 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.14 $
|
-- > CVS $Revision: 1.15 $
|
||||||
--
|
--
|
||||||
-- this module builds the internal GF grammar that is sent to the type checker
|
-- this module builds the internal GF grammar that is sent to the type checker
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GetGrammar (getSourceModule, getOldGrammar, getCFGrammar, getEBNFGrammar,
|
module GF.Compile.GetGrammar (getSourceModule, getOldGrammar, getCFGrammar, getEBNFGrammar,
|
||||||
err2err
|
err2err
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import qualified ErrM as E ----
|
import qualified GF.Data.ErrM as E ----
|
||||||
|
|
||||||
import UseIO
|
import GF.Infra.UseIO
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import qualified AbsGF as A
|
import qualified GF.Source.AbsGF as A
|
||||||
import SourceToGrammar
|
import GF.Source.SourceToGrammar
|
||||||
---- import Macros
|
---- import Macros
|
||||||
---- import Rename
|
---- import Rename
|
||||||
import Option
|
import GF.Infra.Option
|
||||||
--- import Custom
|
--- import Custom
|
||||||
import ParGF
|
import GF.Source.ParGF
|
||||||
import qualified LexGF as L
|
import qualified GF.Source.LexGF as L
|
||||||
|
|
||||||
import PPrCF
|
import GF.CF.PPrCF
|
||||||
import CFtoGrammar
|
import GF.CF.CFtoGrammar
|
||||||
import EBNF
|
import GF.CF.EBNF
|
||||||
|
|
||||||
import ReadFiles ----
|
import GF.Infra.ReadFiles ----
|
||||||
|
|
||||||
import Char (toUpper)
|
import Data.Char (toUpper)
|
||||||
import List (nub)
|
import Data.List (nub)
|
||||||
import Monad (foldM)
|
import Control.Monad (foldM)
|
||||||
|
|
||||||
getSourceModule :: FilePath -> IOE SourceModule
|
getSourceModule :: FilePath -> IOE SourceModule
|
||||||
getSourceModule file = do
|
getSourceModule file = do
|
||||||
|
|||||||
@@ -5,32 +5,32 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:08 $
|
-- > CVS $Date: 2005/04/21 16:21:38 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.16 $
|
-- > CVS $Revision: 1.17 $
|
||||||
--
|
--
|
||||||
-- Code generator from optimized GF source code to GFC.
|
-- Code generator from optimized GF source code to GFC.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GrammarToCanon (showGFC,
|
module GF.Compile.GrammarToCanon (showGFC,
|
||||||
redModInfo, redQIdent
|
redModInfo, redQIdent
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Zipper
|
import GF.Data.Zipper
|
||||||
import Option
|
import GF.Infra.Option
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import qualified AbsGFC as G
|
import qualified GF.Canon.AbsGFC as G
|
||||||
import qualified GFC as C
|
import qualified GF.Canon.GFC as C
|
||||||
import MkGFC
|
import GF.Canon.MkGFC
|
||||||
---- import Alias
|
---- import Alias
|
||||||
import qualified PrintGFC as P
|
import qualified GF.Canon.PrintGFC as P
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
-- compilation of optimized grammars to canonical GF. AR 5/10/2001 -- 12/5/2003
|
-- compilation of optimized grammars to canonical GF. AR 5/10/2001 -- 12/5/2003
|
||||||
|
|
||||||
|
|||||||
@@ -5,25 +5,25 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:08 $
|
-- > CVS $Date: 2005/04/21 16:21:38 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.11 $
|
-- > CVS $Revision: 1.12 $
|
||||||
--
|
--
|
||||||
-- Compile a gfc module into a "reuse" gfr resource, interface, or instance.
|
-- Compile a gfc module into a "reuse" gfr resource, interface, or instance.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module MkResource (makeReuse) where
|
module GF.Compile.MkResource (makeReuse) where
|
||||||
|
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import Lockfield
|
import GF.Grammar.Lockfield
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
-- | extracting resource r from abstract + concrete syntax.
|
-- | extracting resource r from abstract + concrete syntax.
|
||||||
-- AR 21\/8\/2002 -- 22\/6\/2003 for GF with modules
|
-- AR 21\/8\/2002 -- 22\/6\/2003 for GF with modules
|
||||||
|
|||||||
@@ -5,27 +5,27 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:09 $
|
-- > CVS $Date: 2005/04/21 16:21:39 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.6 $
|
-- > CVS $Revision: 1.7 $
|
||||||
--
|
--
|
||||||
-- building union of modules.
|
-- building union of modules.
|
||||||
-- AR 1\/3\/2004 --- OBSOLETE 15\/9\/2004 with multiple inheritance
|
-- AR 1\/3\/2004 --- OBSOLETE 15\/9\/2004 with multiple inheritance
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module MkUnion (makeUnion) where
|
module GF.Compile.MkUnion (makeUnion) where
|
||||||
|
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Option
|
import GF.Infra.Option
|
||||||
|
|
||||||
import List
|
import Data.List
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
makeUnion :: SourceGrammar -> Ident -> ModuleType Ident -> [(Ident,[Ident])] ->
|
makeUnion :: SourceGrammar -> Ident -> ModuleType Ident -> [(Ident,[Ident])] ->
|
||||||
Err SourceModule
|
Err SourceModule
|
||||||
|
|||||||
@@ -5,33 +5,33 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/03/08 18:08:58 $
|
-- > CVS $Date: 2005/04/21 16:21:40 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.12 $
|
-- > CVS $Revision: 1.13 $
|
||||||
--
|
--
|
||||||
-- Check correctness of module dependencies. Incomplete.
|
-- Check correctness of module dependencies. Incomplete.
|
||||||
--
|
--
|
||||||
-- AR 13\/5\/2003
|
-- AR 13\/5\/2003
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module ModDeps (mkSourceGrammar,
|
module GF.Compile.ModDeps (mkSourceGrammar,
|
||||||
moduleDeps,
|
moduleDeps,
|
||||||
openInterfaces,
|
openInterfaces,
|
||||||
requiredCanModules
|
requiredCanModules
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Option
|
import GF.Infra.Option
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import Update
|
import GF.Compile.Update
|
||||||
import Lookup
|
import GF.Grammar.Lookup
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
import List
|
import Data.List
|
||||||
|
|
||||||
-- | to check uniqueness of module names and import names, the
|
-- | to check uniqueness of module names and import names, the
|
||||||
-- appropriateness of import and extend types,
|
-- appropriateness of import and extend types,
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/03/29 11:17:56 $
|
-- > CVS $Date: 2005/04/21 16:21:41 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- AR 14\/5\/2003
|
-- AR 14\/5\/2003
|
||||||
--
|
--
|
||||||
@@ -22,20 +22,20 @@
|
|||||||
-- Hence we can proceed by @fold@ing "from left to right".
|
-- Hence we can proceed by @fold@ing "from left to right".
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Rename (renameSourceTerm, renameModule) where
|
module GF.Compile.NewRename (renameSourceTerm, renameModule) where
|
||||||
|
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Values
|
import GF.Grammar.Values
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import AppPredefined
|
import GF.Grammar.AppPredefined
|
||||||
import Lookup
|
import GF.Grammar.Lookup
|
||||||
import Extend
|
import GF.Compile.Extend
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
-- | this gives top-level access to renaming term input in the cc command
|
-- | this gives top-level access to renaming term input in the cc command
|
||||||
renameSourceTerm :: SourceGrammar -> Ident -> Term -> Err Term
|
renameSourceTerm :: SourceGrammar -> Ident -> Term -> Err Term
|
||||||
|
|||||||
@@ -5,33 +5,33 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:09 $
|
-- > CVS $Date: 2005/04/21 16:21:42 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.13 $
|
-- > CVS $Revision: 1.14 $
|
||||||
--
|
--
|
||||||
-- Top-level partial evaluation for GF source modules.
|
-- Top-level partial evaluation for GF source modules.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Optimize (optimizeModule) where
|
module GF.Compile.Optimize (optimizeModule) where
|
||||||
|
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import Lookup
|
import GF.Grammar.Lookup
|
||||||
import Refresh
|
import GF.Grammar.Refresh
|
||||||
import Compute
|
import GF.Grammar.Compute
|
||||||
import BackOpt
|
import GF.Compile.BackOpt
|
||||||
import CheckGrammar
|
import GF.Compile.CheckGrammar
|
||||||
import Update
|
import GF.Compile.Update
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import CheckM
|
import GF.Infra.CheckM
|
||||||
import Option
|
import GF.Infra.Option
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
import List
|
import Data.List
|
||||||
|
|
||||||
-- | partial evaluation of concrete syntax. AR 6\/2001 -- 16\/5\/2003 -- 5\/2\/2005.
|
-- | partial evaluation of concrete syntax. AR 6\/2001 -- 16\/5\/2003 -- 5\/2\/2005.
|
||||||
-- only do this for resource: concrete is optimized in gfc form
|
-- only do this for resource: concrete is optimized in gfc form
|
||||||
|
|||||||
@@ -5,30 +5,30 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:09 $
|
-- > CVS $Date: 2005/04/21 16:21:43 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.6 $
|
-- > CVS $Revision: 1.7 $
|
||||||
--
|
--
|
||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module PGrammar (pTerm, pTrm, pTrms,
|
module GF.Compile.PGrammar (pTerm, pTrm, pTrms,
|
||||||
pMeta, pzIdent,
|
pMeta, pzIdent,
|
||||||
string2ident
|
string2ident
|
||||||
) where
|
) where
|
||||||
|
|
||||||
---import LexGF
|
---import LexGF
|
||||||
import ParGF
|
import GF.Source.ParGF
|
||||||
import SourceToGrammar
|
import GF.Source.SourceToGrammar
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import qualified AbsGFC as A
|
import qualified GF.Canon.AbsGFC as A
|
||||||
import qualified GFC as G
|
import qualified GF.Canon.GFC as G
|
||||||
import GetGrammar
|
import GF.Compile.GetGrammar
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import MMacros
|
import GF.Grammar.MMacros
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
pTerm :: String -> Err Term
|
pTerm :: String -> Err Term
|
||||||
pTerm s = do
|
pTerm s = do
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:09 $
|
-- > CVS $Date: 2005/04/21 16:21:44 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.7 $
|
-- > CVS $Revision: 1.8 $
|
||||||
--
|
--
|
||||||
-- a hack to print gf2 into gf1 readable files
|
-- a hack to print gf2 into gf1 readable files
|
||||||
-- Works only for canonical grammars, printed into GFC. Otherwise we would have
|
-- Works only for canonical grammars, printed into GFC. Otherwise we would have
|
||||||
@@ -15,21 +15,21 @@
|
|||||||
-- --- printnames are not preserved, nor are lindefs
|
-- --- printnames are not preserved, nor are lindefs
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module PrOld (printGrammarOld, stripTerm) where
|
module GF.Compile.PrOld (printGrammarOld, stripTerm) where
|
||||||
|
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import CanonToGrammar
|
import GF.Canon.CanonToGrammar
|
||||||
import qualified GFC
|
import qualified GF.Canon.GFC as GFC
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import qualified PrintGF as P
|
import qualified GF.Source.PrintGF as P
|
||||||
import GrammarToSource
|
import GF.Source.GrammarToSource
|
||||||
|
|
||||||
import List
|
import Data.List
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import UseIO
|
import GF.Infra.UseIO
|
||||||
|
|
||||||
printGrammarOld :: GFC.CanonGrammar -> String
|
printGrammarOld :: GFC.CanonGrammar -> String
|
||||||
printGrammarOld gr = err id id $ do
|
printGrammarOld gr = err id id $ do
|
||||||
|
|||||||
@@ -5,25 +5,25 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/03/15 17:18:51 $
|
-- > CVS $Date: 2005/04/21 16:21:44 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.11 $
|
-- > CVS $Revision: 1.12 $
|
||||||
--
|
--
|
||||||
-- Rebuild a source module from incomplete and its with-instance.
|
-- Rebuild a source module from incomplete and its with-instance.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Rebuild (rebuildModule) where
|
module GF.Compile.Rebuild (rebuildModule) where
|
||||||
|
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import ModDeps
|
import GF.Compile.ModDeps
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import Lookup
|
import GF.Grammar.Lookup
|
||||||
import Extend
|
import GF.Compile.Extend
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
|
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
-- | rebuilding instance + interface, and "with" modules, prior to renaming.
|
-- | rebuilding instance + interface, and "with" modules, prior to renaming.
|
||||||
-- AR 24/10/2003
|
-- AR 24/10/2003
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:09 $
|
-- > CVS $Date: 2005/04/21 16:21:45 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- remove obsolete (Lin C) expressions before doing anything else. AR 21/6/2003
|
-- remove obsolete (Lin C) expressions before doing anything else. AR 21/6/2003
|
||||||
--
|
--
|
||||||
@@ -16,17 +16,17 @@
|
|||||||
-- The procedure is uncertain, if T contains another Lin.
|
-- The procedure is uncertain, if T contains another Lin.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module RemoveLiT (removeLiT) where
|
module GF.Compile.RemoveLiT (removeLiT) where
|
||||||
|
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import Lookup
|
import GF.Grammar.Lookup
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
removeLiT :: SourceGrammar -> Err SourceGrammar
|
removeLiT :: SourceGrammar -> Err SourceGrammar
|
||||||
removeLiT gr = liftM MGrammar $ mapM (remlModule gr) (modules gr)
|
removeLiT gr = liftM MGrammar $ mapM (remlModule gr) (modules gr)
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:09 $
|
-- > CVS $Date: 2005/04/21 16:21:46 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.17 $
|
-- > CVS $Revision: 1.18 $
|
||||||
--
|
--
|
||||||
-- AR 14\/5\/2003
|
-- AR 14\/5\/2003
|
||||||
-- The top-level function 'renameGrammar' does several things:
|
-- The top-level function 'renameGrammar' does several things:
|
||||||
@@ -22,23 +22,23 @@
|
|||||||
-- Hence we can proceed by @fold@ing "from left to right".
|
-- Hence we can proceed by @fold@ing "from left to right".
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Rename (renameGrammar,
|
module GF.Compile.Rename (renameGrammar,
|
||||||
renameSourceTerm,
|
renameSourceTerm,
|
||||||
renameModule
|
renameModule
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Values
|
import GF.Grammar.Values
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import AppPredefined
|
import GF.Grammar.AppPredefined
|
||||||
import Lookup
|
import GF.Grammar.Lookup
|
||||||
import Extend
|
import GF.Compile.Extend
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
renameGrammar :: SourceGrammar -> Err SourceGrammar
|
renameGrammar :: SourceGrammar -> Err SourceGrammar
|
||||||
renameGrammar g = liftM (MGrammar . reverse) $ foldM renameModule [] (modules g)
|
renameGrammar g = liftM (MGrammar . reverse) $ foldM renameModule [] (modules g)
|
||||||
|
|||||||
@@ -5,40 +5,40 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/16 05:40:50 $
|
-- > CVS $Date: 2005/04/21 16:21:47 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.43 $
|
-- > CVS $Revision: 1.44 $
|
||||||
--
|
--
|
||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module ShellState where
|
module GF.Compile.ShellState where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import GFC
|
import GF.Canon.GFC
|
||||||
import AbsGFC
|
import GF.Canon.AbsGFC
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import MMacros
|
import GF.Grammar.MMacros
|
||||||
|
|
||||||
import Look
|
import GF.Canon.Look
|
||||||
import LookAbs
|
import GF.Grammar.LookAbs
|
||||||
import ModDeps
|
import GF.Compile.ModDeps
|
||||||
import qualified Modules as M
|
import qualified GF.Infra.Modules as M
|
||||||
import qualified Grammar as G
|
import qualified GF.Grammar.Grammar as G
|
||||||
import qualified PrGrammar as P
|
import qualified GF.Grammar.PrGrammar as P
|
||||||
import CF
|
import GF.CF.CF
|
||||||
import CFIdent
|
import GF.CF.CFIdent
|
||||||
import CanonToCF
|
import GF.CF.CanonToCF
|
||||||
import Morphology
|
import GF.UseGrammar.Morphology
|
||||||
import Option
|
import GF.Infra.Option
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Arch (ModTime)
|
import Arch (ModTime)
|
||||||
|
|
||||||
import qualified GF.OldParsing.ConvertGrammar as CnvOld -- OBSOLETE
|
import qualified GF.OldParsing.ConvertGrammar as CnvOld -- OBSOLETE
|
||||||
import qualified GF.Conversion.GFC as Cnv
|
import qualified GF.Conversion.GFC as Cnv
|
||||||
import qualified GF.NewParsing.GFC as Prs
|
import qualified GF.Parsing.GFC as Prs
|
||||||
|
|
||||||
import List (nub,nubBy)
|
import Data.List (nub,nubBy)
|
||||||
|
|
||||||
-- AR 11/11/2001 -- 17/6/2003 (for modules) ---- unfinished
|
-- AR 11/11/2001 -- 17/6/2003 (for modules) ---- unfinished
|
||||||
|
|
||||||
|
|||||||
@@ -5,29 +5,29 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:09 $
|
-- > CVS $Date: 2005/04/21 16:21:48 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.6 $
|
-- > CVS $Revision: 1.7 $
|
||||||
--
|
--
|
||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Update (updateRes, buildAnyTree, combineAnyInfos, unifyAnyInfo,
|
module GF.Compile.Update (updateRes, buildAnyTree, combineAnyInfos, unifyAnyInfo,
|
||||||
-- * these auxiliaries should be somewhere else
|
-- * these auxiliaries should be somewhere else
|
||||||
-- since they don't use the info types
|
-- since they don't use the info types
|
||||||
groupInfos, sortInfos, combineInfos, unifyInfos,
|
groupInfos, sortInfos, combineInfos, unifyInfos,
|
||||||
tryInsert, unifAbsDefs, unifConstrs
|
tryInsert, unifAbsDefs, unifConstrs
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
import List
|
import Data.List
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
-- | update a resource module by adding a new or changing an old definition
|
-- | update a resource module by adding a new or changing an old definition
|
||||||
updateRes :: SourceGrammar -> Ident -> Ident -> Info -> SourceGrammar
|
updateRes :: SourceGrammar -> Ident -> Ident -> Info -> SourceGrammar
|
||||||
|
|||||||
@@ -4,20 +4,20 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/18 14:55:32 $
|
-- > CVS $Date: 2005/04/21 16:21:49 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.6 $
|
-- > CVS $Revision: 1.7 $
|
||||||
--
|
--
|
||||||
-- All conversions from GFC
|
-- All conversions from GFC
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GF.Conversion.GFC
|
module GF.Conversion.GFC
|
||||||
(module GF.Conversion.GFC,
|
(module GF.Conversion.GFC,
|
||||||
SGrammar, MGrammar, CGrammar) where
|
SGrammar, MGrammar, CGrammar) where
|
||||||
|
|
||||||
import Option
|
import GF.Infra.Option
|
||||||
import GFC (CanonGrammar)
|
import GF.Canon.GFC (CanonGrammar)
|
||||||
import Ident (Ident)
|
import GF.Infra.Ident (Ident)
|
||||||
import GF.Conversion.Types (CGrammar, MGrammar, EGrammar, SGrammar)
|
import GF.Conversion.Types (CGrammar, MGrammar, EGrammar, SGrammar)
|
||||||
|
|
||||||
import qualified GF.Conversion.GFCtoSimple as G2S
|
import qualified GF.Conversion.GFCtoSimple as G2S
|
||||||
|
|||||||
@@ -4,29 +4,29 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/18 14:55:32 $
|
-- > CVS $Date: 2005/04/21 16:21:50 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.4 $
|
-- > CVS $Revision: 1.5 $
|
||||||
--
|
--
|
||||||
-- Converting GFC to SimpleGFC
|
-- Converting GFC to SimpleGFC
|
||||||
--
|
--
|
||||||
-- the conversion might fail if the GFC grammar has dependent or higher-order types
|
-- the conversion might fail if the GFC grammar has dependent or higher-order types
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GF.Conversion.GFCtoSimple
|
module GF.Conversion.GFCtoSimple
|
||||||
(convertGrammar) where
|
(convertGrammar) where
|
||||||
|
|
||||||
import qualified AbsGFC as A
|
import qualified GF.Canon.AbsGFC as A
|
||||||
import qualified Ident as I
|
import qualified GF.Infra.Ident as I
|
||||||
import GF.Formalism.GCFG
|
import GF.Formalism.GCFG
|
||||||
import GF.Formalism.SimpleGFC
|
import GF.Formalism.SimpleGFC
|
||||||
import GF.Conversion.Types
|
import GF.Conversion.Types
|
||||||
|
|
||||||
import GFC (CanonGrammar)
|
import GF.Canon.GFC (CanonGrammar)
|
||||||
import MkGFC (grammar2canon)
|
import GF.Canon.MkGFC (grammar2canon)
|
||||||
import qualified Look (lookupLin, allParamValues, lookupLincat)
|
import qualified GF.Canon.Look as Look (lookupLin, allParamValues, lookupLincat)
|
||||||
import qualified CMacros (defLinType)
|
import qualified GF.Canon.CMacros as CMacros (defLinType)
|
||||||
import Operations (err, errVal)
|
import GF.Data.Operations (err, errVal)
|
||||||
--import qualified Modules as M
|
--import qualified Modules as M
|
||||||
|
|
||||||
import GF.System.Tracing
|
import GF.System.Tracing
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/18 14:55:32 $
|
-- > CVS $Date: 2005/04/21 16:21:51 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.4 $
|
-- > CVS $Revision: 1.5 $
|
||||||
--
|
--
|
||||||
-- Converting MCFG grammars to (possibly overgenerating) CFG
|
-- Converting MCFG grammars to (possibly overgenerating) CFG
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -18,7 +18,7 @@ module GF.Conversion.MCFGtoCFG
|
|||||||
import GF.System.Tracing
|
import GF.System.Tracing
|
||||||
import GF.Infra.Print
|
import GF.Infra.Print
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
import GF.Formalism.Utilities
|
import GF.Formalism.Utilities
|
||||||
import GF.Formalism.GCFG
|
import GF.Formalism.GCFG
|
||||||
import GF.Formalism.MCFG
|
import GF.Formalism.MCFG
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/18 14:57:29 $
|
-- > CVS $Date: 2005/04/21 16:21:52 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.1 $
|
-- > CVS $Revision: 1.2 $
|
||||||
--
|
--
|
||||||
-- Removing epsilon linearizations from MCF grammars
|
-- Removing epsilon linearizations from MCF grammars
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -18,16 +18,16 @@ module GF.Conversion.RemoveEpsilon where
|
|||||||
import GF.System.Tracing
|
import GF.System.Tracing
|
||||||
import GF.Infra.Print
|
import GF.Infra.Print
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
import List (mapAccumL)
|
import Data.List (mapAccumL)
|
||||||
import Maybe (mapMaybe)
|
import Data.Maybe (mapMaybe)
|
||||||
import GF.Formalism.Utilities
|
import GF.Formalism.Utilities
|
||||||
import GF.Formalism.GCFG
|
import GF.Formalism.GCFG
|
||||||
import GF.Formalism.MCFG
|
import GF.Formalism.MCFG
|
||||||
import GF.Conversion.Types
|
import GF.Conversion.Types
|
||||||
import GF.Data.Assoc
|
import GF.Data.Assoc
|
||||||
import GF.Data.SortedList
|
import GF.Data.SortedList
|
||||||
import GF.NewParsing.GeneralChart
|
import GF.Data.GeneralDeduction
|
||||||
|
|
||||||
convertGrammar :: EGrammar -> EGrammar
|
convertGrammar :: EGrammar -> EGrammar
|
||||||
convertGrammar grammar = undefined
|
convertGrammar grammar = undefined
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/18 14:57:29 $
|
-- > CVS $Date: 2005/04/21 16:21:53 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.1 $
|
-- > CVS $Revision: 1.2 $
|
||||||
--
|
--
|
||||||
-- Removing erasingness from MCFG grammars (as in Ljunglöf 2004, sec 4.5.1)
|
-- Removing erasingness from MCFG grammars (as in Ljunglöf 2004, sec 4.5.1)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -18,16 +18,16 @@ module GF.Conversion.RemoveErasing
|
|||||||
import GF.System.Tracing
|
import GF.System.Tracing
|
||||||
import GF.Infra.Print
|
import GF.Infra.Print
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
import List (mapAccumL)
|
import Data.List (mapAccumL)
|
||||||
import Maybe (mapMaybe)
|
import Data.Maybe (mapMaybe)
|
||||||
import GF.Formalism.Utilities
|
import GF.Formalism.Utilities
|
||||||
import GF.Formalism.GCFG
|
import GF.Formalism.GCFG
|
||||||
import GF.Formalism.MCFG
|
import GF.Formalism.MCFG
|
||||||
import GF.Conversion.Types
|
import GF.Conversion.Types
|
||||||
import GF.Data.Assoc
|
import GF.Data.Assoc
|
||||||
import GF.Data.SortedList
|
import GF.Data.SortedList
|
||||||
import GF.NewParsing.GeneralChart
|
import GF.Data.GeneralDeduction
|
||||||
|
|
||||||
convertGrammar :: EGrammar -> MGrammar
|
convertGrammar :: EGrammar -> MGrammar
|
||||||
convertGrammar grammar
|
convertGrammar grammar
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/18 14:55:32 $
|
-- > CVS $Date: 2005/04/21 16:21:54 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.2 $
|
-- > CVS $Revision: 1.3 $
|
||||||
--
|
--
|
||||||
-- Instantiating all types which only have one single element.
|
-- Instantiating all types which only have one single element.
|
||||||
--
|
--
|
||||||
@@ -26,7 +26,7 @@ import GF.Conversion.Types
|
|||||||
import GF.Data.SortedList
|
import GF.Data.SortedList
|
||||||
import GF.Data.Assoc
|
import GF.Data.Assoc
|
||||||
|
|
||||||
import List (mapAccumL)
|
import Data.List (mapAccumL)
|
||||||
|
|
||||||
convertGrammar :: SGrammar -> SGrammar
|
convertGrammar :: SGrammar -> SGrammar
|
||||||
convertGrammar grammar = if singles == emptyAssoc then grammar
|
convertGrammar grammar = if singles == emptyAssoc then grammar
|
||||||
|
|||||||
@@ -4,14 +4,14 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/18 14:55:32 $
|
-- > CVS $Date: 2005/04/21 16:21:54 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.4 $
|
-- > CVS $Revision: 1.5 $
|
||||||
--
|
--
|
||||||
-- Calculating the finiteness of each type in a grammar
|
-- Calculating the finiteness of each type in a grammar
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GF.Conversion.SimpleToFinite
|
module GF.Conversion.SimpleToFinite
|
||||||
(convertGrammar) where
|
(convertGrammar) where
|
||||||
|
|
||||||
import GF.System.Tracing
|
import GF.System.Tracing
|
||||||
@@ -26,7 +26,7 @@ import GF.Data.Assoc
|
|||||||
import GF.Data.BacktrackM
|
import GF.Data.BacktrackM
|
||||||
import GF.Data.Utilities (lookupList)
|
import GF.Data.Utilities (lookupList)
|
||||||
|
|
||||||
import Ident (Ident(..))
|
import GF.Infra.Ident (Ident(..))
|
||||||
|
|
||||||
type CnvMonad a = BacktrackM () a
|
type CnvMonad a = BacktrackM () a
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/18 14:55:32 $
|
-- > CVS $Date: 2005/04/21 16:21:57 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.3 $
|
-- > CVS $Revision: 1.4 $
|
||||||
--
|
--
|
||||||
-- Adding coercion functions to a MCFG if necessary.
|
-- Adding coercion functions to a MCFG if necessary.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -23,7 +23,7 @@ import GF.Formalism.GCFG
|
|||||||
import GF.Formalism.MCFG
|
import GF.Formalism.MCFG
|
||||||
import GF.Conversion.Types
|
import GF.Conversion.Types
|
||||||
import GF.Data.SortedList
|
import GF.Data.SortedList
|
||||||
import List (groupBy)
|
import Data.List (groupBy)
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/18 14:55:32 $
|
-- > CVS $Date: 2005/04/21 16:21:57 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.3 $
|
-- > CVS $Revision: 1.4 $
|
||||||
--
|
--
|
||||||
-- Converting SimpleGFC grammars to MCFG grammars, nondeterministically.
|
-- Converting SimpleGFC grammars to MCFG grammars, nondeterministically.
|
||||||
-- Afterwards, the grammar has to be extended with coercion functions,
|
-- Afterwards, the grammar has to be extended with coercion functions,
|
||||||
@@ -18,13 +18,13 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
module GF.Conversion.SimpleToMCFG.Nondet
|
module GF.Conversion.SimpleToMCFG.Nondet
|
||||||
(convertGrammar) where
|
(convertGrammar) where
|
||||||
|
|
||||||
import GF.System.Tracing
|
import GF.System.Tracing
|
||||||
import GF.Infra.Print
|
import GF.Infra.Print
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
import GF.Formalism.Utilities
|
import GF.Formalism.Utilities
|
||||||
import GF.Formalism.GCFG
|
import GF.Formalism.GCFG
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/18 14:55:33 $
|
-- > CVS $Date: 2005/04/21 16:21:58 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.3 $
|
-- > CVS $Revision: 1.4 $
|
||||||
--
|
--
|
||||||
-- Converting SimpleGFC grammars to MCFG grammars, deterministic.
|
-- Converting SimpleGFC grammars to MCFG grammars, deterministic.
|
||||||
--
|
--
|
||||||
@@ -22,7 +22,7 @@ module GF.Conversion.SimpleToMCFG.Strict
|
|||||||
import GF.System.Tracing
|
import GF.System.Tracing
|
||||||
import GF.Infra.Print
|
import GF.Infra.Print
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
import GF.Formalism.Utilities
|
import GF.Formalism.Utilities
|
||||||
import GF.Formalism.GCFG
|
import GF.Formalism.GCFG
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/20 12:49:44 $
|
-- > CVS $Date: 2005/04/21 16:21:56 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.6 $
|
-- > CVS $Revision: 1.7 $
|
||||||
--
|
--
|
||||||
-- All possible instantiations of different grammar formats used in conversion from GFC
|
-- All possible instantiations of different grammar formats used in conversion from GFC
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -14,9 +14,9 @@
|
|||||||
|
|
||||||
module GF.Conversion.Types where
|
module GF.Conversion.Types where
|
||||||
|
|
||||||
import qualified Ident (Ident, wildIdent, isWildIdent)
|
import qualified GF.Infra.Ident as Ident (Ident, wildIdent, isWildIdent)
|
||||||
import qualified AbsGFC (CIdent(..))
|
import qualified GF.Canon.AbsGFC as AbsGFC (CIdent(..))
|
||||||
import qualified Grammar (Term)
|
import qualified GF.Grammar.Grammar as Grammar (Term)
|
||||||
|
|
||||||
import GF.Formalism.GCFG
|
import GF.Formalism.GCFG
|
||||||
import GF.Formalism.SimpleGFC
|
import GF.Formalism.SimpleGFC
|
||||||
@@ -26,7 +26,7 @@ import GF.Formalism.Utilities
|
|||||||
import GF.Infra.Print
|
import GF.Infra.Print
|
||||||
import GF.Data.Assoc
|
import GF.Data.Assoc
|
||||||
|
|
||||||
import Monad (foldM)
|
import Control.Monad (foldM)
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
-- * basic (leaf) types
|
-- * basic (leaf) types
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/11 13:52:49 $
|
-- > CVS $Date: 2005/04/21 16:22:00 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.3 $
|
-- > CVS $Revision: 1.4 $
|
||||||
--
|
--
|
||||||
-- Backtracking state monad, with r\/o environment
|
-- Backtracking state monad, with r\/o environment
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -29,7 +29,7 @@ module GF.Data.BacktrackM ( -- * the backtracking state monad
|
|||||||
finalStates
|
finalStates
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
-- type declarations
|
-- type declarations
|
||||||
|
|||||||
@@ -5,15 +5,16 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:14 $
|
-- > CVS $Date: 2005/04/21 16:22:00 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.4 $
|
-- > CVS $Revision: 1.5 $
|
||||||
--
|
--
|
||||||
-- hack for BNFC generated files. AR 21/9/2003
|
-- hack for BNFC generated files. AR 21/9/2003
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module ErrM (module Operations
|
module GF.Data.ErrM (
|
||||||
|
module GF.Data.Operations
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
|
|||||||
@@ -4,14 +4,14 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/20 12:49:44 $
|
-- > CVS $Date: 2005/04/21 16:22:01 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.2 $
|
-- > CVS $Revision: 1.3 $
|
||||||
--
|
--
|
||||||
-- Simple implementation of deductive chart parsing
|
-- Simple implementation of deductive chart parsing
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GF.NewParsing.GeneralChart
|
module GF.Data.GeneralDeduction
|
||||||
(-- * Type definition
|
(-- * Type definition
|
||||||
ParseChart,
|
ParseChart,
|
||||||
-- * Main functions
|
-- * Main functions
|
||||||
@@ -28,7 +28,7 @@ module GF.NewParsing.GeneralChart
|
|||||||
-- import Trace
|
-- import Trace
|
||||||
|
|
||||||
import GF.Data.RedBlackSet
|
import GF.Data.RedBlackSet
|
||||||
import Monad (foldM)
|
import Control.Monad (foldM)
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
-- main functions
|
-- main functions
|
||||||
|
|||||||
@@ -5,18 +5,18 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:14 $
|
-- > CVS $Date: 2005/04/21 16:22:02 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.6 $
|
-- > CVS $Revision: 1.7 $
|
||||||
--
|
--
|
||||||
-- AR 8-11-2003, using Markus Forsberg's implementation of Huet's @unglue@
|
-- AR 8-11-2003, using Markus Forsberg's implementation of Huet's @unglue@
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Glue (decomposeSimple) where
|
module GF.Data.Glue (decomposeSimple) where
|
||||||
|
|
||||||
import Trie2
|
import GF.Data.Trie2
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import List
|
import Data.List
|
||||||
|
|
||||||
decomposeSimple :: Trie Char a -> [Char] -> Err [[Char]]
|
decomposeSimple :: Trie Char a -> [Char] -> Err [[Char]]
|
||||||
decomposeSimple t s = do
|
decomposeSimple t s = do
|
||||||
|
|||||||
@@ -4,15 +4,15 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/11 13:52:51 $
|
-- > CVS $Date: 2005/04/21 16:22:03 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.1 $
|
-- > CVS $Revision: 1.2 $
|
||||||
--
|
--
|
||||||
-- Implementation of /incremental/ deductive parsing,
|
-- Implementation of /incremental/ deductive parsing,
|
||||||
-- i.e. parsing one word at the time.
|
-- i.e. parsing one word at the time.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GF.NewParsing.IncrementalChart
|
module GF.Data.IncrementalDeduction
|
||||||
(-- * Type definitions
|
(-- * Type definitions
|
||||||
IncrementalChart,
|
IncrementalChart,
|
||||||
-- * Functions
|
-- * Functions
|
||||||
@@ -21,7 +21,7 @@ module GF.NewParsing.IncrementalChart
|
|||||||
chartList
|
chartList
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Array
|
import Data.Array
|
||||||
import GF.Data.SortedList
|
import GF.Data.SortedList
|
||||||
import GF.Data.Assoc
|
import GF.Data.Assoc
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
-- Stability : Stable
|
-- Stability : Stable
|
||||||
-- Portability : Haskell 98
|
-- Portability : Haskell 98
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:15 $
|
-- > CVS $Date: 2005/04/21 16:22:04 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Map (
|
module GF.Data.Map (
|
||||||
Map,
|
Map,
|
||||||
empty,
|
empty,
|
||||||
isEmpty,
|
isEmpty,
|
||||||
@@ -24,7 +24,7 @@ module Map (
|
|||||||
flatten
|
flatten
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import RedBlack
|
import GF.Data.RedBlack
|
||||||
|
|
||||||
type Map key el = Tree key el
|
type Map key el = Tree key el
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,16 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/03/29 11:17:56 $
|
-- > CVS $Date: 2005/04/21 16:22:05 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.18 $
|
-- > CVS $Revision: 1.19 $
|
||||||
--
|
--
|
||||||
-- some auxiliary GF operations. AR 19\/6\/1998 -- 6\/2\/2001
|
-- some auxiliary GF operations. AR 19\/6\/1998 -- 6\/2\/2001
|
||||||
--
|
--
|
||||||
-- Copyright (c) Aarne Ranta 1998-2000, under GNU General Public License (see GPL)
|
-- Copyright (c) Aarne Ranta 1998-2000, under GNU General Public License (see GPL)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Operations (-- * misc functions
|
module GF.Data.Operations (-- * misc functions
|
||||||
ifNull, onSnd,
|
ifNull, onSnd,
|
||||||
|
|
||||||
-- * the Error monad
|
-- * the Error monad
|
||||||
@@ -75,9 +75,9 @@ module Operations (-- * misc functions
|
|||||||
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Char (isSpace, toUpper, isSpace, isDigit)
|
import Data.Char (isSpace, toUpper, isSpace, isDigit)
|
||||||
import List (nub, sortBy, sort, deleteBy, nubBy)
|
import Data.List (nub, sortBy, sort, deleteBy, nubBy)
|
||||||
import Monad (liftM2, MonadPlus, mzero, mplus)
|
import Control.Monad (liftM2, MonadPlus, mzero, mplus)
|
||||||
|
|
||||||
infixr 5 +++
|
infixr 5 +++
|
||||||
infixr 5 ++-
|
infixr 5 ++-
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : Obsolete
|
-- Stability : Obsolete
|
||||||
-- Portability : Haskell 98
|
-- Portability : Haskell 98
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:15 $
|
-- > CVS $Date: 2005/04/21 16:22:05 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- The class of finite maps, as described in
|
-- The class of finite maps, as described in
|
||||||
-- \"Pure Functional Parsing\", section 2.2.2
|
-- \"Pure Functional Parsing\", section 2.2.2
|
||||||
@@ -17,9 +17,9 @@
|
|||||||
-- /OBSOLETE/! this is only used in module "ChartParser"
|
-- /OBSOLETE/! this is only used in module "ChartParser"
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module OrdMap2 (OrdMap(..), Map) where
|
module GF.Data.OrdMap2 (OrdMap(..), Map) where
|
||||||
|
|
||||||
import List (intersperse)
|
import Data.List (intersperse)
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : Obsolete
|
-- Stability : Obsolete
|
||||||
-- Portability : Haskell 98
|
-- Portability : Haskell 98
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:15 $
|
-- > CVS $Date: 2005/04/21 16:22:06 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- The class of ordered sets, as described in
|
-- The class of ordered sets, as described in
|
||||||
-- \"Pure Functional Parsing\", section 2.2.1,
|
-- \"Pure Functional Parsing\", section 2.2.1,
|
||||||
@@ -17,9 +17,9 @@
|
|||||||
-- /OBSOLETE/! this is only used in module "ChartParser"
|
-- /OBSOLETE/! this is only used in module "ChartParser"
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module OrdSet (OrdSet(..), Set) where
|
module GF.Data.OrdSet (OrdSet(..), Set) where
|
||||||
|
|
||||||
import List (intersperse)
|
import Data.List (intersperse)
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
|
|||||||
@@ -5,16 +5,16 @@
|
|||||||
-- Stability : Almost Obsolete
|
-- Stability : Almost Obsolete
|
||||||
-- Portability : Haskell 98
|
-- Portability : Haskell 98
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/24 11:46:35 $
|
-- > CVS $Date: 2005/04/21 16:22:06 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- some parser combinators a la Wadler and Hutton.
|
-- some parser combinators a la Wadler and Hutton.
|
||||||
-- no longer used in many places in GF
|
-- no longer used in many places in GF
|
||||||
-- (only used in module "EBNF")
|
-- (only used in module "EBNF")
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Parsers (-- * Main types and functions
|
module GF.Data.Parsers (-- * Main types and functions
|
||||||
Parser, parseResults, parseResultErr,
|
Parser, parseResults, parseResultErr,
|
||||||
-- * Basic combinators (on any token type)
|
-- * Basic combinators (on any token type)
|
||||||
(...), (.>.), (|||), (+||), literal, (***),
|
(...), (.>.), (|||), (+||), literal, (***),
|
||||||
@@ -31,8 +31,8 @@ module Parsers (-- * Main types and functions
|
|||||||
pQuotedString, pIntc
|
pQuotedString, pIntc
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Char
|
import Data.Char
|
||||||
|
|
||||||
|
|
||||||
infixr 2 |||, +||
|
infixr 2 |||, +||
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
-- Stability : Stable
|
-- Stability : Stable
|
||||||
-- Portability : Haskell 98
|
-- Portability : Haskell 98
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:15 $
|
-- > CVS $Date: 2005/04/21 16:22:07 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- Modified version of Osanaki's implementation.
|
-- Modified version of Osanaki's implementation.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module RedBlack (
|
module GF.Data.RedBlack (
|
||||||
emptyTree,
|
emptyTree,
|
||||||
isEmpty,
|
isEmpty,
|
||||||
Tree,
|
Tree,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
module SharedString (shareString) where
|
module GF.Data.SharedString (shareString) where
|
||||||
|
|
||||||
import Data.HashTable as H
|
import Data.HashTable as H
|
||||||
import System.IO.Unsafe (unsafePerformIO)
|
import System.IO.Unsafe (unsafePerformIO)
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
-- Stability : stable
|
-- Stability : stable
|
||||||
-- Portability : portable
|
-- Portability : portable
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/11 13:52:49 $
|
-- > CVS $Date: 2005/04/21 16:22:08 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.2 $
|
-- > CVS $Revision: 1.3 $
|
||||||
--
|
--
|
||||||
-- Sets as sorted lists
|
-- Sets as sorted lists
|
||||||
--
|
--
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
-- * /O(n^2)/ fixed point iteration
|
-- * /O(n^2)/ fixed point iteration
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GF.Data.SortedList
|
module GF.Data.SortedList
|
||||||
( -- * type declarations
|
( -- * type declarations
|
||||||
SList, SMap,
|
SList, SMap,
|
||||||
-- * set operations
|
-- * set operations
|
||||||
@@ -30,7 +30,7 @@ module GF.Data.SortedList
|
|||||||
unionMap, mergeMap
|
unionMap, mergeMap
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import List (groupBy)
|
import Data.List (groupBy)
|
||||||
import GF.Data.Utilities (split, foldMerge)
|
import GF.Data.Utilities (split, foldMerge)
|
||||||
|
|
||||||
-- | The list must be sorted and contain no duplicates.
|
-- | The list must be sorted and contain no duplicates.
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/24 11:46:35 $
|
-- > CVS $Date: 2005/04/21 16:22:09 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.7 $
|
-- > CVS $Revision: 1.8 $
|
||||||
--
|
--
|
||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Str (
|
module GF.Data.Str (
|
||||||
Str (..), Tok (..), --- constructors needed in PrGrammar
|
Str (..), Tok (..), --- constructors needed in PrGrammar
|
||||||
str2strings, str2allStrings, str, sstr, sstrV,
|
str2strings, str2allStrings, str, sstr, sstrV,
|
||||||
isZeroTok, prStr, plusStr, glueStr,
|
isZeroTok, prStr, plusStr, glueStr,
|
||||||
@@ -20,8 +20,8 @@ module Str (
|
|||||||
allItems
|
allItems
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import List (isPrefixOf, isSuffixOf, intersperse)
|
import Data.List (isPrefixOf, isSuffixOf, intersperse)
|
||||||
|
|
||||||
-- | abstract token list type. AR 2001, revised and simplified 20\/4\/2003
|
-- | abstract token list type. AR 2001, revised and simplified 20\/4\/2003
|
||||||
newtype Str = Str [Tok] deriving (Read, Show, Eq, Ord)
|
newtype Str = Str [Tok] deriving (Read, Show, Eq, Ord)
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
-- Stability : Obsolete
|
-- Stability : Obsolete
|
||||||
-- Portability : Haskell 98
|
-- Portability : Haskell 98
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:16 $
|
-- > CVS $Date: 2005/04/21 16:22:09 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Trie (
|
module GF.Data.Trie (
|
||||||
tcompile,
|
tcompile,
|
||||||
collapse,
|
collapse,
|
||||||
Trie,
|
Trie,
|
||||||
@@ -22,7 +22,7 @@ module Trie (
|
|||||||
atW, atP, atWP
|
atW, atP, atWP
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Map
|
import GF.Data.Map
|
||||||
|
|
||||||
--- data Attr = W | P | WP deriving Eq
|
--- data Attr = W | P | WP deriving Eq
|
||||||
type Attr = Int
|
type Attr = Int
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
-- Stability : Stable
|
-- Stability : Stable
|
||||||
-- Portability : Haskell 98
|
-- Portability : Haskell 98
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:16 $
|
-- > CVS $Date: 2005/04/21 16:22:10 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.6 $
|
-- > CVS $Revision: 1.7 $
|
||||||
--
|
--
|
||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Trie2 (
|
module GF.Data.Trie2 (
|
||||||
tcompile,
|
tcompile,
|
||||||
collapse,
|
collapse,
|
||||||
Trie,
|
Trie,
|
||||||
@@ -22,8 +22,8 @@ module Trie2 (
|
|||||||
emptyTrie
|
emptyTrie
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Map
|
import GF.Data.Map
|
||||||
import List
|
import Data.List
|
||||||
|
|
||||||
newtype TrieT a b = TrieT ([(a,TrieT a b)],[b])
|
newtype TrieT a b = TrieT ([(a,TrieT a b)],[b])
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/24 11:46:36 $
|
-- > CVS $Date: 2005/04/21 16:22:11 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.7 $
|
-- > CVS $Revision: 1.8 $
|
||||||
--
|
--
|
||||||
-- Gérard Huet's zipper (JFP 7 (1997)). AR 10\/8\/2001
|
-- Gérard Huet's zipper (JFP 7 (1997)). AR 10\/8\/2001
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Zipper (-- * types
|
module GF.Data.Zipper (-- * types
|
||||||
Tr(..),
|
Tr(..),
|
||||||
Path(..),
|
Path(..),
|
||||||
Loc(..),
|
Loc(..),
|
||||||
@@ -53,7 +53,7 @@ module Zipper (-- * types
|
|||||||
arityTree
|
arityTree
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
newtype Tr a = Tr (a,[Tr a]) deriving (Show,Eq)
|
newtype Tr a = Tr (a,[Tr a]) deriving (Show,Eq)
|
||||||
|
|
||||||
|
|||||||
@@ -4,18 +4,18 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/16 05:40:49 $
|
-- > CVS $Date: 2005/04/21 16:22:13 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.4 $
|
-- > CVS $Revision: 1.5 $
|
||||||
--
|
--
|
||||||
-- Simplistic GFC format
|
-- Simplistic GFC format
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GF.Formalism.SimpleGFC where
|
module GF.Formalism.SimpleGFC where
|
||||||
|
|
||||||
import Monad (liftM)
|
import Control.Monad (liftM)
|
||||||
import qualified AbsGFC
|
import qualified GF.Canon.AbsGFC as AbsGFC
|
||||||
import qualified Ident
|
import qualified GF.Infra.Ident as Ident
|
||||||
import GF.Formalism.GCFG
|
import GF.Formalism.GCFG
|
||||||
import GF.Infra.Print
|
import GF.Infra.Print
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/20 12:49:44 $
|
-- > CVS $Date: 2005/04/21 16:22:14 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.4 $
|
-- > CVS $Revision: 1.5 $
|
||||||
--
|
--
|
||||||
-- Basic type declarations and functions for grammar formalisms
|
-- Basic type declarations and functions for grammar formalisms
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -14,9 +14,9 @@
|
|||||||
|
|
||||||
module GF.Formalism.Utilities where
|
module GF.Formalism.Utilities where
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
import Array
|
import Data.Array
|
||||||
import List (groupBy)
|
import Data.List (groupBy)
|
||||||
|
|
||||||
import GF.Data.SortedList
|
import GF.Data.SortedList
|
||||||
import GF.Data.Assoc
|
import GF.Data.Assoc
|
||||||
|
|||||||
@@ -5,24 +5,24 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/24 11:46:36 $
|
-- > CVS $Date: 2005/04/21 16:22:15 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- a graphical shell for any kind of GF with Zipper editing. AR 20\/8\/2001
|
-- a graphical shell for any kind of GF with Zipper editing. AR 20\/8\/2001
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module CommandF where
|
module GF.Fudgets.CommandF where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
import Session
|
import GF.UseGrammar.Session
|
||||||
import Commands
|
import GF.Shell.Commands
|
||||||
|
|
||||||
import Fudgets
|
import Fudgets
|
||||||
import FudgetOps
|
import GF.Fudgets.FudgetOps
|
||||||
|
|
||||||
import EventF
|
import GF.Fudgets.EventF
|
||||||
|
|
||||||
-- a graphical shell for any kind of GF with Zipper editing. AR 20/8/2001
|
-- a graphical shell for any kind of GF with Zipper editing. AR 20/8/2001
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:14 $
|
-- > CVS $Date: 2005/04/21 16:22:16 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.3 $
|
-- > CVS $Revision: 1.4 $
|
||||||
--
|
--
|
||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module EventF where
|
module GF.Fudgets.EventF where
|
||||||
import AllFudgets
|
import AllFudgets
|
||||||
|
|
||||||
-- | The first string is the name of the key (e.g., "Down" for the down arrow key)
|
-- | The first string is the name of the key (e.g., "Down" for the down arrow key)
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:14 $
|
-- > CVS $Date: 2005/04/21 16:22:17 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.3 $
|
-- > CVS $Revision: 1.4 $
|
||||||
--
|
--
|
||||||
-- auxiliary Fudgets for GF syntax editor
|
-- auxiliary Fudgets for GF syntax editor
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module FudgetOps where
|
module GF.Fudgets.FudgetOps where
|
||||||
|
|
||||||
import Fudgets
|
import Fudgets
|
||||||
|
|
||||||
|
|||||||
@@ -5,18 +5,18 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:16 $
|
-- > CVS $Date: 2005/04/21 16:22:17 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.3 $
|
-- > CVS $Revision: 1.4 $
|
||||||
--
|
--
|
||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module UnicodeF (fudlogueWriteU) where
|
module GF.Fudgets.UnicodeF (fudlogueWriteU) where
|
||||||
import Fudgets
|
import Fudgets
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Unicode
|
import GF.Text.Unicode
|
||||||
|
|
||||||
-- AR 12/4/2000, 18/9/2001 (added font parameter)
|
-- AR 12/4/2000, 18/9/2001 (added font parameter)
|
||||||
|
|
||||||
|
|||||||
@@ -4,26 +4,26 @@
|
|||||||
-- Stability : (stability)
|
-- Stability : (stability)
|
||||||
-- Portability : (portability)
|
-- Portability : (portability)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/16 05:40:48 $
|
-- > CVS $Date: 2005/04/21 16:21:04 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.6 $
|
-- > CVS $Revision: 1.7 $
|
||||||
--
|
--
|
||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GFModes (gfInteract, gfBatch, batchCompile) where
|
module GF.GFModes (gfInteract, gfBatch, batchCompile) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import UseIO
|
import GF.Infra.UseIO
|
||||||
import Option
|
import GF.Infra.Option
|
||||||
import ShellState
|
import GF.Compile.ShellState
|
||||||
import ShellCommands
|
import GF.Shell.ShellCommands
|
||||||
import Shell
|
import GF.Shell
|
||||||
import CommandL (execCommandHistory)
|
import GF.Shell.CommandL (execCommandHistory)
|
||||||
import SubShell
|
import GF.Shell.SubShell
|
||||||
import PShell
|
import GF.Shell.PShell
|
||||||
import JGF
|
import GF.Shell.JGF
|
||||||
import Char (isSpace)
|
import Data.Char (isSpace)
|
||||||
|
|
||||||
-- separated from GF Main 24/6/2003
|
-- separated from GF Main 24/6/2003
|
||||||
|
|
||||||
|
|||||||
@@ -5,31 +5,31 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:12 $
|
-- > CVS $Date: 2005/04/21 16:22:18 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.6 $
|
-- > CVS $Revision: 1.7 $
|
||||||
--
|
--
|
||||||
-- computation in abstract syntax w.r.t. explicit definitions.
|
-- computation in abstract syntax w.r.t. explicit definitions.
|
||||||
--
|
--
|
||||||
-- old GF computation; to be updated
|
-- old GF computation; to be updated
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module AbsCompute (LookDef,
|
module GF.Grammar.AbsCompute (LookDef,
|
||||||
compute,
|
compute,
|
||||||
computeAbsTerm,
|
computeAbsTerm,
|
||||||
computeAbsTermIn,
|
computeAbsTermIn,
|
||||||
beta
|
beta
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
import Abstract
|
import GF.Grammar.Abstract
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import LookAbs
|
import GF.Grammar.LookAbs
|
||||||
import PatternMatch
|
import GF.Grammar.PatternMatch
|
||||||
import Compute
|
import GF.Grammar.Compute
|
||||||
|
|
||||||
import Monad (liftM, liftM2)
|
import Control.Monad (liftM, liftM2)
|
||||||
|
|
||||||
compute :: GFCGrammar -> Exp -> Err Exp
|
compute :: GFCGrammar -> Exp -> Err Exp
|
||||||
compute = computeAbsTerm
|
compute = computeAbsTerm
|
||||||
|
|||||||
@@ -5,32 +5,32 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:12 $
|
-- > CVS $Date: 2005/04/21 16:22:18 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.3 $
|
-- > CVS $Revision: 1.4 $
|
||||||
--
|
--
|
||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Abstract (
|
module GF.Grammar.Abstract (
|
||||||
|
|
||||||
module Grammar,
|
module GF.Grammar.Grammar,
|
||||||
module Values,
|
module GF.Grammar.Values,
|
||||||
module Macros,
|
module GF.Grammar.Macros,
|
||||||
module Ident,
|
module GF.Infra.Ident,
|
||||||
module MMacros,
|
module GF.Grammar.MMacros,
|
||||||
module PrGrammar,
|
module GF.Grammar.PrGrammar,
|
||||||
|
|
||||||
Grammar
|
Grammar
|
||||||
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Values
|
import GF.Grammar.Values
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import MMacros
|
import GF.Grammar.MMacros
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
|
|
||||||
type Grammar = SourceGrammar ---
|
type Grammar = SourceGrammar ---
|
||||||
|
|
||||||
|
|||||||
@@ -5,21 +5,21 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/01 21:24:24 $
|
-- > CVS $Date: 2005/04/21 16:22:19 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.10 $
|
-- > CVS $Revision: 1.11 $
|
||||||
--
|
--
|
||||||
-- Predefined function type signatures and definitions.
|
-- Predefined function type signatures and definitions.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module AppPredefined (isInPredefined, typPredefined, appPredefined
|
module GF.Grammar.AppPredefined (isInPredefined, typPredefined, appPredefined
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import PrGrammar (prt,prt_,prtBad)
|
import GF.Grammar.PrGrammar (prt,prt_,prtBad)
|
||||||
---- import PGrammar (pTrm)
|
---- import PGrammar (pTrm)
|
||||||
|
|
||||||
-- predefined function type signatures and definitions. AR 12/3/2003.
|
-- predefined function type signatures and definitions. AR 12/3/2003.
|
||||||
|
|||||||
@@ -5,31 +5,31 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/01 21:24:24 $
|
-- > CVS $Date: 2005/04/21 16:22:19 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.14 $
|
-- > CVS $Revision: 1.15 $
|
||||||
--
|
--
|
||||||
-- Computation of source terms. Used in compilation and in @cc@ command.
|
-- Computation of source terms. Used in compilation and in @cc@ command.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Compute (computeConcrete, computeTerm) where
|
module GF.Grammar.Compute (computeConcrete, computeTerm) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Str
|
import GF.Data.Str
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import Lookup
|
import GF.Grammar.Lookup
|
||||||
import Refresh
|
import GF.Grammar.Refresh
|
||||||
import PatternMatch
|
import GF.Grammar.PatternMatch
|
||||||
import Lockfield (isLockLabel) ----
|
import GF.Grammar.Lockfield (isLockLabel) ----
|
||||||
|
|
||||||
import AppPredefined
|
import GF.Grammar.AppPredefined
|
||||||
|
|
||||||
import List (nub,intersperse)
|
import Data.List (nub,intersperse)
|
||||||
import Monad (liftM2, liftM)
|
import Control.Monad (liftM2, liftM)
|
||||||
|
|
||||||
-- | computation of concrete syntax terms into normal form
|
-- | computation of concrete syntax terms into normal form
|
||||||
-- used mainly for partial evaluation
|
-- used mainly for partial evaluation
|
||||||
|
|||||||
@@ -5,16 +5,16 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:12 $
|
-- > CVS $Date: 2005/04/21 16:22:20 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.7 $
|
-- > CVS $Revision: 1.8 $
|
||||||
--
|
--
|
||||||
-- GF source abstract syntax used internally in compilation.
|
-- GF source abstract syntax used internally in compilation.
|
||||||
--
|
--
|
||||||
-- AR 23\/1\/2000 -- 30\/5\/2001 -- 4\/5\/2003
|
-- AR 23\/1\/2000 -- 30\/5\/2001 -- 4\/5\/2003
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Grammar (SourceGrammar,
|
module GF.Grammar.Grammar (SourceGrammar,
|
||||||
SourceModInfo,
|
SourceModInfo,
|
||||||
SourceModule,
|
SourceModule,
|
||||||
SourceAbs,
|
SourceAbs,
|
||||||
@@ -50,12 +50,12 @@ module Grammar (SourceGrammar,
|
|||||||
varLabel
|
varLabel
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Str
|
import GF.Data.Str
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Option ---
|
import GF.Infra.Option ---
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
-- | grammar as presented to the compiler
|
-- | grammar as presented to the compiler
|
||||||
type SourceGrammar = MGrammar Ident Option Info
|
type SourceGrammar = MGrammar Ident Option Info
|
||||||
|
|||||||
@@ -5,23 +5,23 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:12 $
|
-- > CVS $Date: 2005/04/21 16:22:21 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- Creating and using lock fields in reused resource grammars.
|
-- Creating and using lock fields in reused resource grammars.
|
||||||
--
|
--
|
||||||
-- AR 8\/2\/2005 detached from 'compile/MkResource'
|
-- AR 8\/2\/2005 detached from 'compile/MkResource'
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Lockfield (lockRecType, unlockRecord, lockLabel, isLockLabel) where
|
module GF.Grammar.Lockfield (lockRecType, unlockRecord, lockLabel, isLockLabel) where
|
||||||
|
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
lockRecType :: Ident -> Type -> Err Type
|
lockRecType :: Ident -> Type -> Err Type
|
||||||
lockRecType c t@(RecType rs) =
|
lockRecType c t@(RecType rs) =
|
||||||
@@ -43,4 +43,4 @@ lockLabel c = LIdent $ "lock_" ++ prt c ----
|
|||||||
isLockLabel :: Label -> Bool
|
isLockLabel :: Label -> Bool
|
||||||
isLockLabel l = case l of
|
isLockLabel l = case l of
|
||||||
LIdent c -> take 5 c == "lock_"
|
LIdent c -> take 5 c == "lock_"
|
||||||
_ -> False
|
_ -> False
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:12 $
|
-- > CVS $Date: 2005/04/21 16:22:22 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.12 $
|
-- > CVS $Revision: 1.13 $
|
||||||
--
|
--
|
||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module LookAbs (GFCGrammar,
|
module GF.Grammar.LookAbs (GFCGrammar,
|
||||||
lookupAbsDef,
|
lookupAbsDef,
|
||||||
lookupFunType,
|
lookupFunType,
|
||||||
lookupCatContext,
|
lookupCatContext,
|
||||||
@@ -31,15 +31,15 @@ module LookAbs (GFCGrammar,
|
|||||||
lookupCatContextSrc
|
lookupCatContextSrc
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import qualified GFC as C
|
import qualified GF.Canon.GFC as C
|
||||||
import Abstract
|
import GF.Grammar.Abstract
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
|
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
|
|
||||||
import List (nub)
|
import Data.List (nub)
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
type GFCGrammar = C.CanonGrammar
|
type GFCGrammar = C.CanonGrammar
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,16 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:12 $
|
-- > CVS $Date: 2005/04/21 16:22:23 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.12 $
|
-- > CVS $Revision: 1.13 $
|
||||||
--
|
--
|
||||||
-- Lookup in source (concrete and resource) when compiling.
|
-- Lookup in source (concrete and resource) when compiling.
|
||||||
--
|
--
|
||||||
-- lookup in resource and concrete in compiling; for abstract, use 'Look'
|
-- lookup in resource and concrete in compiling; for abstract, use 'Look'
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Lookup (lookupResDef,
|
module GF.Grammar.Lookup (lookupResDef,
|
||||||
lookupResType,
|
lookupResType,
|
||||||
lookupParams,
|
lookupParams,
|
||||||
lookupParamValues,
|
lookupParamValues,
|
||||||
@@ -25,13 +25,13 @@ module Lookup (lookupResDef,
|
|||||||
opersForType
|
opersForType
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Abstract
|
import GF.Grammar.Abstract
|
||||||
import Modules
|
import GF.Infra.Modules
|
||||||
import Lockfield
|
import GF.Grammar.Lockfield
|
||||||
|
|
||||||
import List (nub)
|
import Data.List (nub)
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
lookupResDef :: SourceGrammar -> Ident -> Ident -> Err Term
|
lookupResDef :: SourceGrammar -> Ident -> Ident -> Err Term
|
||||||
lookupResDef gr = look True where
|
lookupResDef gr = look True where
|
||||||
|
|||||||
@@ -5,27 +5,27 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/24 11:46:34 $
|
-- > CVS $Date: 2005/04/21 16:22:24 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.7 $
|
-- > CVS $Revision: 1.8 $
|
||||||
--
|
--
|
||||||
-- some more abstractions on grammars, esp. for Edit
|
-- some more abstractions on grammars, esp. for Edit
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module MMacros where
|
module GF.Grammar.MMacros where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Zipper
|
import GF.Data.Zipper
|
||||||
|
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Refresh
|
import GF.Grammar.Refresh
|
||||||
import Values
|
import GF.Grammar.Values
|
||||||
----import GrammarST
|
----import GrammarST
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
|
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
nodeTree :: Tree -> TrNode
|
nodeTree :: Tree -> TrNode
|
||||||
argsTree :: Tree -> [Tree]
|
argsTree :: Tree -> [Tree]
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/24 11:46:34 $
|
-- > CVS $Date: 2005/04/21 16:22:25 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.18 $
|
-- > CVS $Revision: 1.19 $
|
||||||
--
|
--
|
||||||
-- Macros for constructing and analysing source code terms.
|
-- Macros for constructing and analysing source code terms.
|
||||||
--
|
--
|
||||||
@@ -16,16 +16,16 @@
|
|||||||
-- AR 7\/12\/1999 - 9\/5\/2000 -- 4\/6\/2001
|
-- AR 7\/12\/1999 - 9\/5\/2000 -- 4\/6\/2001
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module Macros where
|
module GF.Grammar.Macros where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Str
|
import GF.Data.Str
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
|
|
||||||
import Monad (liftM)
|
import Control.Monad (liftM)
|
||||||
import Char (isDigit)
|
import Data.Char (isDigit)
|
||||||
|
|
||||||
firstTypeForm :: Type -> Err (Context, Type)
|
firstTypeForm :: Type -> Err (Context, Type)
|
||||||
firstTypeForm t = case t of
|
firstTypeForm t = case t of
|
||||||
|
|||||||
@@ -5,26 +5,26 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/02/18 19:21:13 $
|
-- > CVS $Date: 2005/04/21 16:22:26 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: bringert $
|
||||||
-- > CVS $Revision: 1.5 $
|
-- > CVS $Revision: 1.6 $
|
||||||
--
|
--
|
||||||
-- pattern matching for both concrete and abstract syntax. AR -- 16\/6\/2003
|
-- pattern matching for both concrete and abstract syntax. AR -- 16\/6\/2003
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module PatternMatch (matchPattern,
|
module GF.Grammar.PatternMatch (matchPattern,
|
||||||
testOvershadow,
|
testOvershadow,
|
||||||
findMatch
|
findMatch
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Operations
|
import GF.Data.Operations
|
||||||
import Grammar
|
import GF.Grammar.Grammar
|
||||||
import Ident
|
import GF.Infra.Ident
|
||||||
import Macros
|
import GF.Grammar.Macros
|
||||||
import PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
|
|
||||||
import List
|
import Data.List
|
||||||
import Monad
|
import Control.Monad
|
||||||
|
|
||||||
|
|
||||||
matchPattern :: [(Patt,Term)] -> Term -> Err (Term, Substitution)
|
matchPattern :: [(Patt,Term)] -> Term -> Err (Term, Substitution)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user