Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

BNF Grammar Question: ------------------------------------------------------------------------------ The BNF Grammar below defines a decimal digit calculator expression language: The BNF grammar below defines a decimal digit calculator (DDC)

BNF Grammar Question:

------------------------------------------------------------------------------

The BNF Grammar below defines a decimal digit calculator expression language:

The BNF grammar below defines a decimal digit calculator (DDC) expression language: -> | -> | -> | -> 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 -> + | - -> * | /

------------------------------------------------------------------------------

a) the grammar is ambiguous, demostrate that the grammer is indeed ambiguous.

b) correct the grammar so that it is unambiguous

c) According to your unambiguous grammar, what is the value of 7+6*3/2?

d) if we change the BNF description of and to read

-> *|/

-> +|-

what is now the value of 7+6*3/2 in the language described by your corrected grammar?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago