summaryrefslogtreecommitdiff
path: root/src/GF/Compile/GetGrammar.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2006-01-24 15:18:46 +0000
committeraarne <aarne@cs.chalmers.se>2006-01-24 15:18:46 +0000
commite8d50c3841380fd46ca511da532fc1aca6c7335a (patch)
tree7e2a94f8fe337d7496e5630ddf71e11543149e44 /src/GF/Compile/GetGrammar.hs
parentbcb62c87c58be2e922d9d7afb0476cbec8323043 (diff)
the parser can read .gfm files (but they are not yet compiled all the way)
Diffstat (limited to 'src/GF/Compile/GetGrammar.hs')
-rw-r--r--src/GF/Compile/GetGrammar.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/GF/Compile/GetGrammar.hs b/src/GF/Compile/GetGrammar.hs
index a848c9bcf..4eebc2845 100644
--- a/src/GF/Compile/GetGrammar.hs
+++ b/src/GF/Compile/GetGrammar.hs
@@ -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