Input: 4+5$ Step Stack Input Action 1 $(0) 4+5$ Start off in state 0, look at the y.output. If you see a NUMBER in the input, you have to shift state 3 onto the stack. Step Stack Input Action 1 $(0) 4+5$ Shift 2 $(0)4(3) +5$ Now look at the state on top of the stack, it's 3. Look at y.output for state 3. It says expr : NUMBER_ The _ means that's where you are, you've read NUMBER. You can reduce it to expr. Step Stack Input Action 1 $(0) 4+5$ Shift 2 $(0)4(3) +5$ Reduce using expr -> NUMBER 3 $(0)expr +5$ Now look at the last state on the stack, 0. Look at y.output for state 0. It says expr goto 2. So you push 2 onto the stack Step Stack Input Action 1 $(0) 4+5$ Shift 2 $(0)4(3) +5$ Reduce using expr -> NUMBER 3 $(0)expr(2) +5$ Now look at the state on top of the stack, it is 2. Look at y.output for state 2. It says + shift 5. Step Stack Input Action 1 $(0) 4+5$ Shift 2 $(0)4(3) +5$ Reduce using expr -> NUMBER 3 $(0)expr(2) +5$ Shift 4 $(0)expr(2)+(5) 5$ Now look at the state on top of the stack. It is 5. Look at y.output for state 5. It says NUMBER shift 3. Step Stack Input Action 1 $(0) 4+5$ Shift 2 $(0)4(3) +5$ Reduce using expr -> NUMBER 3 $(0)expr(2) +5$ Shift 4 $(0)expr(2)+(5) 5$ Shift 5 $(0)expr(2)+(5)5(3) $ Now look at the state on top of the stack, it is 3. Look at y.output for state 3. It says expr : NUMBER_. You can reduce 5 to expr. Step Stack Input Action 1 $(0) 4+5$ Shift 2 $(0)4(3) +5$ Reduce using expr -> NUMBER 3 $(0)expr(2) +5$ Shift 4 $(0)expr(2)+(5) 5$ Shift 5 $(0)expr(2)+(5)5(3) $ Reduce expr -> NUMBER 6 $(0)expr(2)+(5)expr $ Now look at the state on top of the stack. It is 5. Look at y.output for 5. It says expr goto 10. Step Stack Input Action 1 $(0) 4+5$ Shift 2 $(0)4(3) +5$ Reduce using expr -> NUMBER 3 $(0)expr(2) +5$ Shift 4 $(0)expr(2)+(5) 5$ Shift 5 $(0)expr(2)+(5)5(3) $ Reduce expr -> NUMBER 6 $(0)expr(2)+(5)expr(10) $ Now look at the state on top of the stack, it is 10. Look at y.output for state 10. It says expr : expr+expr_ So you can reduce. Step Stack Input Action 1 $(0) 4+5$ Shift 2 $(0)4(3) +5$ Reduce using expr -> NUMBER 3 $(0)expr(2) +5$ Shift 4 $(0)expr(2)+(5) 5$ Shift 5 $(0)expr(2)+(5)5(3) $ Reduce using expr -> NUMBER 6 $(0)expr(2)+(5)expr(10) $ Reduce using expr -> expr+expr 7 $(0)expr $ Now look at the last state on the stack. It is 0. Look at y.output for state 0. It says expr goto 2. Step Stack Input Action 1 $(0) 4+5$ Shift 2 $(0)4(3) +5$ Reduce using expr -> NUMBER 3 $(0)expr(2) +5$ Shift 4 $(0)expr(2)+(5) 5$ Shift 5 $(0)expr(2)+(5)5(3) $ Reduce using expr -> NUMBER 6 $(0)expr(2)+(5)expr(10) $ Reduce using expr -> expr+expr 7 $(0)expr(2) $ Now look at the state on top of the stack. It is 2. Look at y.output for state 2. It says Line : expr_. So you can reduce Step Stack Input Action 1 $(0) 4+5$ Shift 2 $(0)4(3) +5$ Reduce using expr -> NUMBER 3 $(0)expr(2) +5$ Shift 4 $(0)expr(2)+(5) 5$ Shift 5 $(0)expr(2)+(5)5(3) $ Reduce using expr -> NUMBER 6 $(0)expr(2)+(5)expr(10) $ Reduce using expr -> expr+expr 7 $(0)expr(2) $ Reduce using Line -> expr 8 $(0)Line $ Now look at the state on top of the stack. It is 0. Look at y.output for 0. It says Line goto 1. Step Stack Input Action 1 $(0) 4+5$ Shift 2 $(0)4(3) +5$ Reduce using expr -> NUMBER 3 $(0)expr(2) +5$ Shift 4 $(0)expr(2)+(5) 5$ Shift 5 $(0)expr(2)+(5)5(3) $ Reduce using expr -> NUMBER 6 $(0)expr(2)+(5)expr(10) $ Reduce using expr -> expr+expr 7 $(0)expr(2) $ Reduce using Line -> expr 8 $(0)Line(1) $ Now look at the state on top of the stack, it is 1. Look at y.output for state 1. It says $end accept. Step Stack Input Action 1 $(0) 4+5$ Shift 2 $(0)4(3) +5$ Reduce using expr -> NUMBER 3 $(0)expr(2) +5$ Shift 4 $(0)expr(2)+(5) 5$ Shift 5 $(0)expr(2)+(5)5(3) $ Reduce using expr -> NUMBER 6 $(0)expr(2)+(5)expr(10) $ Reduce using expr -> expr+expr 7 $(0)expr(2) $ Reduce using Line -> expr 8 $(0)Line $ Accept Hope that helps!