mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-09 03:02:50 -06:00
test for new GF source format
This commit is contained in:
29
src/GF/Devel/TestGF3.hs
Normal file
29
src/GF/Devel/TestGF3.hs
Normal file
@@ -0,0 +1,29 @@
|
||||
module Main where
|
||||
|
||||
import GF.Devel.Grammar.LexGF
|
||||
import GF.Devel.Grammar.ParGF
|
||||
---- import GF.Devel.Grammar.PrintGF
|
||||
import GF.Devel.Grammar.AbsGF
|
||||
|
||||
import GF.Devel.Grammar.SourceToGF
|
||||
|
||||
import qualified GF.Devel.Grammar.ErrM as GErr ----
|
||||
import GF.Data.Operations
|
||||
|
||||
import System (getArgs)
|
||||
|
||||
main = do
|
||||
f:_ <- getArgs
|
||||
s <- readFile f
|
||||
let tt = myLexer s
|
||||
case pGrammar tt of
|
||||
GErr.Bad s -> putStrLn s
|
||||
GErr.Ok g -> compile g
|
||||
|
||||
compile g = do
|
||||
let eg = transGrammar g
|
||||
case eg of
|
||||
Ok _ -> putStrLn "OK"
|
||||
Bad s -> putStrLn s
|
||||
return ()
|
||||
|
||||
Reference in New Issue
Block a user