# Choosing correct action in bottom up parsing

Using grammar:

$$S \to aABe \\ A \to bcA \mid c \\ B \to b$$

to bottom parse a string $$abcccde$$, the course of action would be: $$\begin{array}{c|c|c|c} \hline Step & Stack & Input & Action \\ \hline 1 & \epsilon & abccde & Shift \\ 2 & a & bccde & Shift \\ 3 & ab & ccde & Shift \\ 4 & abc & cde & Shift \\ 5 & abcc & de & Reduce \, by \, A \to c \\ 6 & abcA & de & Reduce \, by \, A \to bcA \\ 7 & aA & de & Shift \\ 8 & aAd & e & Reduce \, by \, B \to d \\ 9 & aAB & e & Shift \\ 10 & aABe & \epsilon & Reduce \, by \, S \to aABe \\ 11 & S & \epsilon & Done \end{array}$$

My questions are:

1. At step 4, why do we choose to Shift rather than to reduce $$A \to c$$.
2. How would a parser decide which is correct to choose?