mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-07 10:12:51 -06:00
GF/src is now for 2.9, and the new sources are in src-3.0 - keep it this way until the release of GF 3
This commit is contained in:
36
src-3.0/GF/CFGM/CFG.cf
Normal file
36
src-3.0/GF/CFGM/CFG.cf
Normal file
@@ -0,0 +1,36 @@
|
||||
entrypoints Grammars;
|
||||
|
||||
Grammars. Grammars ::= [Grammar];
|
||||
|
||||
Grammar. Grammar ::= "grammar" Ident [Flag] [Rule] "end" "grammar";
|
||||
separator Grammar "";
|
||||
|
||||
StartCat. Flag ::= "startcat" Category;
|
||||
terminator Flag ";";
|
||||
|
||||
Rule. Rule ::= Fun ":" Profiles "." Category "->" [Symbol];
|
||||
terminator Rule ";";
|
||||
|
||||
Cons. Fun ::= Ident ;
|
||||
Coerce. Fun ::= "_" ;
|
||||
|
||||
Profiles. Profiles ::= "[" [Profile] "]";
|
||||
|
||||
separator Profile ",";
|
||||
|
||||
UnifyProfile. Profile ::= "[" [Integer] "]";
|
||||
ConstProfile. Profile ::= Ident ;
|
||||
|
||||
separator Integer ",";
|
||||
|
||||
CatS. Symbol ::= Category;
|
||||
TermS. Symbol ::= String;
|
||||
|
||||
-- separator Symbol "";
|
||||
[]. [Symbol] ::= "." ;
|
||||
(:[]). [Symbol] ::= Symbol ;
|
||||
(:). [Symbol] ::= Symbol [Symbol] ;
|
||||
|
||||
Category. Category ::= SingleQuoteString ;
|
||||
|
||||
token SingleQuoteString '\'' ((char - ["'\\"]) | ('\\' ["'\\"]))* '\'' ;
|
||||
Reference in New Issue
Block a user