Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!