summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-10-04 14:13:45 +0000
committeraarne <aarne@cs.chalmers.se>2007-10-04 14:13:45 +0000
commit923cfe84f0156265a5ebad7197b15aa8e09d9fc1 (patch)
tree29745670f5ca5598dc58a6e12a1844abdd032870 /src
parentafbab92605017007ce6fed3922bc4956c2edbfbe (diff)
started new GFCC syntax with dep. types etc
Diffstat (limited to 'src')
-rw-r--r--src/GF/Devel/GFCC/GFCC.cf73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/GF/Devel/GFCC/GFCC.cf b/src/GF/Devel/GFCC/GFCC.cf
new file mode 100644
index 000000000..317002635
--- /dev/null
+++ b/src/GF/Devel/GFCC/GFCC.cf
@@ -0,0 +1,73 @@
+Grm. Grammar ::= Header ";" Abstract ";" [Concrete] ;
+Hdr. Header ::= "grammar" CId "(" [CId] ")" ;
+
+Abs. Abstract ::=
+ "abstract" "{"
+ "flags" [Flag]
+ "cat" [CatDef]
+ "fun" [FunDef]
+ "}" ;
+
+Cnc. Concrete ::=
+ "concrete" CId "{"
+ "flags" [Flag]
+ "oper" [LinDef]
+ "lincat" [LinDef]
+ "lindef" [LinDef]
+ "lin" [LinDef]
+ "}" ;
+
+Flg. Flag ::= CId "=" String ;
+
+Cat. CatDef ::= CId [Hypo] ;
+
+Fun. FunDef ::= CId ":" Type "=" Exp ;
+
+Lin. LinDef ::= CId "=" Term ;
+
+Hyp. Hypo ::= "(" CId ":" Type ")" ;
+
+FTyp. Type ::= [CId] "->" CId ; -- simple type
+DTyp. Type ::= "[" [Hypo] "->" Type "]" ; -- dep. product type
+BTyp. Type ::= "(" CId [Exp] ")" ; -- dep. basic type
+
+Tr. Exp ::= "(" Atom [Exp] ")" ; -- ordinary term
+DTr. Exp ::= "[" "(" [CId] ")" Atom [Exp] "]" ; -- term with bindings
+
+AC. Atom ::= CId ;
+AS. Atom ::= String ;
+AI. Atom ::= Integer ;
+AF. Atom ::= Double ;
+AM. Atom ::= "?" ;
+trA. Exp ::= Atom ;
+define trA a = Tr a [] ;
+
+R. Term ::= "[" [Term] "]" ; -- record/table
+P. Term ::= "(" Term "!" Term ")" ; -- projection/selection
+S. Term ::= "(" [Term] ")" ; -- sequence with ++
+K. Term ::= Tokn ; -- token
+V. Term ::= "$" Integer ; -- argument
+C. Term ::= Integer ; -- parameter value/label
+F. Term ::= CId ; -- global constant
+FV. Term ::= "[|" [Term] "|]" ; -- free variation
+W. Term ::= "(" String "+" Term ")" ; -- prefix + suffix table
+TM. Term ::= "?" ; -- lin of metavariable
+
+KS. Tokn ::= String ;
+KP. Tokn ::= "[" "pre" [String] "[" [Variant] "]" "]" ;
+Var. Variant ::= [String] "/" [String] ;
+
+
+terminator Concrete ";" ;
+terminator Flag ";" ;
+terminator CatDef ";" ;
+terminator FunDef ";" ;
+terminator LinDef ";" ;
+terminator Hypo "" ;
+separator CId "," ;
+separator Term "," ;
+terminator Exp "" ;
+terminator String "" ;
+separator Variant "," ;
+
+token CId (('_' | letter) (letter | digit | '\'' | '_')*) ;