Question: The grammar for a number in a particular programming language is defined by the following sets: G[Number] = {( , ), (0, 1, 2, 3,

The grammar for a number in a particular programming language is defined by the following sets:

G[Number] = {(, ), (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, .), P, } where P consists of the

following productions:

R1: ::= | . | . |

R2: ::= 0|1|2|3|4|5|6|7|8|9

6a. Express this grammar using the BNF notation. [03]

6b. Using a derivation tree, show that 123.45 is a valid number. [03]

6c. Using a derivation tree, show that 0.45 is a valid number. [03]

6d. Using a derivation tree, show that 1AF.45 is not a valid number. [03]

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!