Can someone please explain in layman's terms:
what a context-free grammar is?
what Backus Naur Form is?
How to use this notation?
How to do string derivation?
How to describe language syntax?
A context-free grammar (CFG) G is a quadruple (V, Σ, R, S) where
Example of CFG:
As far as I understand, Backus Naur Form (BNF) is another way of representing the things that are shown in the Context-Free Grammar (CFG)
Example of BNF:
[number] ::= [digit] | [number] [digit]
[digit] ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
which can be read as something like: "a number is a digit, or any number followed by an extra digit" (which is a contorted but precise way of saying that a number consists of one or more digits) "a digit is any one of the characters 0, 1, 2, ... 9"
Difference:
Notation of these two representations are a bit different, i-e
--> equals ::=
| equals or
there must be some other differences but to be honest I don't know any other :)
String Derivation:
Let S be the start" symbol
Example of String Derivation:
Does this grammar generate the string 000111?
yes, it does!
that's all from my side, I too am working on it and will surely share if I come to know anymore details about defining the language syntax.
cheers!