views:

525

answers:

0

Hello,

I'm trying to build a parser for the following grammar (dragon book ex. 4.4.1 pg. 231) S->0S1|01

So first I left factored the grammar (eliminate ambiguity for deciding which rule to choose) and the result: S->0S'
S'->0S|1

And constructing the parsing table yielded (apologies for the formatting the table html markup was removed for some reason: Jeff?):

------------------------------
   | 0     | 1      | $      |
------------------------------
S  | S->0S'|        |        |
------------------------------
S' | S'->S1| S'->1  |        |
------------------------------


My Question is: is it ok not to have any entries for the $ (end of the input) symbol, and how does parsing is done by the predictive parser in that case.