summaryrefslogtreecommitdiff
path: root/src-2.9/GF/CFGM/CFG.cf
diff options
context:
space:
mode:
Diffstat (limited to 'src-2.9/GF/CFGM/CFG.cf')
-rw-r--r--src-2.9/GF/CFGM/CFG.cf36
1 files changed, 36 insertions, 0 deletions
diff --git a/src-2.9/GF/CFGM/CFG.cf b/src-2.9/GF/CFGM/CFG.cf
new file mode 100644
index 000000000..fa722f4a4
--- /dev/null
+++ b/src-2.9/GF/CFGM/CFG.cf
@@ -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 - ["'\\"]) | ('\\' ["'\\"]))* '\'' ;