Question: 1 . Problem A programmer is provided with the following two grammars: Grammar A S - > qABC A - > a | bbD B

1. Problem
A programmer is provided with the following two grammars:
Grammar A
S->qABC
A->a | bbD
B-> a |\epsi
C-> b |\epsi
D-> c |\epsi
Grammar B
S -> S A | A
A -> a
He is required to design suitable parsers for the two given grammars. Your task is to help him
design appropriate parsers.
2. Deliverables
You need to answer the following. Each question has equal weightage:
i. Show that the grammar A is LL(1) or not (without constructing parsing table).
ii. Show that the grammar B is SLR(1) but not LL(1).
iii. Construct parsing table for grammar A.
iv. Give parsing actions for the input string aaaa for the SLR(1) parser of grammar B.

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!