From a0d412986305d4b45e82afde62ea48f1b06edb9d Mon Sep 17 00:00:00 2001 From: peb Date: Wed, 9 Feb 2005 11:46:54 +0000 Subject: "Committed_by_peb" --- src/GF/API/BatchTranslate.hs | 6 ++---- src/GF/API/GrammarToHaskell.hs | 12 +++++------- src/GF/API/IOGrammar.hs | 6 ++---- src/GF/API/MyParser.hs | 6 ++---- 4 files changed, 11 insertions(+), 19 deletions(-) (limited to 'src/GF/API') diff --git a/src/GF/API/BatchTranslate.hs b/src/GF/API/BatchTranslate.hs index 5726e6739..88a10a2af 100644 --- a/src/GF/API/BatchTranslate.hs +++ b/src/GF/API/BatchTranslate.hs @@ -9,16 +9,14 @@ -- > CVS $Author $ -- > CVS $Revision $ -- --- (Description of the module) +-- translate OCL, etc, files in batch mode ----------------------------------------------------------------------------- -module BatchTranslate where +module BatchTranslate (translate) where import API import GetMyTree (file2tree) --- translate OCL, etc, files in batch mode - translate :: FilePath -> FilePath -> IO () translate fgr txt = do gr <- file2grammar fgr diff --git a/src/GF/API/GrammarToHaskell.hs b/src/GF/API/GrammarToHaskell.hs index 081d533e3..61e720dd1 100644 --- a/src/GF/API/GrammarToHaskell.hs +++ b/src/GF/API/GrammarToHaskell.hs @@ -9,7 +9,9 @@ -- > CVS $Author $ -- > CVS $Revision $ -- --- (Description of the module) +-- to write a GF abstract grammar into a Haskell module with translations from +-- data objects into GF trees. Example: GSyntax for Agda. +-- AR 11/11/1999 -- 7/12/2000 -- 18/5/2004 ----------------------------------------------------------------------------- module GrammarToHaskell (grammar2haskell) where @@ -20,17 +22,13 @@ import Macros import Modules import Operations --- to write a GF abstract grammar into a Haskell module with translations from --- data objects into GF trees. Example: GSyntax for Agda. --- AR 11/11/1999 -- 7/12/2000 -- 18/5/2004 - --- the main function +-- | the main function grammar2haskell :: GFC.CanonGrammar -> String grammar2haskell gr = foldr (++++) [] $ haskPreamble ++ [datatypes gr', gfinstances gr', fginstances gr'] where gr' = hSkeleton gr --- by this you can prefix all identifiers with stg; the default is 'G' +-- | by this you can prefix all identifiers with stg; the default is 'G' gId :: OIdent -> OIdent gId i = 'G':i diff --git a/src/GF/API/IOGrammar.hs b/src/GF/API/IOGrammar.hs index b74facd4e..5a12e6b42 100644 --- a/src/GF/API/IOGrammar.hs +++ b/src/GF/API/IOGrammar.hs @@ -9,7 +9,7 @@ -- > CVS $Author $ -- > CVS $Revision $ -- --- (Description of the module) +-- for reading grammars and terms from strings and files ----------------------------------------------------------------------------- module IOGrammar where @@ -30,9 +30,7 @@ import Arch import Monad (liftM) --- for reading grammars and terms from strings and files - ---- a heuristic way of renaming constants is used +-- | a heuristic way of renaming constants is used string2absTerm :: String -> String -> Term string2absTerm m = renameTermIn m . pTrm diff --git a/src/GF/API/MyParser.hs b/src/GF/API/MyParser.hs index 60f5541ce..c45f30c3d 100644 --- a/src/GF/API/MyParser.hs +++ b/src/GF/API/MyParser.hs @@ -9,18 +9,16 @@ -- > CVS $Author $ -- > CVS $Revision $ -- --- (Description of the module) +-- template to define your own parser ----------------------------------------------------------------------------- -module MyParser where +module MyParser (myParser) where import ShellState import CFIdent import CF import Operations --- template to define your own parser - -- type CFParser = [CFTok] -> ([(CFTree,[CFTok])],String) myParser :: StateGrammar -> CFCat -> CFParser -- cgit v1.2.3