mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
the parser can read .gfm files (but they are not yet compiled all the way)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user