summaryrefslogtreecommitdiff
path: root/src/GF/Source/GF.cf
diff options
context:
space:
mode:
authorbringert <unknown>2005-05-26 08:26:18 +0000
committerbringert <unknown>2005-05-26 08:26:18 +0000
commit71c50e18d328d1fbf04749e8a453f1e8390c15f9 (patch)
treeeda553305a858b962b3ffb69e07b31a02138e1b9 /src/GF/Source/GF.cf
parent908add0d17d88965d12861beb3759af4dcdda949 (diff)
Added new GF.cf.
Diffstat (limited to 'src/GF/Source/GF.cf')
-rw-r--r--src/GF/Source/GF.cf31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/GF/Source/GF.cf b/src/GF/Source/GF.cf
index 9dd3eaa1f..9c63d43ee 100644
--- a/src/GF/Source/GF.cf
+++ b/src/GF/Source/GF.cf
@@ -71,10 +71,10 @@ ISome. Included ::= Ident "[" [Ident] "]" ;
-- definitions after the $oper$ keywords
-DDecl. Def ::= [Ident] ":" Exp ;
-DDef. Def ::= [Ident] "=" Exp ;
-DPatt. Def ::= Ident [Patt] "=" Exp ; -- non-empty pattern list
-DFull. Def ::= [Ident] ":" Exp "=" Exp ;
+DDecl. Def ::= [Name] ":" Exp ;
+DDef. Def ::= [Name] "=" Exp ;
+DPatt. Def ::= Name [Patt] "=" Exp ; -- non-empty pattern list
+DFull. Def ::= [Name] ":" Exp "=" Exp ;
-- top-level definitions
@@ -97,7 +97,10 @@ DefPrintCat. TopDef ::= "printname" "cat" [PrintDef] ;
DefPrintFun. TopDef ::= "printname" "fun" [PrintDef] ;
DefFlag. TopDef ::= "flags" [FlagDef] ;
-CatDef. CatDef ::= Ident [DDecl] ;
+SimpleCatDef. CatDef ::= Ident [DDecl] ;
+ListCatDef. CatDef ::= "[" Ident [DDecl] "]" ;
+ListSizeCatDef. CatDef ::= "[" Ident [DDecl] "]" "{" Integer "}" ;
+
FunDef. FunDef ::= [Ident] ":" Exp ;
DataDef. DataDef ::= Ident "=" [DataConstr] ;
@@ -112,7 +115,7 @@ ParDefAbs. ParDef ::= Ident ;
ParConstr. ParConstr ::= Ident [DDecl] ;
-PrintDef. PrintDef ::= [Ident] "=" Exp ;
+PrintDef. PrintDef ::= [Name] "=" Exp ;
FlagDef. FlagDef ::= Ident "=" Ident ;
@@ -129,6 +132,13 @@ separator ParConstr "|" ;
separator nonempty Ident "," ;
+-- names of categories and functions in definition LHS
+
+IdentName. Name ::= Ident ;
+ListName. Name ::= "[" Ident "]" ;
+
+separator nonempty Name "," ;
+
-- definitions in records and $let$ expressions
LDDecl. LocDef ::= [Ident] ":" Exp ;
@@ -141,13 +151,14 @@ separator LocDef ";" ;
EIdent. Exp4 ::= Ident ;
EConstr. Exp4 ::= "{" Ident "}" ;
-ECons. Exp4 ::= "[" Ident "]" ;
+ECons. Exp4 ::= "%" Ident "%" ;
ESort. Exp4 ::= Sort ;
EString. Exp4 ::= String ;
EInt. Exp4 ::= Integer ;
EMeta. Exp4 ::= "?" ;
EEmpty. Exp4 ::= "[" "]" ;
EData. Exp4 ::= "data" ;
+EList. Exp4 ::= "[" Ident Exps "]" ;
EStrings. Exp4 ::= "[" String "]" ;
ERecord. Exp4 ::= "{" [LocDef] "}" ; -- !
ETuple. Exp4 ::= "<" [TupleComp] ">" ; --- needed for separator ","
@@ -156,7 +167,7 @@ ETyped. Exp4 ::= "<" Exp ":" Exp ">" ; -- typing, used for annotations
EProj. Exp3 ::= Exp3 "." Label ;
EQConstr. Exp3 ::= "{" Ident "." Ident "}" ; -- qualified constructor
-EQCons. Exp3 ::= "[" Ident "." Ident "]" ; -- qualified constant
+EQCons. Exp3 ::= "%" Ident "." Ident "%" ; -- qualified constant
EApp. Exp2 ::= Exp2 Exp3 ;
ETable. Exp2 ::= "table" "{" [Case] "}" ;
@@ -187,6 +198,10 @@ coercions Exp 4 ;
separator Exp ";" ; -- in variants
+-- list of arguments to category
+NilExp. Exps ::= ;
+ConsExp. Exps ::= Exp4 Exps ; -- Exp4 to force parantheses
+
-- patterns
PW. Patt1 ::= "_" ;