# how to determine the action from the stack using the LR parsing tables?

I've been having a hard time wrapping my mind around the LR parsing table. Say I have the following table

given the input action of id+id*id$ how does Stack 0E1+6T9*7F10 given input *$ iproduce action of R3?

• You're in state 10 and the input is $. Looking across the chart in the row 10 until we find the column $, we see R3. Why is that confusing? – rici Mar 4 '16 at 22:22
• okay, I was looking through the whole trace, what I didn't get was that for stack 0id5 with the input of +id * id\$, and action R6(use GOTO[0,F]). then the next stack becomes 0F3. How is GOTO [0,F] used here? I can update the question if needed. – please rekt me Mar 4 '16 at 22:41
• GOTO(0,F) is 3, again from looking at the table) which is the new state. – rici Mar 4 '16 at 23:03
• but how does r6 know which goto to pick? it is just arbitrary? – please rekt me Mar 4 '16 at 23:20
• It uses the non-terminal the reduction creates, and the state on top of the stack after the reduction's right-hand side has been popped. So you need to know what production is being reduced; in this case, production number 6. – rici Mar 5 '16 at 0:11