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

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

ID: 3735596 • Letter: 2

Question

20. 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 S5 S4 S6 R2 S7 R4 R4 accept R2 R2 5, F (E) 6, F id R6 R6 R6 R6 S5 S4 10 R1 R3 R3 R5 R5 S11 R1 R3 R3 RSR5 S7 R1 10 Current Stack Content: 0F3 Current Input: +id *id S The Next stack-content and input-string will be A. Stack: 0T2 Input: +id * id S B. Stack: OT4 Input: +id * id S C. Stack: OR4 Input id*id S D. Stack: Oid5 Input: +id * id S E. Stack: OF3T2 Input: +id * id S

Explanation / Answer

initial stack content

0F3

now check with goto part

F on 3 reducest to T(3rd production)

so now stack conatins

OT

now T ON + REDUCE TO 4

SO FINAL STACK CONTENR

0T4