Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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, 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started