Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.
Write a set of BNF grammar rules that will parse a programming language that can have variable type declarations such where the variable has name and a type which can be either integer or boolean, and optionally has a constant default value:
var i : integer;
var j : integer = 6;
var b : boolean;
var b2 : boolean = true;
var b3 : boolean = false;
Show an example of why the following grammar is Ambiguous.
<program> -> <stmts>
<stmts> -> <stmts> ; <stmts> | <assignment>
<assignment> -> <var> = <expr>
<var> -> a | b | c | d
<expr> -> <term> + <term> | <term> - <term>
<term> -> <var> | const