summaryrefslogtreecommitdiff
path: root/src/GF
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-11-27 14:23:11 +0000
committeraarne <aarne@cs.chalmers.se>2007-11-27 14:23:11 +0000
commitba938b3530d2044de05569aa10b2139fc794ea8a (patch)
treef4b5fcfd6da841cd075710c6845500e5451198df /src/GF
parent8852637997be27a86c65740ddb14d5e9e183c1ee (diff)
started experimental new module syntax
Diffstat (limited to 'src/GF')
-rw-r--r--src/GF/Devel/Modules.hs42
-rw-r--r--src/GF/Source/GF.cf2
2 files changed, 43 insertions, 1 deletions
diff --git a/src/GF/Devel/Modules.hs b/src/GF/Devel/Modules.hs
new file mode 100644
index 000000000..811f93899
--- /dev/null
+++ b/src/GF/Devel/Modules.hs
@@ -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
+
diff --git a/src/GF/Source/GF.cf b/src/GF/Source/GF.cf
index 9cb3faf66..7b12952d8 100644
--- a/src/GF/Source/GF.cf
+++ b/src/GF/Source/GF.cf
@@ -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 ;