summaryrefslogtreecommitdiff
path: root/src/GF/API/BatchTranslate.hs
blob: 783cc72961c660e6a28cbcec272f25e678c1ebc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
----------------------------------------------------------------------
-- |
-- Module      : BatchTranslate
-- Maintainer  : Aarne Ranta
-- Stability   : (stable)
-- Portability : (portable)
--
-- > CVS $Date $ 
-- > CVS $Author $
-- > CVS $Revision $
--
-- translate OCL, etc, files in batch mode
-----------------------------------------------------------------------------

module BatchTranslate (translate) where

import 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

-}