Here:https://www.cs.rochester.edu/~nelson/courses/csc_173/grammars/parsing.htmlin chapter Driver Procedure, it's shown how table-drive predictive parsing works.The predict table however can involve $\epsilon$-productions (which leads to including a production in the symbols of $FOLLOW(w)$, where $w$ is a non-terminal/row, in addition to $FIRST(w)$) and I cannot find how these should be treated. I.e. how should the parser decide whether it predicts for an $\epsilon$-production or non- $\epsilon$-production. I.e. e.g. how should the end of the string be handled by the Driver.Case example:Such production involving the $\epsilon$ could be e.g.$$A \rightarrow \text{B | c | $\epsilon$}$$ where c is a terminal and B is a non-terminal.The remaining input could be . So how should the driver decide to match with the $\epsilon$ and not e.g. something that the non-terminal $B$ leads to.A guess would be that it tries all of the symbols between the $|$s but fails in other than the $\epsilon$.
How to treat -productions in table-driven predictive parsing?
algorithms;formal grammars;parsers;ll k