Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Consider the grammar with the following rules (capital letters are nonterminals and S is the start nonterminal): SUV a UXY VbUVE XdSd C

image text in transcribedimage text in transcribed

3. Consider the grammar with the following rules (capital letters are nonterminals and S is the start nonterminal): SUV a UXY VbUVE XdSd C YcXY E (a) (4 marks) Determine each of the sets i. FIRST(UV) ii. FIRST(XY) iii. FOLLOW (S) iv. FOLLOW (U) v. FOLLOW (V) vi. FOLLOW (X) vii. FOLLOW (Y) For each element z belonging to a set FOLLOW (W) (W {S,U,V,X,Y}) give a derivation starting from S where z occurs directly after W. If z is EOS, give a derivation starting from S where in the resulting string W occurs as the last symbol. (This is not required for the FIRST-sets.) (b) (2 marks) Does the grammar allow the use of recursive-descent parsing? Justify your answer using your answers from part (a) - please be specific and give a detailed answer.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

To solve this problem we need to find the FIRST and FOLLOW sets for the given grammar StepbyStep Solution a Determine Each of the Sets i FIRSTUV U X Y ... 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

Step: 3

blur-text-image

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

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions