Question: CS 415 Compilers: Problem Set 6 Due date: Monday, April 9, 11:59pm Problem 1 LR(1) Parsing S' := S 2S := L =R R 4L

 CS 415 Compilers: Problem Set 6 Due date: Monday, April 9,

CS 415 Compilers: Problem Set 6 Due date: Monday, April 9, 11:59pm Problem 1 LR(1) Parsing S' := S 2S := L =R R 4L := *R 5 id 6R := L 1. Compute the canonical collection of sets of LR(1) items 2. Construct the LR(1) parse table (ACTION and GOTO) 3. Is the grammar LR(1) or not? Justify your answer. 4. If the grammar is LR(1), show the behavior of the LR(1) parser on input *id = id, i.e., show stack content, current input, and selected action for each move of the machine. Problem 2 LR(0) / SLR(1) Grammars Show that the above grammar (Problem 1) is not LR(0). Note that it is sufficient to show one state where there is a conflict (Hint: you don't need to enumerate all states). Is the grammar SLR(1)? Justify your

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!