the parser can read .gfm files (but they are not yet compiled all the way)

This commit is contained in:
aarne
2006-01-24 15:18:46 +00:00
parent 10f2fd2457
commit 72b22a54cd
3 changed files with 17 additions and 8 deletions

View File

@@ -12,7 +12,9 @@
-- this module builds the internal GF grammar that is sent to the type checker
-----------------------------------------------------------------------------
module GF.Compile.GetGrammar (getSourceModule, getOldGrammar, getCFGrammar, getEBNFGrammar,
module GF.Compile.GetGrammar (
getSourceModule, getSourceGrammar,
getOldGrammar, getCFGrammar, getEBNFGrammar,
err2err
) where
@@ -50,6 +52,13 @@ getSourceModule file = do
mo1 <- ioeErr $ {- err2err $ -} pModDef tokens
ioeErr $ transModDef mo1
getSourceGrammar :: FilePath -> IOE SourceGrammar
getSourceGrammar file = do
string <- readFileIOE file
let tokens = myLexer string
gr1 <- ioeErr $ {- err2err $ -} pGrammar tokens
ioeErr $ transGrammar gr1
-- for old GF format with includes