Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

19. Consider the following grammar and LR parse table, and the current stack-con

ID: 3735594 • Letter: 1

Question

19. Consider the following grammar and LR parse table, and the current stack-content and input string to be processed (as we discussed in the class) Figure 4.5 The LR parsing table for an arithmetic expression grammar State id S4 S6 R2 S7 R4 R4 R2 R2 R4 R4 5, F (E) 6. Fid R6 R6 R6 R6 S4 10 R1 R3 R3 RSR5 S11 R1 R3 R3 R1 10 Current Stack Content: OE1+6T97 Current Input:) S The Next stack-content and input-string will be A. Stack: OE1+6T9 Input:) S B. Stack: OE1+6T9*7F10 Input:) S C. Stack: 0E1+6T9*7(4 Input: S D. Stack: OE1+6T9 Input: S E. None of the above

Explanation / Answer

The answer will be none of these.

Becuase in the stack in 0E1+6T9*7 in the top of the stack the element is 7 and input is ) $.

so based on the match 70 there is neither shift nor reduce action.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote