forked from GitHub/gf-core
started experimental new module syntax
This commit is contained in:
42
src/GF/Devel/Modules.hs
Normal file
42
src/GF/Devel/Modules.hs
Normal file
@@ -0,0 +1,42 @@
|
||||
module GF.Devel.Modules where
|
||||
|
||||
import GF.Grammar.Grammar
|
||||
import GF.Infra.Ident
|
||||
|
||||
import Data.Map
|
||||
|
||||
|
||||
data GF = GF {
|
||||
gfabsname :: Maybe Ident ,
|
||||
gfcncnames :: [Ident] ,
|
||||
gflags :: Map Ident String , -- value of a global flag
|
||||
gfmodules :: Map Ident Module
|
||||
}
|
||||
|
||||
data Module = Module {
|
||||
mtype :: ModuleType,
|
||||
minterfaces :: [(Ident,Ident)], -- non-empty for functors
|
||||
mextends :: [(Ident,MInclude)],
|
||||
mopens :: [(Ident,Ident)], -- used name, original name
|
||||
mflags :: Map Ident String,
|
||||
mjments :: Map Ident (Either Judgement Ident) -- def or indirection
|
||||
}
|
||||
|
||||
data ModuleType =
|
||||
MAbstract
|
||||
| MConcrete Ident
|
||||
| MGrammar
|
||||
|
||||
data Judgement = Judgement {
|
||||
jform :: JudgementForm,
|
||||
jtype :: Type,
|
||||
jdef :: Term,
|
||||
jprintname :: Term
|
||||
}
|
||||
|
||||
data JudgementForm =
|
||||
JCat
|
||||
| JFun
|
||||
| JOper
|
||||
| JParam
|
||||
|
||||
@@ -189,7 +189,7 @@ ECase. Exp4 ::= "case" Exp "of" "{" [Case] "}" ;
|
||||
EVariants. Exp4 ::= "variants" "{" [Exp] "}" ;
|
||||
EPre. Exp4 ::= "pre" "{" Exp ";" [Altern] "}" ;
|
||||
EStrs. Exp4 ::= "strs" "{" [Exp] "}" ;
|
||||
EConAt. Exp4 ::= Ident "@" Exp6 ;
|
||||
EConAt. Exp4 ::= Ident "@" Exp6 ; --%
|
||||
|
||||
ESelect. Exp3 ::= Exp3 "!" Exp4 ;
|
||||
ETupTyp. Exp3 ::= Exp3 "*" Exp4 ;
|
||||
|
||||
Reference in New Issue
Block a user