Reserved_3
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.
<program> -> <stmts>
<stmts> -> <stmts> ; <stmts> | <assignment>
<assignment> -> <var> = <expr>
<var> -> a | b | c | d
<expr> -> <term> + <term> | <term> - <term>
<term> -> <var> | const
9 years ago
15
Answer(1)![blurred-text]()
![]()
Purchase the answer to view it

NOT RATED
- solution_bnf.docx
Bids(0)
other Questions(10)
- IT 248 web Fundamentals >>
- Questions
- 2 page help
- Service Positioning versus Product Process
- IFM MCQS
- Consider a balanced line consisting of five single-machine stations with exponential process times. Suppose the utilization is 75 percent and...
- Self-Report Measures/ free format vs fixed format/ 3-4 pages/APA/ Word Document/Due Sunday
- You are working for We Are Big Pharma, Inc., an international pharmaceutical firm with over 100, 000 employees located in several different countries
- CMGT 578 Week 2 Individual Assignment Outsourcing Paper
- im
