mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-16 08:19:31 -06:00
external translator
This commit is contained in:
31
src/GF/API/BatchTranslate.hs
Normal file
31
src/GF/API/BatchTranslate.hs
Normal file
@@ -0,0 +1,31 @@
|
||||
module BatchTranslate where
|
||||
|
||||
import API
|
||||
import GetMyTree (file2tree)
|
||||
|
||||
-- translate OCL, etc, files in batch mode
|
||||
|
||||
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