mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
Added new GF.cf.
This commit is contained in:
@@ -71,10 +71,10 @@ ISome. Included ::= Ident "[" [Ident] "]" ;
|
|||||||
|
|
||||||
-- definitions after the $oper$ keywords
|
-- definitions after the $oper$ keywords
|
||||||
|
|
||||||
DDecl. Def ::= [Ident] ":" Exp ;
|
DDecl. Def ::= [Name] ":" Exp ;
|
||||||
DDef. Def ::= [Ident] "=" Exp ;
|
DDef. Def ::= [Name] "=" Exp ;
|
||||||
DPatt. Def ::= Ident [Patt] "=" Exp ; -- non-empty pattern list
|
DPatt. Def ::= Name [Patt] "=" Exp ; -- non-empty pattern list
|
||||||
DFull. Def ::= [Ident] ":" Exp "=" Exp ;
|
DFull. Def ::= [Name] ":" Exp "=" Exp ;
|
||||||
|
|
||||||
-- top-level definitions
|
-- top-level definitions
|
||||||
|
|
||||||
@@ -97,7 +97,10 @@ DefPrintCat. TopDef ::= "printname" "cat" [PrintDef] ;
|
|||||||
DefPrintFun. TopDef ::= "printname" "fun" [PrintDef] ;
|
DefPrintFun. TopDef ::= "printname" "fun" [PrintDef] ;
|
||||||
DefFlag. TopDef ::= "flags" [FlagDef] ;
|
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 ;
|
FunDef. FunDef ::= [Ident] ":" Exp ;
|
||||||
|
|
||||||
DataDef. DataDef ::= Ident "=" [DataConstr] ;
|
DataDef. DataDef ::= Ident "=" [DataConstr] ;
|
||||||
@@ -112,7 +115,7 @@ ParDefAbs. ParDef ::= Ident ;
|
|||||||
|
|
||||||
ParConstr. ParConstr ::= Ident [DDecl] ;
|
ParConstr. ParConstr ::= Ident [DDecl] ;
|
||||||
|
|
||||||
PrintDef. PrintDef ::= [Ident] "=" Exp ;
|
PrintDef. PrintDef ::= [Name] "=" Exp ;
|
||||||
|
|
||||||
FlagDef. FlagDef ::= Ident "=" Ident ;
|
FlagDef. FlagDef ::= Ident "=" Ident ;
|
||||||
|
|
||||||
@@ -129,6 +132,13 @@ separator ParConstr "|" ;
|
|||||||
|
|
||||||
separator nonempty Ident "," ;
|
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
|
-- definitions in records and $let$ expressions
|
||||||
|
|
||||||
LDDecl. LocDef ::= [Ident] ":" Exp ;
|
LDDecl. LocDef ::= [Ident] ":" Exp ;
|
||||||
@@ -141,13 +151,14 @@ separator LocDef ";" ;
|
|||||||
|
|
||||||
EIdent. Exp4 ::= Ident ;
|
EIdent. Exp4 ::= Ident ;
|
||||||
EConstr. Exp4 ::= "{" Ident "}" ;
|
EConstr. Exp4 ::= "{" Ident "}" ;
|
||||||
ECons. Exp4 ::= "[" Ident "]" ;
|
ECons. Exp4 ::= "%" Ident "%" ;
|
||||||
ESort. Exp4 ::= Sort ;
|
ESort. Exp4 ::= Sort ;
|
||||||
EString. Exp4 ::= String ;
|
EString. Exp4 ::= String ;
|
||||||
EInt. Exp4 ::= Integer ;
|
EInt. Exp4 ::= Integer ;
|
||||||
EMeta. Exp4 ::= "?" ;
|
EMeta. Exp4 ::= "?" ;
|
||||||
EEmpty. Exp4 ::= "[" "]" ;
|
EEmpty. Exp4 ::= "[" "]" ;
|
||||||
EData. Exp4 ::= "data" ;
|
EData. Exp4 ::= "data" ;
|
||||||
|
EList. Exp4 ::= "[" Ident Exps "]" ;
|
||||||
EStrings. Exp4 ::= "[" String "]" ;
|
EStrings. Exp4 ::= "[" String "]" ;
|
||||||
ERecord. Exp4 ::= "{" [LocDef] "}" ; -- !
|
ERecord. Exp4 ::= "{" [LocDef] "}" ; -- !
|
||||||
ETuple. Exp4 ::= "<" [TupleComp] ">" ; --- needed for separator ","
|
ETuple. Exp4 ::= "<" [TupleComp] ">" ; --- needed for separator ","
|
||||||
@@ -156,7 +167,7 @@ ETyped. Exp4 ::= "<" Exp ":" Exp ">" ; -- typing, used for annotations
|
|||||||
|
|
||||||
EProj. Exp3 ::= Exp3 "." Label ;
|
EProj. Exp3 ::= Exp3 "." Label ;
|
||||||
EQConstr. Exp3 ::= "{" Ident "." Ident "}" ; -- qualified constructor
|
EQConstr. Exp3 ::= "{" Ident "." Ident "}" ; -- qualified constructor
|
||||||
EQCons. Exp3 ::= "[" Ident "." Ident "]" ; -- qualified constant
|
EQCons. Exp3 ::= "%" Ident "." Ident "%" ; -- qualified constant
|
||||||
|
|
||||||
EApp. Exp2 ::= Exp2 Exp3 ;
|
EApp. Exp2 ::= Exp2 Exp3 ;
|
||||||
ETable. Exp2 ::= "table" "{" [Case] "}" ;
|
ETable. Exp2 ::= "table" "{" [Case] "}" ;
|
||||||
@@ -187,6 +198,10 @@ coercions Exp 4 ;
|
|||||||
|
|
||||||
separator Exp ";" ; -- in variants
|
separator Exp ";" ; -- in variants
|
||||||
|
|
||||||
|
-- list of arguments to category
|
||||||
|
NilExp. Exps ::= ;
|
||||||
|
ConsExp. Exps ::= Exp4 Exps ; -- Exp4 to force parantheses
|
||||||
|
|
||||||
-- patterns
|
-- patterns
|
||||||
|
|
||||||
PW. Patt1 ::= "_" ;
|
PW. Patt1 ::= "_" ;
|
||||||
|
|||||||
Reference in New Issue
Block a user