Write a set of bnf grammar rules that will parse a


Assignment

1. 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:

E.g.
var i : integer;
var j : integer = 6;
var b : boolean;
var b2 : boolean = true;
var b3 : boolean = false;

2. Show an example of why the following grammar is Ambiguous.
->
-> ; |
-> =
-> a | b | c | d
-> + | -
-> | const

Solution Preview :

Prepared by a verified Expert
Theory of Computation: Write a set of bnf grammar rules that will parse a
Reference No:- TGS02287599

Now Priced at $35 (50% Discount)

Recommended (97%)

Rated (4.9/5)