Question: Programming languages are often described using an extended form of context-free grammar, where square brackets are used to denote an optional construct. For example, A
Programming languages are often described using an extended form of context-free grammar, where square brackets are used to denote an optional construct. For example, A B[C]D says that an A can be replaced by a B and a D, with an optional C between them. This notation does not allow us to describe anything but context-free languages, since an extended production can always be replaced by several conventional productions.
Suppose a grammar has the extended productions:
A B[CD]EF | BC[DE]F
Convert this pair of extended productions to conventional productions. Identify, from the list below, the conventional productions that are equivalent to the extended productions above.
a) A BCDEF | BEF
b) A BA1F
A1 CD | DE |
c) A BA1EF | BCA2F
A1 CD |
A2 DE |
d) A BA1EF | BCA2F
A1 CD
A2 DE
What is the answer? Explain me Plz
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
