Question: ( a ) Give a single regular expression that de nes a language for a new format of International Standard Book Numbers ( ISBNs

"(a) Give a single regular expression that denes a language for a new format of International Standard Book Numbers (ISBNs) such as 960-42-AX.[13] Strings in this language should have the following properties:
i. They must be divided into exactly three sections, separated by hyphens. ii. The rst section must be a non-empty sequence of digits. iii. The second section must be exactly two digits that dene a number in the range zero to fty. iv. The third section must consist of an optional upper case letter, following by either an X or a Y.
(b) Consider the following context-free grammar where A is the start symbol.
A : B | A "","" A. B : ""!""|""("" A "")"".
Draw two parse tre QL03 es that could result when parsing the valid input (!),!,((!)) using this grammar
(c) Rewrite the grammar from part (c) so that it is not ambiguous but still recognises the same strings. Which of the two trees you gave in part (c) is not a legal tree for the rewritten 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 Programming Questions!