BNF syntax.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 14 Jun 2010 21:11:02 +0300
changeset 418 3a5d2c76aa30
parent 417 4c80060f42bd
child 419 645990ee83c8
BNF syntax.
bnf.rst
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bnf.rst	Mon Jun 14 21:11:02 2010 +0300
@@ -0,0 +1,40 @@
+-*- mode: outline; coding: utf-8 -*-
+
+* What is BNF?
+
+BNF is an acronym for "Backus Naur Form". John Backus and Peter Naur
+introduced for the first time a formal notation to describe the syntax of a
+given language (ALGOL 60 programming language).
+
+  rfc2234
+
+* BNF syntax.
+
+The meta-symbols of BNF are:
+
+  ::=
+    meaning "is defined as"
+  |
+    meaning "or"
+  < >
+    angle brackets used to surround category names (some times skipped).
+  [  ]
+    optional items are enclosed in.
+  { }
+    repetitive items (zero or more times) are enclosed in.
+  " "
+    terminals are enclosed in to distinguish them from meta-symbols.
+
+* BNF in BNF.
+
+  syntax     ::=  { rule }
+  rule       ::=  identifier  "::="  expression
+  expression ::=  term { "|" term }
+  term       ::=  factor { factor }
+  factor     ::=  identifier |
+                  quoted_symbol |
+                  "("  expression  ")" |
+                  "["  expression  "]" |
+                  "{"  expression  "}"
+  identifier ::=  letter { letter | digit }
+  quoted_symbol ::= """ { any_character } """