After defining pushdown automaton in Sipser's book at p. 113:
at the bottom of p.114, he tries to describe a way to make a diagram for pushdown automaton as following:
My question is about the part "If $a$ is $\epsilon$, the machine may make this transition without reading any symbol from the input." But in many examples in the book, it seems some $\epsilon$s which are in place of $a$ must be interpreted as an empty string to show that the pointer is reached to the end of input. For example in the following diagram, we must interpret the first $\epsilon$ in the label of the transition between $q_3$ and $q_4$ to an empty string which shows the end of input string:
Otherwise, it can accept $01^2$. Since, if we interpret $\epsilon,\$\to\epsilon$ as to make this transition from $q_3$ to $q_4$ without reading the second 1, then $01^2$ would be accepted.
Now my question is how a PDA decides if that $\epsilon$ is for moving without reading any symbol from input or that $\epsilon$ is an empty string?