mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-28 22:12:51 -06:00
moved all old source code to src-2.9 ; src will be for GF 3 development
This commit is contained in:
43
src-2.9/GF/API/BatchTranslate.hs
Normal file
43
src-2.9/GF/API/BatchTranslate.hs
Normal file
@@ -0,0 +1,43 @@
|
||||
----------------------------------------------------------------------
|
||||
-- |
|
||||
-- Module : BatchTranslate
|
||||
-- Maintainer : Aarne Ranta
|
||||
-- Stability : (stable)
|
||||
-- Portability : (portable)
|
||||
--
|
||||
-- > CVS $Date: 2005/04/21 16:21:05 $
|
||||
-- > CVS $Author: bringert $
|
||||
-- > CVS $Revision: 1.6 $
|
||||
--
|
||||
-- translate OCL, etc, files in batch mode
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
module GF.API.BatchTranslate (translate) where
|
||||
|
||||
import GF.API
|
||||
import GetMyTree (file2tree)
|
||||
|
||||
translate :: FilePath -> FilePath -> IO ()
|
||||
translate fgr txt = do
|
||||
gr <- file2grammar fgr
|
||||
s <- file2tree txt
|
||||
putStrLn $ linearize gr s
|
||||
|
||||
|
||||
{- headers for model-specific grammars:
|
||||
|
||||
abstract userDefined = oclLibrary ** {
|
||||
|
||||
--# -path=.:abstract:prelude:English:ExtraEng
|
||||
concrete userDefinedEng of userDefined = oclLibraryEng ** open externalOperEng in {
|
||||
|
||||
--# -path=.:abstract:prelude:German:ExtraGer
|
||||
concrete userDefinedGer of userDefined = oclLibraryGer ** open
|
||||
externalOperGer in {
|
||||
|
||||
|
||||
It seems we should add open
|
||||
|
||||
ParadigmsX, ResourceExtX, PredicationX
|
||||
|
||||
-}
|
||||
Reference in New Issue
Block a user