summaryrefslogtreecommitdiff
path: root/src-2.9/GF/CFGM/CFG.cf
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-05-20 11:47:44 +0000
committeraarne <aarne@cs.chalmers.se>2008-05-20 11:47:44 +0000
commit31bf84122b21efb444aa8d055472e166ffb90783 (patch)
tree1f051909336f1534346bcccde8dda59beab02f64 /src-2.9/GF/CFGM/CFG.cf
parent74f048dcf41de3540778de54dfa7541fa5b39c46 (diff)
moved all old source code to src-2.9 ; src will be for GF 3 development
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 - ["'\\"]) | ('\\' ["'\\"]))* '\'' ;