Writing a Context-Free-Grammar using Backus Naur Form for a for-loop? I'm pretty new to CFG, and I've tried out some samples as well. As of now I'm trying this for-loop to write it in CFG using BNF:

Start{
    int z = 20;
    for(int b = 0; b &lt; 5; b++)  
    {
        //some statement
    }
}


Attempted BNF:

&lt;program&gt; ::= Start &lt;blockstatements&gt;
&lt;blockstatements&gt; ::= &lt;statement&gt; | &lt;statement&gt;; | &lt;statement_list&gt; | &lt;empty&gt;
&lt;statement&gt; ::= &lt;typespecification&gt; &lt;varDeclaration&gt; &lt;assignment-operator&gt; &lt;expression&gt; 
&lt;typespecification&gt; ::= char | short | int | long | float | double | string
&lt;varDeclaration&gt; ::= a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | x | y | z
&lt;assignment-operator&gt; ::= =
&lt;expression&gt; ::= &lt;value&gt; 
&lt;value&gt; ::= &lt;digit&gt; | &lt;letter&gt; | &lt;number&gt; | &lt;word&gt; 
&lt;digit&gt; ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
&lt;letter&gt; ::= "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | 
            "T" | "U" | "V" | "W" | "X" | "Y" | "Z" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | 
            "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z"
&lt;number&gt; ::= &lt;digit&gt; + &lt;digit&gt; | &lt;digit&gt; - &lt;digit&gt; | &lt;digit&gt; * &lt;digit&gt; | &lt;digit&gt; / &lt;digit&gt;


The above CFG isn't complete and I wanted to make sure that I'm doing it correctly. Am I heading towards the right path? Should it be written as above or have I missed anything?

Any help could be appreciated.
I've usually seen it expressed as something like:

forExpression ::= for ( &lt;declExpression&gt; &lt;expression&gt;; &lt;expression&gt; ) &lt;blockStatement&gt;

blockStatement ::= &lt;statement&gt; |  { &lt;statementlist&gt; }

statement ::= &lt;declExpression&gt; | &lt;forExpression&gt; | &lt;ifExpression&gt; | ...


&lt;declExpression&gt; includes the semi colon 

You want to be very careful of the details like where you define where things like the semi colon are required, 

In your &lt;number&gt; you don't have any priorities set up, there is also no option for parenthesis, ... 

Creating a good CFG is hard which is why so many languages start out as a dialect of C and just take that grammar and adapt it.