Question: 1. Perform the following transformations: a) Eliminate left recursion from the following grammar: P Prt | ss b) Apply left factoring on the following grammar:

 1. Perform the following transformations: a) Eliminate left recursion from the

1. Perform the following transformations: a) Eliminate left recursion from the following grammar: P Prt | ss b) Apply left factoring on the following grammar: expr (term + term) * term I (term + term) / term 2. For the grammar given below: XTnSRmRomSTSpTq a) Compute the FIRST and the FOLLOW and write in the form of columns. b) Construct the predictive parsing table. 3. Draw and show the contents of the stack after processing input string abaab using following LR(0) parsing table: 4. Draw and show the contents of the stack after processing input string id+id+id using following SLR(1) parsing table: 5. Construct the tree and write the values of nodes/attributes (where needed) after performing Syntax Directed Translation for the string 324+3 using following SDD: EE1+T{E,value=E1.value+T,value;}{E.value=T.value;}TT1+F{T.value=T1.value.value;}IF{T.value=F,value;}Fnum{F.value=num.value;}

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!