Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the grammar with the following rules (capital letters are nonterminals and S is the start nonterminal): S -> AB | a A -> CD

Consider the grammar with the following rules (capital letters are nonterminals and S is the start nonterminal):

S -> AB | a

A -> CD

B -> bAB |

C-> dSd | c

D -> cCD |

a) Determine each of the sets:

i) FIRST(AB)

ii) FIRST(CD)

iii) FOLLOW(S)

iv) FOLLOW(A)

v) FOLLOW(B)

vi. FOLLOW(C)

vii. FOLLOW(D)

For each element z belonging to a set FOLLOW(X) (X {S,A,B,C,D}) give a derivation starting from S where z occurs directly after X. (Similar sample derivations are not required for FIRST-sets.)

b) Does the grammar allow use of recursive-descent parsing? Justify your answer using your answers from part a.

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_2

Step: 3

blur-text-image_3

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

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions