mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-30 06:52:49 -06:00
Founding the newly structured GF2.0 cvs archive.
This commit is contained in:
22
src/GF/Canon/GetGFC.hs
Normal file
22
src/GF/Canon/GetGFC.hs
Normal file
@@ -0,0 +1,22 @@
|
||||
module GetGFC where
|
||||
|
||||
import Operations
|
||||
import ParGFC
|
||||
import GFC
|
||||
import MkGFC
|
||||
import Modules
|
||||
import GetGrammar (err2err) ---
|
||||
import UseIO
|
||||
|
||||
getCanonModule :: FilePath -> IOE CanonModule
|
||||
getCanonModule file = do
|
||||
gr <- getCanonGrammar file
|
||||
case modules gr of
|
||||
[m] -> return m
|
||||
_ -> ioeErr $ Bad "expected exactly one module in a file"
|
||||
|
||||
getCanonGrammar :: FilePath -> IOE CanonGrammar
|
||||
getCanonGrammar file = do
|
||||
s <- ioeIO $ readFileIf file
|
||||
c <- ioeErr $ err2err $ pCanon $ myLexer s
|
||||
return $ canon2grammar c
|
||||
Reference in New Issue
Block a user