Question: I need help with this Compiler Design problem. It is a bottom up parsing to be exact. Please help !! 1. The goal is to

I need help with this Compiler Design problem. It is a bottom up parsing to be exact. Please help !!

I need help with this Compiler Design problem. It is a bottomup parsing to be exact. Please help !! 1. The goal isto develop an SLR(1) parser for the grammar below. Rule 0 hasbeen added to make the starting point for parse unique. There are

1. The goal is to develop an SLR(1) parser for the grammar below. Rule 0 has been added to make the starting point for parse unique. There are 5 rules and the follow sets are FollowtS-Follow(7)-(X, #, (, " ,"J 3. T-S) (The language is for n-tuples of x's, with the outermost pair of parentheses optional. Examples include , (X, , X) and (X, (, , ) ). [25 points] Develop the SLR parsing characteristic finite state machine for this grammar. Start with the initial LR(0) item. S, S #, then include its S-. . . . closure items, which will force you to include the T items. For each item in the state, indicate the action to be taken. The first couple of lines of the machine description are shown below. The action "s2" means shift and go to state number 2. The action "srl" means "shift then reduce using rule 1. (For uniformity, I'll apply "shift" to both terminals and nonterminals) You'll need five states containing a total of 17 items. For grading, the baseline is 5 points per state (more or less, depending on how many items the state contains). a. State # 1 Item Action s2 sr on Follow(S) (Note: "on Follow(S)" means "If the next character E Follow(S), then reduce" 1. The goal is to develop an SLR(1) parser for the grammar below. Rule 0 has been added to make the starting point for parse unique. There are 5 rules and the follow sets are FollowtS-Follow(7)-(X, #, (, " ,"J 3. T-S) (The language is for n-tuples of x's, with the outermost pair of parentheses optional. Examples include , (X, , X) and (X, (, , ) ). [25 points] Develop the SLR parsing characteristic finite state machine for this grammar. Start with the initial LR(0) item. S, S #, then include its S-. . . . closure items, which will force you to include the T items. For each item in the state, indicate the action to be taken. The first couple of lines of the machine description are shown below. The action "s2" means shift and go to state number 2. The action "srl" means "shift then reduce using rule 1. (For uniformity, I'll apply "shift" to both terminals and nonterminals) You'll need five states containing a total of 17 items. For grading, the baseline is 5 points per state (more or less, depending on how many items the state contains). a. State # 1 Item Action s2 sr on Follow(S) (Note: "on Follow(S)" means "If the next character E Follow(S), then reduce

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!