started direct compiler from GF to GFCC

This commit is contained in:
aarne
2007-05-15 16:35:13 +00:00
parent 8af473a6f5
commit 035689f8c7
8 changed files with 516 additions and 3 deletions

View File

@@ -38,6 +38,7 @@ import GF.Compile.CheckGrammar
import GF.Compile.Optimize
import GF.Compile.Evaluate
import GF.Compile.GrammarToCanon
import GF.Compile.GrammarToGFCC -----
import GF.Canon.Share
import GF.Canon.Subexpressions (elimSubtermsMod,unSubelimModule)
import GF.UseGrammar.Linear (unoptimizeCanonMod) ----
@@ -293,6 +294,11 @@ compileSourceModule opts env@(k,gr,can,eenv) mo@(i,mi) = do
generateModuleCode :: Options -> InitPath -> SourceModule -> IOE GFC.CanonModule
generateModuleCode opts path minfo@(name,info) = do
if oElem (iOpt "gfcc") opts
then ioeIO $ putStrLn $ prGrammar2gfcc minfo
else return ()
let pname = prefixPathName path (prt name)
minfo0 <- ioeErr $ redModInfo minfo
let oopts = addOptions opts (iOpts (flagsModule minfo))